source: osm/applications/editors/josm/plugins/mapillary/gradle/josm-tasks.gradle@ 32717

Last change on this file since 32717 was 32693, checked in by floscher, 9 years ago

[mapillary] Clean up build.gradle

The build file for Gradle is now split in several parts for a better overview and better maintainability.
The files gradle/*.gradle are parts that are unlikely to change often, because these are not specific to this plugin and can be configured through gradle.properties.
Also the Gradle version is bumped to 2.14.1, because a critical defect has been fixed since 2.14 (see https://docs.gradle.org/2.14.1/release-notes).

File size: 1.5 KB
Line 
1// Custom tasks for running JOSM with the plugin loaded
2
3/**
4 * Reset the JOSM home directory
5 */
6task cleanJosm(type: Delete) {
7 delete "$buildDir/.josm"
8}
9
10/**
11 * Initialize the JOSM preferences
12 */
13task initJosmPrefs(type: Copy) {
14 if (!new File("$buildDir/.josm/preferences.xml").exists()) {
15 from "config/josm/preferences.xml"
16 into "$buildDir/.josm"
17 }
18}
19
20/**
21 * Puts the freshly compiled plugin jar into the JOSM home dir that is used from Gradle
22 */
23task updateJosmPlugin(type: Copy) {
24 dependsOn jar
25 dependsOn initJosmPrefs
26 from configurations.requiredPlugin
27 from "$buildDir/libs/${project.name}.jar"
28 into "$buildDir/.josm/plugins"
29 rename('(.*)-\\.jar', '$1.jar')
30 rename(project.name, project.hasProperty('plugin.jar.name') ? project.property('plugin.jar.name') : project.name)
31}
32
33/**
34 * This runs the JOSM-version specified in the dependency configuration above.
35 * The home-directory of this JOSM is located in $buildDir/.josm, so it doesn't interfere with any other JOSM-installations.
36 */
37task runJosm(type: JavaExec) {
38 dependsOn updateJosmPlugin
39 classpath = sourceSets.main.runtimeClasspath
40 main = 'JOSM'
41 jvmArgs "-Djosm.home=$buildDir/.josm"
42}
43
44/**
45 * Starts an instance of JOSM that is debuggable
46 */
47task debugJosm(type: JavaExec) {
48 dependsOn updateJosmPlugin
49 classpath = sourceSets.main.runtimeClasspath
50 main = 'JOSM'
51 jvmArgs "-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7051", "-Djosm.home=$buildDir/.josm"
52}
Note: See TracBrowser for help on using the repository browser.