kmpoppe / noteSolver

JOSM Plugin: Automatically resolve notes after uploading a changeset.
https://wiki.openstreetmap.org/wiki/User:Kmpoppe/Plugins#noteSolver
GNU General Public License v3.0
12 stars 3 forks source link

Set up Gradle build #13

Closed floscher closed 2 years ago

floscher commented 2 years ago

Here is a basic setup of a Gradle build. To setup the development environment there is only needed to clone the repository and have a JDK installed. Everything else (like Gradle and JOSM) is then downloaded by the Gradle wrapper (gradlew for Unixoid systems, gradlew.bat for Windows).

For example ./gradlew runJosm would then start a clean JOSM instance with your plugin loaded. Or ./gradlew generatePot creates a file that can then be translated. ./gradlew dist writes the plugin *.jar file as it can be published to /notesolver/build/dist/notesolver.jar.

One note: The Gradle plugin calculates the version number automatically from git tags. But it only considers so-called annotated tags. That's why currently the version number is just the git hash. So you'd need to create the tags with e.g. git tag -a v0.3.4 and enter a message for the tag (just like for commit messages).

Edit: Since you use VSCode, I recommend using these extensions: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle and https://marketplace.visualstudio.com/items?itemName=fwcd.kotlin . The first one is for Gradle support in General (start tasks by clicking the elephant in the sidebar on the left), the second one for autocompletion in the build.gradle.kts build script.