From 23462ec7dff27b365bba755227263e5e678c8bfb Mon Sep 17 00:00:00 2001 From: Thad House Date: Wed, 4 Jan 2017 22:16:17 -0800 Subject: [PATCH] Adds way to force publishing version from command line (#43) In case we need to do a recreation of an artifact for some reason, this makes it possible. --- publish.gradle | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/publish.gradle b/publish.gradle index a94c435c6b..59e2b4f554 100644 --- a/publish.gradle +++ b/publish.gradle @@ -3,6 +3,19 @@ import org.gradle.internal.os.OperatingSystem apply plugin: 'maven-publish' apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' +if (!hasProperty('releaseType')) { + WPILibVersion { + releaseType = 'dev' + } +} + +def csVersion +if (project.hasProperty("csPublishVersion")) { + csVersion = project.csPublishVersion +} else { + csVersion = WPILibVersion.version +} + def csFile = file("$buildDir/cscore.txt") task outputVersions() { @@ -15,7 +28,7 @@ task outputVersions() { } doLast { - csFile.write WPILibVersion.version + csFile.write csVersion } } @@ -30,12 +43,6 @@ if (project.buildArm) { project(':arm').build.dependsOn outputVersions } -if (!hasProperty('releaseType')) { - WPILibVersion { - releaseType = 'dev' - } -} - // We change what repo we publish to depending on whether this is a development, beta, stable, or full // release. This is set up in the main gradle file. publishing { @@ -69,7 +76,7 @@ publishing { groupId 'edu.wpi.cscore.java' artifactId 'cscore' - version WPILibVersion.version + version csVersion } } cpp(MavenPublication) { @@ -91,7 +98,7 @@ publishing { groupId 'edu.wpi.cscore.cpp' artifactId 'cscore' - version WPILibVersion.version + version csVersion } } }