This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-21
Channels
- # admin-announcements (4)
- # beginners (41)
- # boot (46)
- # cider (8)
- # clojure (132)
- # clojure-austin (15)
- # clojure-belgium (3)
- # clojure-greece (3)
- # clojure-hk (1)
- # clojure-mexico (4)
- # clojure-quebec (5)
- # clojure-russia (46)
- # clojure-spec (225)
- # clojure-taiwan (1)
- # clojure-uk (17)
- # clojurescript (46)
- # clojurewerkz (1)
- # core-async (28)
- # cursive (9)
- # datascript (3)
- # datomic (5)
- # defnpodcast (42)
- # devcards (60)
- # emacs (27)
- # hoplon (7)
- # lein-figwheel (5)
- # leiningen (12)
- # mount (8)
- # om (13)
- # play-clj (2)
- # reagent (47)
- # rethinkdb (5)
- # ring-swagger (7)
- # spacemacs (9)
- # specter (12)
- # testing (1)
- # untangled (1)
- # vim (11)
- # yada (31)
@roberto: late response, but I've had good luck using https://github.com/trptcolin/versioneer to introspect the project version
Yeah, trying to figure out all that profile-injection stuff and plugins really makes my head hurt. Versioneer makes it easy and it works from both lein run
and a compiled uberjar
I also had some luck using humble old lein pprint
before I stumbled on versioneer (in the context of deployment scripts) - you can lein pprint :version
to get your version number (as a quoted string)
Actually I have a somewhat-related question I was hoping to get help with. When I override :release-tasks
for my project, I can substitute in some variables from the project map, so like using the lein-shell plugin, I can have a release task like this:
:release-tasks [["shell" "echo" "Hello, world from ${:name} version ${:version}"]]
Can anyone tell me what the mechanism is that does that string substitution, and especially if there is a way to hook into it with a command I'm specifying via :aliases
? What I'd like is to have the -main
function I'm calling from my alias be passed the project name and version as arguments
Is this the kind of thing I need to write a plugin for?
@timgilbert: this comes from a lein-shell
feature, rather than coming from Leiningen unfortunately
I’d love to have something in Leiningen where I can reference parts of project.clj in other parts
Would be tricky to break the cycle though
I did see something about putting functions in project.clj that take a project map and return a value, but I couldn’t make them work, or find any docs on them