Changes between Version 107 and Version 108 of DevelopersGuide/DevelopingPlugins


Ignore:
Timestamp:
2021-09-02T14:00:01+02:00 (4 years ago)
Author:
skyper
Comment:

update wording and links of license file

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DevelopingPlugins

    v107 v108  
    99You can choose either method to build, depending on what you prefer, even setting up both build systems on one project is possible. However if you want to put your plugin into the SVN repo for JOSM plugins, it's generally preferred to use the Ant build described below.
    1010
     11
    1112== Setting up the environment ==
    1213 * Check out the plugin environment into an empty directory called {{{josm}}}. Make sure path contains only ASCII characters, otherwise build may fail.
     
    1516}}}
    1617 * If the old URL https://svn.openstreetmap.org/applications/editors/josm is used, then go to the working copy and call {{{svn relocate}}} with the new URL.
    17  * Create a new plugin directory {{{josm/plugins/yourpluginname}}}. You may create a copy of the template directory [source:osm/applications/editors/josm/plugins/00_plugin_dir_template/ 00_plugin_dir_template]. It includes a directory layout, a [source:osm/applications/editors/josm/plugins/00_plugin_dir_template/LICENSE license file] and a template for the [source:osm/applications/editors/josm/plugins/00_plugin_dir_template/build.xml build.xml].
    18  * 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.
     18 * Create a new plugin directory {{{josm/plugins/yourpluginname}}}. You may create a copy of the template directory [source:osm/applications/editors/josm/plugins/00_plugin_dir_template/ 00_plugin_dir_template]. It includes a directory layout, two GPL licenses ([source:osm/applications/editors/josm/plugins/00_plugin_dir_template/GPL-v2.0.txt GPL2] and [source:osm/applications/editors/josm/plugins/00_plugin_dir_template/GPL-v3.0.txt GPL3]) but no license file like [source:/trunk/LICENSE JOSM core] (see [#LegalStuff Legal Stuff] below) and a template for the [source:osm/applications/editors/josm/plugins/00_plugin_dir_template/build.xml build.xml].
     19 * 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.
    1920 * [source:osm/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.
    2021
     22
    2123== Building JOSM core ==
    22 
    2324A binary version of JOSM core is required for building a plugin. This is how you compile it yourself:
    2425{{{
     
    2728}}}
    2829It will create the file `josm/core/dist/josm-custom.jar`. Alternatively you download a release (latest or tested) and move the .jar file to this location.
     30
    2931
    3032== Building ==
     
    3537ant dist
    3638}}}
     39
    3740
    3841== Testing ==
     
    5255</table>
    5356}}}
     57
    5458
    5559== Debugging (using Eclipse) ==
     
    63671. Create a `Run Configuration` (Properties -> Run/Debug Settings -> New -> Java Application). Main class must be set to `org.openstreetmap.josm.gui.MainApplication`.
    64681. You can now tweak your plugin and/or set breakpoints… etc.
     69
    6570
    6671== Automated testing ==
     
    8085It will then be run automatically in the Jenkins build, see:
    8186[/jenkins/job/JOSM-Plugins/lastCompletedBuild/testReport/ Test Report]
     87
    8288
    8389== JOSM plugins ==
     
    194200
    195201=== The manifest file for a JOSM plugin ===
    196 
    197202You have to put some information into the manifest file of your jar. If you use ant, you can set these values within the {{{build.xml}}} file.
    198203
     
    233238 * The perl script [source:osm/applications/editors/josm/i18n/i18n.pl i18n.pl] must be called with a destination directory and the '''.po''' files to create translation data.
    234239
     240
    235241== Publishing a plugin ==
    236242The plugin list a user sees ([/plugin here]) is automatically generated at regular intervals (currently about 10 minutes) from plugin JAR files (**built with Java 8**) that are located in [source:osm/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 Plugins] page (referred to as "external" plugins). Each method has advantages and disadvantages.
     
    285291
    286292
    287 == Legal stuff (Imis opinion) ==
     293== Legal stuff (Imis opinion) ==#LegalStuff
    288294Just because I have been asked: JOSM is licensed under GPL and if any code is a "derived work" of JOSM, then it has to be under GPL too. It is my belief that any JOSM-Plugin is a derived work of JOSM, so GPL is the only possible license for a JOSM-Plugin. If you want to include non-GPL code into a plugin, it has to be separated from the classes that use JOSM. "Use" as in "import org.openstreetmap.josm...". See the 'Class-Path' - MANIFEST.MF attribute for a way to include other jar files.
    289295