Changes between Version 67 and Version 68 of DevelopersGuide/DevelopingPlugins


Ignore:
Timestamp:
2014-10-23T18:02:05+02:00 (10 years ago)
Author:
skyper
Comment:

interwiki links

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DevelopingPlugins

    v67 v68  
     1[[PageOutline(1-10,Table of Contents)]]
     2
    13= Developing Plugins =
    24
     
    46Any Questions left? Ask at the developers mailinglist.
    57
    6 [[TOC(inline)]]
    7 
    88== Setting up the environment ==
    99
     
    1212svn co http://svn.openstreetmap.org/applications/editors/josm
    1313}}}
    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].
    1515 * 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.
    1717
    1818== Building JOSM core ==
     
    179179||'''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.||
    180180||'''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.||
    182182||'''Plugin-Requires'''||optional||A list of other plugins which are required before plugin works. The list is separated by semi colons.||
    183183||'''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.||
     
    186186||'''<lang>_Plugin-Description'''||optional||The translated description text for the plugin. E.g. ''de_Plugin-Description'' contains the German translation.||
    187187
    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.
     188For 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.
    189189
    190190== Translating a plugin ==
     
    204204
    205205== 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.
     206The 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.
    207207
    208208Advantages of hosting code externally:
     
    221221
    222222=== 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.
     223There 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
     225You 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.
    226226
    227227Managing a plugin in OSM SVN instead of own systems (which is also possible) has some advantages:
     
    251251Ready. The new plugin version is now available. If necessary, JOSM asks users to upgrade to the new version, when JOSM is started up.
    252252
    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}}}.
     253The 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}}}.
    254254
    255255== Legal stuff (Imis opinion) ==