Updated the gradle build to get the version from the WPILibVersioning plugin (#123)

* Updated the gradle build to get the version from the WPILibVersioning plugin

* Added version output for downstream projects

* Fixed non-arm build.
This commit is contained in:
Fred Silberberg
2016-10-20 21:34:14 -07:00
committed by GitHub
parent 780e9580b7
commit 56179088bb
2 changed files with 27 additions and 16 deletions

View File

@@ -8,13 +8,7 @@ buildscript {
}
dependencies {
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
}
}
// Determine what repo to publish to. Default is development. Valid options are development, beta, stable, and release
if (!hasProperty('repo')) {
allprojects {
ext.repo = 'development'
classpath 'gradle.plugin.edu.wpi.first.wpilib.versioning:wpilib-version-plugin:1.1'
}
}

View File

@@ -1,6 +1,29 @@
import org.gradle.internal.os.OperatingSystem
apply plugin: 'maven-publish'
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
def utilVersion = "1.0.0${-> WPILibVersion.version.substring(WPILibVersion.version.indexOf('-'))}"
task outputVersions() {
description = 'Prints the versions of ntcore and wpiutil to a file for use by the downstream packaging project'
group = 'Build'
def utilFile = file("$buildDir/wpiutil.txt")
def ntcoreFile = file("$buildDir/ntcore.txt")
outputs.files(utilFile, ntcoreFile)
doLast {
utilFile.write utilVersion
ntcoreFile.write WPILibVersion.version
}
}
project(':native:wpiutil').build.dependsOn outputVersions
project(':native:ntcore').build.dependsOn outputVersions
if (project.buildArm) {
project(':arm:wpiutil').build.dependsOn outputVersions
project(':arm:ntcore').build.dependsOn outputVersions
}
// 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.
@@ -24,7 +47,7 @@ publishing {
groupId 'edu.wpi.first.wpilib.networktables.java'
artifactId 'NetworkTables'
version '3.0.0-SNAPSHOT'
version WPILibVersion.version
}
}
cpp(MavenPublication) {
@@ -42,7 +65,7 @@ publishing {
groupId 'edu.wpi.first.wpilib.networktables.cpp'
artifactId 'NetworkTables'
version '3.0.0-SNAPSHOT'
version WPILibVersion.version
}
wpiutil(MavenPublication) {
artifact project(':native:wpiutil').wpiutilZip
@@ -59,13 +82,7 @@ publishing {
groupId 'edu.wpi.first.wpilib'
artifactId 'wpiutil'
version '1.0.0-SNAPSHOT'
}
}
repositories {
maven {
url "${System.getProperty('user.home')}/releases/maven/${project.repo}"
version utilVersion
}
}
}