This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-22
Channels
- # announcements (8)
- # babashka (4)
- # beginners (164)
- # calva (17)
- # cider (30)
- # cljdoc (4)
- # cljs-dev (6)
- # clojure (103)
- # clojure-europe (63)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-portugal (1)
- # clojure-uk (3)
- # clojured (10)
- # clojuredesign-podcast (2)
- # clojurescript (16)
- # conjure (2)
- # core-async (9)
- # cursive (26)
- # datalevin (4)
- # datomic (156)
- # gratitude (1)
- # holy-lambda (8)
- # honeysql (9)
- # hoplon (6)
- # off-topic (55)
- # polylith (14)
- # portal (21)
- # reagent (5)
- # reitit (16)
- # releases (3)
- # shadow-cljs (87)
- # spacemacs (3)
- # tools-deps (25)
- # xtdb (9)
I am trying to create uberjar for my deps.edn project. i must be doing something wrong but when i run
clj -T:build uber :aot true
i get
-T is no longer supported, use -A with repl, -M for main, or -X for exec
Am i using outdated cli or something?
I am using this lib and i see the -T being used https://github.com/seancorfield/build-clj#standalone-cli-usageI think you might have an older version of the CLI tools. What do you get if you run clj --version
?
WARNING: When invoking clojure.main, use -M
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
--version (No such file or directory)
Full report at:
/tmp/clojure-10539041283103714829.edn
alright you are right. i updated using https://clojure.org/guides/getting_started#_installation_on_linux Thanks a lot!
I fail to recall the old command for checking the version of your Clojure CLI but after the upgrade clojure --version
should give you something like Clojure CLI version 1.11.1.1105
edit: I think it was clojure -Sversion
but that doesn't seem to work anymore
clojure -Sdescribe
will show the version of the Clojure CLI tool along with the paths it uses, so quite a useful tool
clojure -Sverbose
will show the same info, but also run a REPL or clojure code as well, so useful for debugging classpaths and other issues
is it bad to want to have a way to chain multiple -X call in the same process (a bit like lein do ...
?
For a while it was possible to chain calls but that was removed because of exactly those sorts of issues. Write functions to do the chaining and then you have control of that. See build.clj
for example.
it's easy to emulate other ways, it's not so easy when it wants to be dynamic (in the user controlled sense)
if you want a program, write a program, and call that :)
if you want a dynamic program, there's this cool thing called a REPL :)
☝️:skin-tone-2: That is why I mostly run our build.clj
as a REPL instead of a set of tasks to invoke from the CLI:
(! 543)-> clj -M:build -i build.clj -r
Clojure 1.11.1
user=> (-> {} (build/cold-start) (build/all-tests-ci))
...
(I can also do clojure -T:build some-task :the '"args"'
when I need something running standalone elsewhere)
Most build tasks are quite static for us anyway, you never run them manually (ci/cd does the work).
For the rest we re trying to standardize profile names for common aliases across repos to lower the learning curve
We have all sorts of useful stuff in our build.clj
script for local dev/test work -- as well as several for CI/CD automation.
@seancorfield I recently added a :dev
alias to a project where I added "."
to the classpath, so I could do:
clojure -A:build:dev
and just develop tools build from the REPL in addition to the restWe already have a :dev
alias for other reasons (Polylith) but I do often add :build
when starting a REPL so I can work on build.clj
as well as everything else 🙂