[OpenLayers-Dev] including the version number *in* the header
comments of OpenLayers.js file
Christopher Schmidt
crschmidt at metacarta.com
Mon May 5 07:27:14 EDT 2008
On Sun, May 04, 2008 at 02:28:12PM -0400, Schuyler Erle wrote:
> On Sun, 2008-05-04 at 03:26 -0400, Christopher Schmidt wrote:
> > >
> > > When someone copies the file named "OpenLayers.js" and a dir called "img/"
> > > into some project, it currently has no version number visible.
> >
> > OpenLayers.VERSION_NUMBER is in the file, and accessible in Javascript
> > for that reason: this means that when I'm debugging a page, I don't even
> > have to bother reading the file to get the version, I just open Firebug
> > and type "OpenLayers.VERSION_NUMBER" in. In general, I know that I find
> > that way simpler than opening another webpage and looking through it for
> > a version.
>
> SVN keyword substitution might be another answer.
>
> http://svnbook.red-bean.com/en/1.0/ch07s02.html#svn-ch-7-sect-2.3.4
This is what we use for OpenLayers.VERSION_NUMBER. However, keyword
substitution only has keywords for "When this file last changed." Since
the comments at the top of the file are loaded from the LICENSE.txt in
the build/ directory (which changes very seldom), it would still require
manual effort to do a change to the file to get the keywords
(speciically, Id) to change.
OpenLayers.js, on the other hand, changes whenever we add a new class,
which is often enough that we actually do get a reasonable
VERSION_NUMBER out of it.
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Dev
mailing list