GC Issue 110: clojure version number patch


  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:


Reported by, Apr 26, 2009

Patch with the necessary changes to handle version numbering for clojure:

 * a src/clj/clojure/ file
 * this 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: 

 * 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 (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.


Comment 2 by, 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

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)

Comment 5 by, 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

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.


Assembla Importer added a comment -
Assembla Importer added a comment - oranenj said: [file:aKO9q2w4mr3Od2eJe5aVNr]
Assembla Importer added a comment -

oranenj said: [file:aKO_-6w4mr3Od2eJe5aVNr]: on comment 2

Assembla Importer added a comment - oranenj said: [file:aKO_-6w4mr3Od2eJe5aVNr]: on comment 2
Assembla Importer added a comment -

richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)

Assembla Importer added a comment - richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)


  • Assignee:
Vote (0)
Watch (0)


  • Created: