Why does clojure
not warn about an unexisting :test
alias?
borkdude@MBP2019 /tmp/p1 $ echo "{}" > deps.edn
borkdude@MBP2019 /tmp/p1 $ clojure -Srepro -A:test
Clojure 1.10.1
user=> ^D
borkdude@MBP2019 /tmp/p1 $ clojure -Srepro -A:testx
WARNING: Specified aliases are undeclared: [:testx]
Clojure 1.10.1
user=>
Also, I figured it would be useful to have something like: clojure -CR:test
to get the same as clojure -C:test -R:test
: use case, I want to run a REPL with the same paths and deps as the :test
alias, just not execute the main
I think :test exists in install deps?
indeed, in my install on Arch, in /usr/share/clojure/deps.edn
it has test
as an alias
This file https://github.com/clojure/brew-install/blob/1.10.1/src/main/resources/deps.edn The "global" deps
you can use clojure -A:test
to do that
oh, "and not execute the main" - well for that you need the -C / -R
@alexmiller https://github.com/seancorfield/depstar/issues/35 -- good idea you posted in #beginners !
-Scp
is an existing clj option btw
we would definitely like to encourage more use of -X - considering a bunch of additional features that may continue to make it more attractive for tools
and easier to use
That's useful, but it only affects the runtime classpath. This feature is about overriding the classpath from which the uberjar is created, which makes it more flexible. The classpath can be generated from other tools like leiningen, boot, clojure, etc, whatever source.
@seancorfield One other thing that came up in #beginners: the non-standard way of providing the name of the uberjar. It would be easier to compose if that could be done using a named parameter like --uberjar foo.jar
See https://clojurians.slack.com/archives/C053AK3F9/p1597841581095000
gotcha, might be something good to add to tools.build's uber stuff then :)
Features like...? :)
well, still designing :)
but really trying to simplify invocation in several ways
Updating hf.depstar.uberjar
:
(defn run
"Generic entry point for all invocations.
Can be used with `clojure -X`:
In `:aliases`:
:depstar {:extra-deps {seancorfield/depstar {:mvn/version ...}}}
:uberjar {:fn hf.depstar.uberjar/run
:args {:aot true :jar-type :uber}}
Then run:
clojure -R:depstar -X:uberjar :jar MyProject.jar :main-class project.core
If the destination JAR file and main class are fixed, then could be
added to `:args` in `deps.edn`:
:depstar {:extra-deps {seancorfield/depstar {:mvn/version ...}}}
:uberjar {:fn hf.depstar.uberjar/run
:args {:aot true :jar MyProject.jar
:jar-type :uber :main-class project.core}}
Both `:jar` and `:main-class` can be specified as symbols or strings."
It would be nice if -X
acted like -R .. -X ..
so you didn't have to also specify -R:depstar
here and could have the :extra-deps
in the :uberjar
alias.@borkdude Yeah, I'm making it :jar
for the -X
option and it will also be -J
/ --jar
on the command-line (as well as just accepting the filename anywhere).
So @daniel415’s example will work exactly as he would like.
:thumbsup:
what I'm working on right now is in that area
all over it!
Nice :)
@alexmiller I keep hearing references to tools.build (since your Inside Clojure -post). Is there more detailed description of it somewhere already or can we expect something coming out soonish? 🙂
I suspect the answers are "no" and "maybe" -- depending on your definition of "soon" 🙂
^^
trying to pull together a lot of strands right now, not sure on timing yet
OK, in light of earlier discussions, the develop branch of depstar
has several new features requested this morning: support for clojure -X
, support for overriding the classpath used for building the JAR, and reworked argument parsing so the JAR filename can be specified "anywhere" (before/after/in the middle of the options). Please take it for a spin and report back any issues (either on GitHub or here). seancorfield/depstar {:git/url "<https://github.com/seancorfield/depstar>" :sha "c461ba830e069edf0f011169c18595a4a8f917fc"}
Thanks in advance