Fork me on GitHub
#leiningen
<
2018-03-22
>
lwhorton15:03:38

hey guys, is there some way to define in a :cljsbuild {:builds [...]} config a universal config that applies to each cfg in the vec? for example, I want to use the same :compiler {:npm-deps [...]} for both prod/dev builds, and I don’t want to duplicate code in the project.clj file

bja16:03:34

you can specify with-profile to leiningen to activate multiple profiles

bja16:03:49

lein with-profile foo,bar cljsbuild IIRC

bja16:03:40

it looks like you might be able to use "Composite Profiles" to get this without typing in lein with-profie ... each time, but I've never used this feature: https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#composite-profiles

bja16:03:40

so you could have a shared profile with universal cljsbuild options and then get it merged in, although you'll want to check lein pprint (described at the bottom of the profiles docs) to make sure the merging works out how you want it

lwhorton16:03:19

hmm this is going to take some time. thanks for the help!

aleksander16:03:31

Hi everyone, I have a leiningen project with some generated Java classes in directory specified in :java-source-paths. For some reason when I run lein javac I get Caused by: java.lang.ClassNotFoundException: exception. lein uberjar completes successfully and compiles both classes.

aleksander16:03:48

Anyone knows why there is such difference?

gklijs16:03:46

Probably the order, I think you need lein compile first, I have a lein project with java files being ceated, and it needs

:prep-tasks ["compile" "javac"]
in the project.clj to work

aleksander16:03:08

I've tried and it didn't help. The java files get imported in clojure - is it the same in your case as well?

gklijs20:03:11

No, in my case I have a clojure src in the provided src profile generating java classes from reading an edn file.

aleksander17:03:17

the confusing part is that lein do uberjar, midje works, lein do compile, javac or lein do javac, compile fail

aleksander17:03:27

I've had an :uberjar profile with :aot :all there but now moved :aot :all to top level and it didn't make a difference

mikerod17:03:13

@lwhorton composite profiles are good to explore

mikerod17:03:27

I’ve had some good success with them in terms of sharing common chunks of profile config

mikerod17:03:55

@aleksander perhaps the active profiles for lein javac are different and leaving out some dependencies you are expecting to have present on the class path

mikerod17:03:02

maybe explore with lein pprint

mikerod17:03:01

You can also try lein javac -verbose