[josm-dev] Update Plugins fails
Frederik Ramm
frederik at remote.org
Mon Aug 18 19:51:43 BST 2008
Hi,
Raphael Studer wrote:
> After restarting josm and try to update them again, the same plugins
> needed an update witch take again less then a second.
Here's a long-ish explanation of the way JOSM deals with plugins.
Please, please, everybody print this out and pin it to the wall or maybe
even put it on a wiki page where you'll find it again.
When you update the list of plugins in JOSM, JOSM will download and
parse the page
https://josm.openstreetmap.de/wiki/Plugins
which contains a version number for each plugin. JOSM will then check
whether the version number of the installed .jar files (as given in
META-INF/MANIFEST.MF in each .jar) is greater or equal than the number
on the wiki page. If greater or equal, no action is required; otherwise,
the plugin is flagged for updating.
On update, the plugin is downloaded from the location given in the same
wiki table - usually from our SVN. This is slightly unusual: We keep our
plugin source AND the compiled binaries in SVN, as a convenient storage
where everyone has access to.
If the plugin residing in the location specified in the wiki table has a
SMALLER version number than given in the wiki table, the endless loop
mentioned above will occur.
Some plugins use a hand-made version number, i.e. the version number is
fixed in the build.xml and increased manually by whoever makes a
modificiation. Of course the same person then has to build the .jar,
commit this to SVN as well (it is located outside the plugin source
tree, so that's a little caveat), AND update the wiki table. Some
authors are unaware of this and they believe that updating the plugin
and then fixing the wiki table is sufficient. It is not - you have to
commit the compiled .jar as well.
Other plugins are again one step more complex. They use the SVN revision
number as their version and thus make manual intervention unnecessary.
There is a catch, however, at least with subversion under Linux. If you
make a change to the plugin, then commit ("commited revision #1234"),
then build - your plugin will still be built with the OLD revision
number! You change the wiki table to mention version #1234, and wo-hoo,
round the user goes in download circles because your plugin still says
it is #1111 (or whatever) although having been built from revision 1234
sources! Why is that? It seems that the revision indicator used by the
build process is not updated when checking in, only when checking out.
So after changing your plugin, do "svn commit" (note down version number
reported!), followed by "svn update", and only THEN do "ant" do build
the .jar; then do "cd ../../dist" and "svn commit myplugin.jar", and
then change the wiki page to the version number reported when you
commited your source changes.
That should work.
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the josm-dev
mailing list