leiningen

Akiz 2022-09-13T07:12:52.865719Z

Hi, I have a project.clj with :repl profile. I have also local :repl profile in ~/.lein/profile By default - :repl from project.clj get used. Is there any option to get these two profiles merged when starting the REPL so I can use both local and project profile?

Akiz 2022-09-15T07:20:31.558959Z

that seems to be unusable in my case. this is my ~/.lein/profiles.clj

{:repl {:dependencies [[vlaaad/reveal "1.3.276"]]
        :repl-options {:nrepl-middleware [vlaaad.reveal.nrepl/middleware]}
        :jvm-opts ["-Dvlaaad.reveal.prefs={:theme,:light}"]}}
this is my project profiles.clj
:repl {:prep-tasks   ["npm-deps" "deps"]
                    :repl-options {:init-ns user}
                    :dependencies [[hashp "0.2.1"]]
                    :injections   [(require 'hashp.core)]}

eskos 2022-09-15T08:47:22.875949Z

Don’t use the same name for the profiles 🙂

eskos 2022-09-15T08:48:43.438699Z

Alternatively if you’re just trying to avoid typing, > The :default profile specifies the profiles that are active by default when running lein tasks. If not overridden, this is set to :leiningen/default, which is a composite profile with [:base :system :user :provided :dev].

eskos 2022-09-13T08:23:13.000679Z

https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#composite-profiles maybe, although assumption is that the keys would be different. Generally if your project relies on stuff from your user profile, you should redefine the dependent parts in the project itself, as otherwise you’ll end up with a project definition that doesn’t work without your local state. It’s way less brittle to use the lein with-profile +mylocalprofile <task> form. https://bleu-barbeau.com/posts/2016-07-15-leiningen-profiles/ walks through using profiles pretty well.

Akiz 2022-09-13T08:46:19.960829Z

@suomi.esko Thank you, this might work. All important stuff is inside project.clj, but i also have local Reveal configuration that i want to use with that one particular project.