Reported by laurent....@gmail.com, Apr 26, 2009
Patch with the necessary changes to handle version numbering for clojure:
* a src/clj/clojure/version.properties file
* this version.properties file is the reference for version numbers. It is
on the classpath so it can be seen by clojure at runtime. It is in a
subdirectory of clojure-the-project so any tool can refer to it relatively
to the installation of clojure.
* I've added the necessary code to clojure to load clojure version number
at startup time
I've also added function (clojure.core/clojure-version) that will return a
string representing the version from the structured *clojure-version* map.
The algorithm here is simple:
<MAJOR>.<MINOR>[.<INCREMENT>][-<QUALIFIER>][-SNAPSHOT]
* I've changed the ant build.xml so that it creates fully qualified names
with version attributes for the generated jars.
* Note on the :interim attribute: to protect the person who makes releases
from itself, instead of considering :interim to be true if there is the
"true" string in the properties file, I've made the opposite choice:
interim is true for any value other than "false". So if there is a typo in
version.properties (e.g. tru instead of true), then the release will be
marked as interim, and that will not be a big deal. In the other case, it
would be a big deal if an official release was made accidentally instead of
an interim.
* finally, pom.xml file is now generated from ant as part of the classic
init step.
Note: I strongly suggest that the clojure.version.interim property remains
true in svn, so that it's not possible to inadvertently release a version
"too early".
Comment 1 by richhickey, Apr 27, 2009
I can't apply the patch due to missing pom-template.xml?
Also, could you just put the contents of core_version.clj into core.clj? I'd rather
not have another file just for this.
Thanks!
Comment 2 by laurent....@gmail.com, Apr 27, 2009
OK, core_version.clj content back into core.clj.
There was a problem with pom-template.xml probably because I tried on my local
working copy to make a svn rename pom.xml pom-template.xml, and somehow the svn diff
command did not like that.
What I've done in the current patch is first svn remove pom.xml then svn add
pom-template.xml.
Comment 3 by richhickey, Apr 27, 2009
patch applied- svn 1357 - thanks!
Status: Accepted
Comment 4 by scgilardi, May 12, 2009
(clojure-version) for 1.0 has a trailing "-". The intention (as noted above in the
issue) is that when the qualifier is absent, there should be no "-". The current
setup is reading a blank qualifier as an empty string, but checking later for nil
rather than nil or the empty string.
Clojure 1.0.0-
user=> *clojure-version*
{:major 1, :minor 0, :incremental 0, :qualifier ""}
user=> (clojure-version)
"1.0.0-"
user=>
Comment 5 by laurent....@gmail.com, May 12, 2009
OK, a mistake on my part.
Rich, I also see you have made implicitly the "incremental" attribute mandatory in
trunk (since you apply Integer/valueOf on it without checking for nullity or string
emptyness).
If it is intentional, I can also add in the corrective patch a modified build.xml
that verifies this (incremental being mandatory) when building with ant, or I can
change the patch to keep the "incremental" attribute optional.
Waiting for your answer before creating the patch.
Converted from http://www.assembla.com/spaces/clojure/tickets/114
Attachments:
clojure-version.patch - https://www.assembla.com/spaces/clojure/documents/aKO9q2w4mr3Od2eJe5aVNr/download/aKO9q2w4mr3Od2eJe5aVNr
clojure-version2.patch - https://www.assembla.com/spaces/clojure/documents/aKO_-6w4mr3Od2eJe5aVNr/download/aKO_-6w4mr3Od2eJe5aVNr