From d92518ab71a2b10cb50758cc6f6a20c55253ffea Mon Sep 17 00:00:00 2001 From: Eric Wendelin Date: Wed, 1 Nov 2017 16:43:57 -0700 Subject: Ensure build directory exists before generating POM into it (#236) This declares the inputs and outputs for the maven-plugin generatePom task, which improves incremental build support and as of Gradle 4.3 (updated) automatically creates directory paths for declared outputs. Issue: #235 --- runners/maven-plugin/build.gradle | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'runners/maven-plugin') diff --git a/runners/maven-plugin/build.gradle b/runners/maven-plugin/build.gradle index 37a79a69..a9a77a8b 100644 --- a/runners/maven-plugin/build.gradle +++ b/runners/maven-plugin/build.gradle @@ -24,12 +24,16 @@ dependencies { shadow "org.apache.maven.plugin-tools:maven-plugin-annotations:$maven_plugin_tools_version" } -task ("generatePom") doLast { - final pomTemplate = new File(projectDir, "pom.tpl.xml") - final pom = new File(buildDir, "pom.xml") - pom.text = pomTemplate.text.replace("dokka_version", "$dokka_version") - .replace("", "$maven_version") - .replace("maven-plugin-plugin", "$maven_plugin_tools_version") +task generatePom() { + inputs.file(new File(projectDir, "pom.tpl.xml")) + outputs.file(new File(buildDir, "pom.xml")) + doLast { + final pomTemplate = new File(projectDir, "pom.tpl.xml") + final pom = new File(buildDir, "pom.xml") + pom.text = pomTemplate.text.replace("dokka_version", "$dokka_version") + .replace("", "$maven_version") + .replace("maven-plugin-plugin", "$maven_plugin_tools_version") + } } task mergeClassOutputs doLast { @@ -145,4 +149,4 @@ publishing { } } -bintrayPublication(project, ['dokkaMavenPlugin']) \ No newline at end of file +bintrayPublication(project, ['dokkaMavenPlugin']) -- cgit