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.
This commit is contained in:
Thad House
2017-01-04 22:16:17 -08:00
committed by Peter Johnson
parent b55c604c0a
commit 23462ec7df

View File

@@ -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
}
}
}