From a5f73076c16bff24c4b790029e81a6c267528d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Sun, 17 Jun 2018 00:32:01 +0200 Subject: [PATCH] Don't set the project version if git-describe fails, show custom compile tasks in task overview --- buildSrc/.gitignore | 1 + .../java/org/openstreetmap/josm/gradle/plugin/JosmPlugin.java | 2 +- src/main/kotlin/task/CustomJosmVersionCompile.kt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildSrc/.gitignore b/buildSrc/.gitignore index abc78ba7..2979d333 100644 --- a/buildSrc/.gitignore +++ b/buildSrc/.gitignore @@ -1,2 +1,3 @@ /.gradle/ /build/ +/out/ diff --git a/src/main/java/org/openstreetmap/josm/gradle/plugin/JosmPlugin.java b/src/main/java/org/openstreetmap/josm/gradle/plugin/JosmPlugin.java index f5b45518..30175f48 100644 --- a/src/main/java/org/openstreetmap/josm/gradle/plugin/JosmPlugin.java +++ b/src/main/java/org/openstreetmap/josm/gradle/plugin/JosmPlugin.java @@ -34,7 +34,7 @@ public void apply(@Nonnull final Project project) { try { project.setVersion(new GitDescriber(project.getProjectDir()).describe(true)); } catch (Exception e) { - project.setVersion("‹unknown›"); + // Don't set the project version } // Apply the Java plugin if not available, because we rely on the `jar` task diff --git a/src/main/kotlin/task/CustomJosmVersionCompile.kt b/src/main/kotlin/task/CustomJosmVersionCompile.kt index e48576dc..cb8397f5 100644 --- a/src/main/kotlin/task/CustomJosmVersionCompile.kt +++ b/src/main/kotlin/task/CustomJosmVersionCompile.kt @@ -16,6 +16,8 @@ open class CustomJosmVersionCompile private lateinit var customJosm : Dependency init { + group = "JOSM" + description = "Compile the JOSM plugin against ${if (findNextVersion) { "the first available JOSM version since" } else { "JOSM version" }} $customVersion" classpath = additionalClasspath source.add(sourceSet.java) destinationDir = File(project.buildDir, "classes/java/${sourceSet.name}_${customVersion}")