All Projects → Gubaer → josm-scripting-plugin

Gubaer / josm-scripting-plugin

Licence: GPL-3.0 License
Scripting Plugin for JOSM

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language
groovy
2714 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Labels

Projects that are alternatives of or similar to josm-scripting-plugin

beautified-JOSM-preset
Improved version of the JOSM presets
Stars: ✭ 38 (+80.95%)
Mutual labels:  josm
literan-moscow
No description or website provided.
Stars: ✭ 18 (-14.29%)
Mutual labels:  josm

JOSM Scripting Plugin

The JOSM scripting plugin executes scripts in the Open Street Map editor JOSM.

Scripts can be defined in any scripting language for which a JSR-223 compatible script engine is available, in particular in

For JOSM users

The scripting plugin can be installed and kept up to date using JOSMs plugin manager:

  1. Select Preferences -> Plugins
  2. Search for the plugin "Scripting" and install it

For developers

The scripting plugin includes an embedded scripting engine for JavaScript based on Mozilla Rhino. It provides a custom JavaScript API to write scripts for the JOSM editor,refer to the API documentation.

Furthermore, it can

If you want to contribute to the scripting plugin itself, please fork this repository and submit your pull requests.

How to build

Add a new entry to releases.conf then run:

$ git checkout deploy          # switch to deploy branch
$ git merge master             # make sure the latest changes are merged to 'deploy'
$ git push origin deploy       # push the 'deploy' branch

$ ./gradlew clean build        # build the plugin
$ ./gradlew deploy             # deploys the plugin jar to github,
                               # where it is picked up by the JOSM
                               # plugin installer

How to test

There are two suites of unit tests:

  1. a suite of unit tests implemented in Java and Groovy
  2. a suite of unit tests implemented in JavaScript which provide test cases for the JavaScript API

How to run:

# build the plugin and run the tests
$ ./gradlew check
# ... or run the checks only, without building
$ ./gradlew cleanTest cleanTestScriptApi check

How to update the i18n resources

Localized strings are uploaded to Transifex. This step is executed automatically when the scripting plugin is built on the master branch by travis.

Translated resources can be downloaded periodically from Transifex and then commited to the github repository.

# install the transifex client
# see transifex documentation: https://docs.transifex.com/client/installing-the-client
$ sudo apt install python3-pip
$ sudo pip3 install transifex-client

# createa an API key for transifex, see https://docs.transifex.com/api/introduction
# create a file with the transifex api key
$ touch $HOME/.transifexrc

# edit $HOME/.transifexrc and add the following content
[https://www.transifex.com]
api_hostname = https://api.transifex.com
hostname = https://www.transifex.com
password = <the transifex api key>
username = api

# For new languages, or when updating only certain languages:
# Download the german translations into src/main/po/de.po
# Shorten the de.po file, removes unnecessary parts
# Then commit it to git
$ tx pull -l de
$ ./gradlew shortenPoFiles
$ git stage src/main/po
$ git commit

# For existing languages:
# Downloads translations for all existing languages into src/main/po/
$ ./gradlew transifexDownload
$ git stage src/main/po
$ git commit

# build the plugin
$ ./gradlew build

Build status

Build Status

Credits

The JOSM scripting plugin uses:

  • jsyntaxpane by Ayman Al-Sairafi

  • Rhino scripting engine by Mozilla Foundation

  • supported by JetBrains logo with a free JetBrains Open Source license

License

Published under GPL Version 3 and higher. See included LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].