Is there a way to retrieve data from somewhere in project.clj and put in :aliases? For example, I'd like to configure :figwheel-main in some profiles and then be able to pass those configs to the figwheel launch command in :aliases.
I don't get what you want exactly, can you rephrase it? (perhaps without mentioning figwheel)
Sure:
{:profiles {:A {:compiler :config-map}}
:aliases ["with-profiles" "A" "run" "m" "something.main" "-co"
#=(pr-str ***COMPILER***)]}
I'd like to fill ***COMPILER*** with the data from :compiler as defined in the profile.(def data {:compiler :config-map})
(defproject foo :profiles {:A ~data})
before defproject you can def/defns, without any special syntax required
inside defproject you can use ~ to eval arbitrary expressions, within which you can refer to any prior def/defns
Right, but then I can't extract the merged profiles, can I?
if you don't want pure data but the result of a Lein computation, that sounds like something that plugins/middleware can do
I was afraid of that 🙃
here is an example of a piece of 'inline middleware', no messing with .jars required https://github.com/nedap/formatting-stack/blob/31a17527260899b5a052e7e8fc8c4aaf37609d32/project.clj#L84-L101
the fn receives a project map as an argument from Lein, probably with all profiles merged?
Oh an inline middleware, that's very interesting
I'll explore this path, thank you very much!