Changes between Version 67 and Version 68 of DevelopersGuide/DevelopingPlugins
- Timestamp:
- 2014-10-23T18:02:05+02:00 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevelopersGuide/DevelopingPlugins
v67 v68 1 [[PageOutline(1-10,Table of Contents)]] 2 1 3 = Developing Plugins = 2 4 … … 4 6 Any Questions left? Ask at the developers mailinglist. 5 7 6 [[TOC(inline)]]7 8 8 == Setting up the environment == 9 9 … … 12 12 svn co http://svn.openstreetmap.org/applications/editors/josm 13 13 }}} 14 * create a new plugin-directory {{{josm/plugins/yourpluginname}}}. You may create a copy of the template directory [ http://svn.openstreetmap.org/applications/editors/josm/plugins/00_plugin_dir_template/ 00_plugin_dir_template]. It includes a directory layout, a [http://svn.openstreetmap.org/applications/editors/josm/plugins/00_plugin_dir_template/LICENSE license file] and a template for the [http://svn.openstreetmap.org/applications/editors/josm/plugins/00_plugin_dir_template/build.xml build.xml].14 * create a new plugin-directory {{{josm/plugins/yourpluginname}}}. You may create a copy of the template directory [osm:source:/applications/editors/josm/plugins/00_plugin_dir_template/ 00_plugin_dir_template]. It includes a directory layout, a [osm:source:/applications/editors/josm/plugins/00_plugin_dir_template/LICENSE license file] and a template for the [osm:source:/applications/editors/josm/plugins/00_plugin_dir_template/build.xml build.xml]. 15 15 * Open the ant script ({{{build.xml}}}) in your plugin directory and configure the properties in the configuration section. The important thing of your build script is, that it places some attributes into the {{{MANIFEST.MF}}} of the jar file. See below. {{{build.xml}}} in the template directory takes care of this. 16 * [ http://svn.openstreetmap.org/applications/editors/josm/plugins/00_plugin_dir_template/README.template This readme] explains how your plugin is built and made available to other JOSM users.16 * [osm:source:/applications/editors/josm/plugins/00_plugin_dir_template/README.template This readme] explains how your plugin is built and made available to other JOSM users. 17 17 18 18 == Building JOSM core == … … 179 179 ||'''Plugin-Early'''||optional||Can be set to {{{true}}}, in which case the plugin is loaded as early as possible, more specific before the GUI classes are loaded. This is usefull if your plugin alters the GUI or the JOSM-startup process in any way.|| 180 180 ||'''Plugin-Link'''||optional||Informational URL to a webpage or other information source about that plugin. Is also used in the [wiki:Plugins plugins] information page.|| 181 ||'''Plugin-Icon'''||optional||The icon to display in the plugin list. The image must be a .png or .svg file and be included in the plugin jar file. Give the full relative path, e.g. {{{images/preferences/plugin.png}}}[[BR]]The images are collected by a server script in regular intervals. The JOSM clients download the entire [ http://josm.openstreetmap.de/plugin-icons.zip archive] along with the plugin list.||181 ||'''Plugin-Icon'''||optional||The icon to display in the plugin list. The image must be a .png or .svg file and be included in the plugin jar file. Give the full relative path, e.g. {{{images/preferences/plugin.png}}}[[BR]]The images are collected by a server script in regular intervals. The JOSM clients download the entire [/plugin-icons.zip archive] along with the plugin list.|| 182 182 ||'''Plugin-Requires'''||optional||A list of other plugins which are required before plugin works. The list is separated by semi colons.|| 183 183 ||'''Plugin-Stage'''||optional||An number of the order relative to other plugins, when the plugin is loaded. Smaller numbers gets loaded first, so if you have conflicts with other plugins, you can increase or decrease this number to get some control on the loading order. Defaults to 50.|| … … 186 186 ||'''<lang>_Plugin-Description'''||optional||The translated description text for the plugin. E.g. ''de_Plugin-Description'' contains the German translation.|| 187 187 188 For SVN managed plugins, the links to old versions and the translated descriptions are automatically added to the [ http://josm.openstreetmap.de/plugin plugin information], so JOSM can use that when it displays the list of plugins in the preference dialog.188 For SVN managed plugins, the links to old versions and the translated descriptions are automatically added to the [/plugin plugin information], so JOSM can use that when it displays the list of plugins in the preference dialog. 189 189 190 190 == Translating a plugin == … … 204 204 205 205 == Publishing a plugin == 206 The plugin list a user sees ([ http://josm.openstreetmap.de/plugin here]) is automatically generated at regular intervals (currently about 10 minutes) from plugin JAR files that are located in [http://svn.openstreetmap.org/applications/editors/josm/dist/ josm/dist] on the OSM.org SVN repository (referred to as "internal" plugins) and from links that are embedded in the [[wiki:Plugins]] page (referred to as "external" plugins). Each method has advantages and disadvantages.206 The plugin list a user sees ([/plugin here]) is automatically generated at regular intervals (currently about 10 minutes) from plugin JAR files that are located in [osm:source:/applications/editors/josm/dist/ josm/dist] on the OSM.org SVN repository (referred to as "internal" plugins) and from links that are embedded in the [[wiki:Plugins]] page (referred to as "external" plugins). Each method has advantages and disadvantages. 207 207 208 208 Advantages of hosting code externally: … … 221 221 222 222 === Managing a plugin in OSM.org SVN === 223 There is an SVN repository for JOSM "internal" plugins in the main OSM.org SVN repository, see [ http://svn.openstreetmap.org/applications/editors/josm/plugins/ here]. Note that this repository is different from the [http://josm.openstreetmap.de/svn/main JOSM SVN repository] which only manages the JOSM core.224 225 You can easily get write access to the JOSM plugins repository by [ http://wiki.openstreetmap.org/wiki/Accounts#SVN_access_.28OSM_software.29 following these steps]. If your plugin should be available for other users too and if you want to integrate it into the JOSM plugin update procedure you should submit it to the JOSM plugins repository. The following [http://svn.openstreetmap.org/applications/editors/josm/plugins/00_README readme file] might be helpful too.223 There is an SVN repository for JOSM "internal" plugins in the main OSM.org SVN repository, see [osm:source:/applications/editors/josm/plugins/ here]. Note that this repository is different from the [source: main JOSM SVN repository] which only manages the JOSM core. 224 225 You can easily get write access to the JOSM plugins repository by [osmwiki:Accounts#SVN_access_.28OSM_software.29 following these steps]. If your plugin should be available for other users too and if you want to integrate it into the JOSM plugin update procedure you should submit it to the JOSM plugins repository. The following [osm:source:/applications/editors/josm/plugins/00_README readme file] might be helpful too. 226 226 227 227 Managing a plugin in OSM SVN instead of own systems (which is also possible) has some advantages: … … 251 251 Ready. The new plugin version is now available. If necessary, JOSM asks users to upgrade to the new version, when JOSM is started up. 252 252 253 The steps describe above can be automated, see [ http://svn.openstreetmap.org/applications/editors/josm/plugins/tageditor/build.xml build.xml of the tageditor plugin]. It includes an ant target {{{publish}}}.253 The steps describe above can be automated, see [osm:source:/applications/editors/josm/plugins/tageditor/build.xml build.xml of the tageditor plugin]. It includes an ant target {{{publish}}}. 254 254 255 255 == Legal stuff (Imis opinion) ==