This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-09
Channels
- # announcements (12)
- # beginners (159)
- # boot (3)
- # calva (41)
- # cider (48)
- # clara (2)
- # clj-kondo (8)
- # cljdoc (8)
- # clojure (70)
- # clojure-dev (10)
- # clojure-europe (2)
- # clojure-losangeles (1)
- # clojure-nl (12)
- # clojure-spec (7)
- # clojure-uk (63)
- # clojurescript (24)
- # cursive (24)
- # datomic (22)
- # expound (17)
- # figwheel (1)
- # fulcro (176)
- # graphql (23)
- # jobs (9)
- # jobs-discuss (56)
- # kaocha (1)
- # mount (3)
- # nyc (1)
- # off-topic (91)
- # onyx (3)
- # overtone (4)
- # pathom (3)
- # pedestal (1)
- # re-frame (11)
- # reitit (19)
- # ring (8)
- # shadow-cljs (16)
- # test-check (5)
- # testing (2)
- # tools-deps (20)
- # vim (9)
hey, how do you manage compilation of Clojure :gen-class
files with tools.deps at development time? Do you call clojure.core/compile
manually?
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}}
:paths ["classes" "src"]
:aliases
{:compile {:main-opts ["-e" "(compile,'cfml.struct)"]}
:build {:extra-deps {seancorfield/depstar {:mvn/version "RELEASE"}}
:main-opts ["-e" "(compile,'cfml.struct)"
"-m" "hf.depstar.jar" "cfml-interop.jar"]}}}
is an example from one of my projects. I run it with clj -A:compile
to get a REPL or clj -A:build
to create a JAR for deployment. It duplicates the compile
call in both. I could just have it in :compile
but then I'd have to remember clj -A:compile:build
whenever I wanted to build a JAR.Thanks! We have a bit more complicated project with shadow-cljs + deps.edn with docker images. Since we already had a Makefile to run docker-based integration tests locally, we just added a new target to it, essentially doing what you are doing above with a manual clojure
invocation.
in leiningen there's a possibility of defining native paths with :native-path
, that causes all files on this path to be spit'ed out into the current working directory, which suites well for jna/jni apps using .so files, I'm not seeing this behaviour in tools.deps, is it missing, not implemented or am I missing an argument?
This is implemented in badigeon: https://github.com/EwenG/badigeon/blob/master/sample/badigeon/sample.clj#L121
Not implemented
prima 馃檪 no stress, then I'll continue to advise to Overtone users to stick with leiningen until then
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}}
:paths ["classes" "src"]
:aliases
{:compile {:main-opts ["-e" "(compile,'cfml.struct)"]}
:build {:extra-deps {seancorfield/depstar {:mvn/version "RELEASE"}}
:main-opts ["-e" "(compile,'cfml.struct)"
"-m" "hf.depstar.jar" "cfml-interop.jar"]}}}
is an example from one of my projects. I run it with clj -A:compile
to get a REPL or clj -A:build
to create a JAR for deployment. It duplicates the compile
call in both. I could just have it in :compile
but then I'd have to remember clj -A:compile:build
whenever I wanted to build a JAR.is this kind of thing possible with tools.deps? https://stackoverflow.com/a/24949419/6264
I imagine it鈥檚 just a -e
expression?
(! 1084)-> clj -e '(set! *assert* false)' -r
false
user=> (assert false)
nil
user=> (assert true)
nil
user=> ^D
Thu May 09 11:40:55
(sean)-(jobs:0)-(~/clojure)
(! 1085)-> clj -e '(set! *assert* true)' -r
true
user=> (assert false)
Execution error (AssertionError) at user/eval138 (REPL:1).
Assert failed: false
user=> (assert true)
nil
user=>
Why "imagine" when you can just "repl"? 馃檪
There's a JVM property for spec asserts.
(but not regular Clojure asserts I believe)