Files
allwpilib/publish.gradle
Thad House 23462ec7df 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.
2017-01-04 22:16:17 -08:00

105 lines
3.0 KiB
Groovy

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() {
description = 'Prints the version of cscore to a file for use by the downstream packaging project'
group = 'Build'
outputs.files(csFile)
doFirst {
buildDir.mkdir()
}
doLast {
csFile.write csVersion
}
}
task clean(type: Delete) {
delete csFile
}
outputVersions.mustRunAfter clean
project(':native').build.dependsOn outputVersions
if (project.buildArm) {
project(':arm').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.
publishing {
publications {
def nat = project('native')
if (!project.hasProperty('skipJava')) {
java(MavenPublication) {
artifact nat.jar
if (!project.buildArm) {
artifact nat.cscoreJavaSource
artifact nat.cscoreJavadoc
}
if (project.buildArm) {
def camArm = project('arm')
artifact camArm.jar
// If the library is not embedded include it in the repo
if (!project.hasProperty('compilerPrefix')) {
artifact camArm.cscoreZip
artifact camArm.athenaCscoreUberZip {
classifier = 'athena-uberzip'
}
}
artifact camArm.cscoreJavaSource
artifact camArm.cscoreJavadoc
}
if (project.hasProperty('makeDesktop')) {
artifact nat.jar, {
classifier = 'desktop'
}
}
groupId 'edu.wpi.cscore.java'
artifactId 'cscore'
version csVersion
}
}
cpp(MavenPublication) {
artifact nat.cscoreZip
artifact cscoreSourceZip
if (project.buildArm) {
artifact project(':arm').cscoreZip
if (!project.hasProperty('compilerPrefix')) {
artifact project(':arm').athenaCscoreUberZip {
classifier = 'athena-uberzip'
}
}
}
if (project.hasProperty('makeDesktop')) {
artifact nat.cscoreZip, {
classifier = 'desktop'
}
}
groupId 'edu.wpi.cscore.cpp'
artifactId 'cscore'
version csVersion
}
}
}