Fork me on GitHub
#tools-build
<
2024-05-19
>
roklenarcic16:05:48

When I call create-basis and provide no aliases, does it use aliases that were provided at the command line when running my “tools” build. So if I have build alias that runs build.clj and I run it as -T:build:other does create-basis call in the build.clj pick up on other ? I assume not. Is there a way to run things in my build with all the extra aliases provided at command line?

Alex Miller (Clojure team)17:05:54

If you are using Clojure 1.12 alphas there is a new clojure.java.basis api to obtain the initial basis and the aliases used

Alex Miller (Clojure team)17:05:49

$ clj -A:test -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha11"}}}'
Clojure 1.12.0-alpha11
user=> (require '[clojure.java.basis :as basis])
nil
user=> (-> (basis/initial-basis) :basis-config :aliases)
[:test]

Alex Miller (Clojure team)17:05:10

and then you could pass that to create-basis

Alex Miller (Clojure team)17:05:34

note that this will include your :build alias too, but you can strip that out if needed