From 03405ace38ec3ab3c682fe84bf8c2f88ef4fe519 Mon Sep 17 00:00:00 2001 From: Nicholas Blair <nicholas.blair@wisc.edu> Date: Tue, 30 Aug 2016 15:18:01 -0500 Subject: [PATCH] feat: integrate confirmProjectVersionIncremented logic We don't have a facility to apply the plugin itself without fetching an earlier version. Includes a script that delegates to the same logic as the task. --- build.gradle | 15 +++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 4 ++-- src/main/groovy/localTaskScript.groovy | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/main/groovy/localTaskScript.groovy diff --git a/build.gradle b/build.gradle index 0879ab1..0314851 100644 --- a/build.gradle +++ b/build.gradle @@ -53,3 +53,18 @@ uploadArchives { task wrapper(type: Wrapper) { gradleVersion = '3.0' } + +/** + * Gradle doesn't have a way for us to apply the local plugin, we'd have to depend on a prior release. + * Add a local version of the confirmProjectVersionIncremented task that calls the same logic + * as the released task. + * + * See src/main/groovy/localTaskScript.groovy + */ +task confirmProjectVersionIncremented (dependsOn: 'classes', type: JavaExec) { + main = 'localTaskScript' + classpath = sourceSets.main.runtimeClasspath + args project.projectDir.absolutePath + args project.version +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2f9830e..789fe15 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Aug 26 09:10:13 CDT 2016 +#Tue Aug 30 12:39:17 CDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip diff --git a/src/main/groovy/localTaskScript.groovy b/src/main/groovy/localTaskScript.groovy new file mode 100644 index 0000000..819ea66 --- /dev/null +++ b/src/main/groovy/localTaskScript.groovy @@ -0,0 +1,7 @@ +import edu.wisc.doit.gradle.CompareVersions +import org.ajoberstar.grgit.Grgit + +def grgit = Grgit.open(dir: args[0]) +CompareVersions.compare(grgit.describe(), args[1]) + + -- GitLab