Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
Adds way to force publishing version from command line (#182)
Browse files Browse the repository at this point in the history
In case we need to do a recreation of an artifact for some reason, this
makes it possible.
  • Loading branch information
ThadHouse authored and PeterJohnson committed Jan 5, 2017
1 parent 27c0405 commit ac56b0a
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -25,7 +44,7 @@ task outputVersions() {

doLast {
utilFile.write utilVersion
ntcoreFile.write WPILibVersion.version
ntcoreFile.write ntVersion
}
}

Expand All @@ -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.
Expand Down Expand Up @@ -76,7 +91,7 @@ publishing {

groupId 'edu.wpi.first.wpilib.networktables.java'
artifactId 'NetworkTables'
version WPILibVersion.version
version ntVersion
}
}
cpp(MavenPublication) {
Expand All @@ -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
Expand Down

0 comments on commit ac56b0a

Please sign in to comment.