leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
2020-02-21T16:38:09.113400Z

I've got some specs in my code that use with-gen but now I can't lein uberjar the project because test.check is only specified for the dev profile in lein, not the uberjar one. What's the best way round this?

2020-02-21T16:39:13.113800Z

@peterhull90 spec is setup to not require this at runtime

2020-02-21T16:39:28.114300Z

unless you are using instrument or something at runtime in your uberjar execution

2020-02-21T16:39:41.114500Z

https://clojure.org/guides/spec#_project_setup describes it

2020-02-21T16:40:01.114700Z

you use (require '[clojure.spec.gen.alpha :as gen])

2020-02-21T16:40:41.115Z

and s/with-gen you give the generator as a no arg fn

2020-02-21T16:40:52.115300Z

so it’s all shielded behind the clojure.spec.gen.alpha layer

2020-02-21T16:41:19.115700Z

which will only lazy load/require org.clojure/test.check ns’s

2020-02-21T16:52:05.116600Z

@mikerod oho I am using instrument but I forgot about that. It was only for testing so I don't need it. Thanks a lot!

2020-02-21T16:53:14.117200Z

@peterhull90 nice. yeah that makes sense. just have to be careful where you use that sort of thing - keep it in dev-only ns’s/tests/etc