Closed technomancy closed 10 years ago
The duplication doesn't seem particularly important, and maybe even a little unsafe (ties leiningen to scm). What about a leiningen plugin that sets tags? (Is that what you want lein release to do?)
All the SCM-specific stuff would be implemented in terms of multimethods, which would be trivial to extend to other SCMs.
If we can't come up with a good way to determine sensible snapshot versioning I am OK just dropping this in favour of lein release
setting tags.
I'm not sure what you mean by leiningen can't tell if this is a major, minor or bugfix version bump. Shouldn't the user specify with something like below?
lein release major
lein release minor
I mean it's difficult to determine it from the SCM history alone. Making it so lein release major
makes changes to project.clj
allows this information to be stored, which is the main argument against drawing the version info exclusively from the SCM.
So I am working on this very thing. Basically we want to use git tags for versions instead of committing a VERSION file to SCM. I have a good conversion of the thor-scmversion gem from Riotgames but would love to see this integrated directly into leiningen.
SCM tags are not immutable. I am roughly -181,123,612 for this.
I'd also recommend using lein-ver, which does commit it into VCS but is very easy to use. I'm also finding it hard to imagine a situation where you would find the presence of a VERSION file (which, when using lein-ver make it accessible from your code!) unwanted.
@AeroNotix I don't understand the objection. We're talking about reading project version information from SCM tags. The current way of storing versioning information is also not immutable, so I don't see how this is worse in that regard.
Sorry I got some wires crossed, I thought we were talking about building specific versions as per the VCS tag. Ignore.
So we found that keeping our versions in a file was problematic when it came time to run our projects through CI. Instead, we are moving to using git tags that follow major.minor.patch and the CI system will auto bump the patch level with each push.
You cna then use commit messages to bump major and minor using [minor]|#minor or [major]|#major
So far this works really well using the thor-scmversion gem but we would rather have leiningen tasks to do this since polluting clojure/java projects wtih ruby sucks =\
I'm up for discussing this if anyone has some bright ideas about how to determine snapshot numbers from the SCM alone, but I'm inclined to think it can't be done well.
Upsides: removes redundancy between scm and project.clj file, ensures users don't forget to tag releases.
Downsides: not sure how versions in between a release would be chosen; leiningen can't tell if this is a major, minor, or bugfix version bump from the last tagged version.
Thoughts?