From bd8a05a930724a70f810bb6811a9f3cafe840547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Mon, 10 Apr 2017 17:16:53 +0200 Subject: [PATCH] Fix runJosm task, copy the plugin *.jar regardless of name See https://github.com/floscher/josm-gradle-tasks/commit/194ce881dc7bb2763f41ddb2a18ac88e67eb5b6d . --- gradle.properties | 4 ++-- gradle/run-josm-plugin-tasks.gradle | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5a8c48254..a8e18a390 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,8 +9,8 @@ plugin.requires=apache-commons;apache-http #plugin.early=... #plugin.stage=... -# The name for the JAR file produced by Gradle (optional, defaults to ${project.name}) -plugin.jar.name=Mapillary +# The name for the JAR file produced by Gradle (optional, if not provided the *.jar file in the build/libs/ directory is used without renaming) +plugin.jar.name=Mapillary.jar tool.pmd.version=5.5.5 tool.findbugs.version=3.0.1 diff --git a/gradle/run-josm-plugin-tasks.gradle b/gradle/run-josm-plugin-tasks.gradle index 5601556c7..c51b6f130 100644 --- a/gradle/run-josm-plugin-tasks.gradle +++ b/gradle/run-josm-plugin-tasks.gradle @@ -1,14 +1,19 @@ apply from: buildscript.sourceFile.parentFile.path + '/run-josm-config.gradle' apply from: buildscript.sourceFile.parentFile.path + '/run-josm-tasks.gradle' +task updatePluginDependencies(type: Copy) { + from configurations.requiredPlugin + into "$tmpJosmHome/plugins" + rename('(.*)-\\.jar', '$1.jar') +} + task updateCurrentPlugin(type: Copy) { description 'Puts the plugin-JAR generated by the `jar`-task into `build/.josm/`' dependsOn jar dependsOn initJosmPrefs - from configurations.requiredPlugin - from "$buildDir/libs/${project.name}.jar" + dependsOn updatePluginDependencies + from jar.outputs into "$tmpJosmHome/plugins" - rename('(.*)-\\.jar', '$1.jar') - rename(project.name, project.hasProperty('plugin.jar.name') ? project.property('plugin.jar.name') : project.name) + rename('.*', project.hasProperty('plugin.jar.name') ? project.property('plugin.jar.name') : '$1') } updateJosmPlugins.dependsOn updateCurrentPlugin