2017-10-21 15:33:42 -07:00
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
|
|
|
|
|
|
def baseExamplesArtifactId = 'examples'
|
|
|
|
|
def baseTemplatesArtifactId = 'templates'
|
2018-05-15 23:56:03 -07:00
|
|
|
def baseCommandsArtifactId = 'commands'
|
2025-11-07 20:00:38 -05:00
|
|
|
def artifactGroupId = 'org.wpilib.wpilibj'
|
2017-10-21 15:33:42 -07:00
|
|
|
|
2026-04-27 14:46:11 -04:00
|
|
|
def examplesZipBaseName = makeZipBaseName(artifactGroupId, baseExamplesArtifactId)
|
|
|
|
|
def templatesZipBaseName = makeZipBaseName(artifactGroupId, baseTemplatesArtifactId)
|
|
|
|
|
def commandsZipBaseName = makeZipBaseName(artifactGroupId, baseCommandsArtifactId)
|
2018-09-26 21:10:26 -07:00
|
|
|
|
2017-10-21 15:33:42 -07:00
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
|
|
2026-02-21 14:35:26 -08:00
|
|
|
def mainFile = file("$projectDir/src/main/java/org/wpilib/Main.java")
|
|
|
|
|
|
2017-10-21 15:33:42 -07:00
|
|
|
task javaExamplesZip(type: Zip) {
|
2019-11-12 17:14:04 -08:00
|
|
|
destinationDirectory = outputsFolder
|
|
|
|
|
archiveBaseName = examplesZipBaseName
|
2017-10-21 15:33:42 -07:00
|
|
|
|
|
|
|
|
from(licenseFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-21 14:35:26 -08:00
|
|
|
from(mainFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-15 17:03:55 -08:00
|
|
|
from('src/main/java/org/wpilib/examples') {
|
2017-10-21 15:33:42 -07:00
|
|
|
into 'examples'
|
|
|
|
|
}
|
2023-10-27 16:57:38 -07:00
|
|
|
|
2025-11-15 17:03:55 -08:00
|
|
|
from('src/test/java/org/wpilib/examples') {
|
2023-10-27 16:57:38 -07:00
|
|
|
into 'examples_test'
|
|
|
|
|
}
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task javaTemplatesZip(type: Zip) {
|
2019-11-12 17:14:04 -08:00
|
|
|
destinationDirectory = outputsFolder
|
|
|
|
|
archiveBaseName = templatesZipBaseName
|
2017-10-21 15:33:42 -07:00
|
|
|
|
|
|
|
|
from(licenseFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-21 14:35:26 -08:00
|
|
|
from(mainFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-15 17:03:55 -08:00
|
|
|
from('src/main/java/org/wpilib/templates') {
|
2017-10-21 15:33:42 -07:00
|
|
|
into 'templates'
|
|
|
|
|
}
|
2023-10-27 16:57:38 -07:00
|
|
|
|
2025-11-15 17:03:55 -08:00
|
|
|
from('src/test/java/org/wpilib/templates') {
|
2023-10-27 16:57:38 -07:00
|
|
|
into 'templates_test'
|
|
|
|
|
}
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
|
2018-05-15 23:56:03 -07:00
|
|
|
task javaCommandsZip(type: Zip) {
|
2019-11-12 17:14:04 -08:00
|
|
|
destinationDirectory = outputsFolder
|
|
|
|
|
archiveBaseName = commandsZipBaseName
|
2018-05-15 23:56:03 -07:00
|
|
|
|
|
|
|
|
from(licenseFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-15 17:03:55 -08:00
|
|
|
from('src/main/java/org/wpilib/commands') {
|
2018-05-15 23:56:03 -07:00
|
|
|
into 'commands'
|
|
|
|
|
}
|
2023-10-27 16:57:38 -07:00
|
|
|
|
2025-11-15 17:03:55 -08:00
|
|
|
from('src/test/java/org/wpilib/commands') {
|
2023-10-27 16:57:38 -07:00
|
|
|
into 'commands_test'
|
|
|
|
|
}
|
2018-05-15 23:56:03 -07:00
|
|
|
}
|
|
|
|
|
|
2017-10-21 15:33:42 -07:00
|
|
|
build.dependsOn javaTemplatesZip
|
|
|
|
|
build.dependsOn javaExamplesZip
|
2018-05-15 23:56:03 -07:00
|
|
|
build.dependsOn javaCommandsZip
|
2017-10-21 15:33:42 -07:00
|
|
|
|
2018-09-26 21:10:26 -07:00
|
|
|
addTaskToCopyAllOutputs(javaTemplatesZip)
|
|
|
|
|
addTaskToCopyAllOutputs(javaExamplesZip)
|
|
|
|
|
addTaskToCopyAllOutputs(javaCommandsZip)
|
|
|
|
|
|
2017-10-21 15:33:42 -07:00
|
|
|
publishing {
|
|
|
|
|
publications {
|
|
|
|
|
examples(MavenPublication) {
|
|
|
|
|
artifact javaExamplesZip
|
|
|
|
|
|
|
|
|
|
artifactId = baseExamplesArtifactId
|
2025-08-08 08:08:34 -07:00
|
|
|
groupId = artifactGroupId
|
|
|
|
|
version = wpilibVersioning.version.get()
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
templates(MavenPublication) {
|
|
|
|
|
artifact javaTemplatesZip
|
|
|
|
|
|
|
|
|
|
artifactId = baseTemplatesArtifactId
|
2025-08-08 08:08:34 -07:00
|
|
|
groupId = artifactGroupId
|
|
|
|
|
version = wpilibVersioning.version.get()
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
2018-05-15 23:56:03 -07:00
|
|
|
|
|
|
|
|
commands(MavenPublication) {
|
|
|
|
|
artifact javaCommandsZip
|
|
|
|
|
|
|
|
|
|
artifactId = baseCommandsArtifactId
|
2025-08-08 08:08:34 -07:00
|
|
|
groupId = artifactGroupId
|
|
|
|
|
version = wpilibVersioning.version.get()
|
2018-05-15 23:56:03 -07:00
|
|
|
}
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
}
|