mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
103 lines
3.2 KiB
Groovy
103 lines
3.2 KiB
Groovy
import org.gradle.internal.os.OperatingSystem
|
|
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
|
|
|
|
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 WPILibVersion.version
|
|
}
|
|
}
|
|
|
|
task clean(type: Delete) {
|
|
delete csFile
|
|
}
|
|
|
|
outputVersions.mustRunAfter clean
|
|
|
|
if (!OperatingSystem.current().isWindows()) {
|
|
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) {
|
|
if (!OperatingSystem.current().isWindows()) {
|
|
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 (!OperatingSystem.current().isWindows()) {
|
|
if (project.hasProperty('makeDesktop')) {
|
|
artifact nat.jar, {
|
|
classifier = 'desktop'
|
|
}
|
|
}
|
|
}
|
|
|
|
groupId 'edu.wpi.cscore.java'
|
|
artifactId 'cscore'
|
|
version WPILibVersion.version
|
|
}
|
|
}
|
|
cpp(MavenPublication) {
|
|
if (!OperatingSystem.current().isWindows()) {
|
|
artifact nat.cscoreZip
|
|
}
|
|
artifact cscoreSourceZip
|
|
if (project.buildArm) {
|
|
artifact project(':arm').cscoreZip
|
|
if (!project.hasProperty('compilerPrefix')) {
|
|
artifact project(':arm').athenaCscoreUberZip {
|
|
classifier = 'athena-uberzip'
|
|
}
|
|
}
|
|
}
|
|
if (!OperatingSystem.current().isWindows()) {
|
|
if (project.hasProperty('makeDesktop')) {
|
|
artifact nat.cscoreZip, {
|
|
classifier = 'desktop'
|
|
}
|
|
}
|
|
}
|
|
|
|
groupId 'edu.wpi.cscore.cpp'
|
|
artifactId 'cscore'
|
|
version WPILibVersion.version
|
|
}
|
|
}
|
|
}
|