From ac56b0a33e6bde59419dd7304539706b02825c7b Mon Sep 17 00:00:00 2001 From: Thad House Date: Wed, 4 Jan 2017 22:15:23 -0800 Subject: [PATCH] Adds way to force publishing version from command line (#182) In case we need to do a recreation of an artifact for some reason, this makes it possible. --- publish.gradle | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/publish.gradle b/publish.gradle index 9d0f208..63d7243 100644 --- a/publish.gradle +++ b/publish.gradle @@ -10,7 +10,26 @@ def getVersion = { return "" } -def utilVersion = "1.0.2${-> getVersion()}" +if (!hasProperty('releaseType')) { + WPILibVersion { + releaseType = 'dev' + } +} + +def ntVersion +def utilVersion +if (project.hasProperty("ntPublishVersion")) { + ntVersion = project.ntPublishVersion +} else { + ntVersion = WPILibVersion.version +} + +if (project.hasProperty("utilPublishVersion")) { + utilVersion = project.utilPublishVersion +} else { + utilVersion = "1.0.2${-> getVersion()}" +} + def utilFile = file("$buildDir/wpiutil.txt") def ntcoreFile = file("$buildDir/ntcore.txt") @@ -25,7 +44,7 @@ task outputVersions() { doLast { utilFile.write utilVersion - ntcoreFile.write WPILibVersion.version + ntcoreFile.write ntVersion } } @@ -43,11 +62,7 @@ if (project.buildArm) { project(':arm:ntcore').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. @@ -76,7 +91,7 @@ publishing { groupId 'edu.wpi.first.wpilib.networktables.java' artifactId 'NetworkTables' - version WPILibVersion.version + version ntVersion } } cpp(MavenPublication) { @@ -94,7 +109,7 @@ publishing { groupId 'edu.wpi.first.wpilib.networktables.cpp' artifactId 'NetworkTables' - version WPILibVersion.version + version ntVersion } wpiutil(MavenPublication) { artifact project(':native:wpiutil').wpiutilZip