diff options
author | Eric Wendelin <eric@gradle.com> | 2017-11-01 16:43:57 -0700 |
---|---|---|
committer | Simon Ogorodnik <simon.ogorodnik@gmail.com> | 2017-11-02 02:43:57 +0300 |
commit | d92518ab71a2b10cb50758cc6f6a20c55253ffea (patch) | |
tree | 879796d4069864a97270c8a808892a278bf0b60a | |
parent | 3a3baf1014b731957e46ba663ab961fcb5beb4a7 (diff) | |
download | dokka-d92518ab71a2b10cb50758cc6f6a20c55253ffea.tar.gz dokka-d92518ab71a2b10cb50758cc6f6a20c55253ffea.tar.bz2 dokka-d92518ab71a2b10cb50758cc6f6a20c55253ffea.zip |
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
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 2 | ||||
-rw-r--r-- | runners/maven-plugin/build.gradle | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c583957d..590f0e81 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip 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("<version>dokka_version</version>", "<version>$dokka_version</version>") - .replace("<maven.version></maven.version>", "<maven.version>$maven_version</maven.version>") - .replace("<version>maven-plugin-plugin</version>", "<version>$maven_plugin_tools_version</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("<version>dokka_version</version>", "<version>$dokka_version</version>") + .replace("<maven.version></maven.version>", "<maven.version>$maven_version</maven.version>") + .replace("<version>maven-plugin-plugin</version>", "<version>$maven_plugin_tools_version</version>") + } } task mergeClassOutputs doLast { @@ -145,4 +149,4 @@ publishing { } } -bintrayPublication(project, ['dokkaMavenPlugin'])
\ No newline at end of file +bintrayPublication(project, ['dokkaMavenPlugin']) |