Files
allwpilib/publish.gradle
2016-10-22 09:57:38 -07:00

77 lines
2.1 KiB
Groovy

import org.gradle.internal.os.OperatingSystem
apply plugin: 'maven-publish'
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
def csFile = file("$buildDir/cameraserver.txt")
task outputVersions() {
description = 'Prints the version of CameraServer to a file for use by the downstream packaging project'
group = 'Build'
outputs.files(csFile)
doFirst {
buildDir.mkdir()
}
doLast {
csFile.write WPILibVersion.version
}
}
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
artifact nat.cameraserverJavaSource
artifact nat.cameraserverJavadoc
if (project.buildArm) {
artifact project('arm').jar
}
if (project.hasProperty('makeDesktop')) {
artifact nat.jar, {
classifier = 'desktop'
}
}
groupId 'edu.wpi.cameraserver.java'
artifactId 'CameraServer'
version WPILibVersion.version
}
}
cpp(MavenPublication) {
artifact nat.cameraserverZip
artifact cameraserverSourceZip
if (project.buildArm) {
artifact project(':arm').cameraserverZip
}
if (project.hasProperty('makeDesktop')) {
artifact nat.cameraserverZip, {
classifier = 'desktop'
}
}
groupId 'edu.wpi.cameraserver.cpp'
artifactId 'CameraServer'
version WPILibVersion.version
}
}
}