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'
|
2017-10-21 15:33:42 -07:00
|
|
|
def artifactGroupId = 'edu.wpi.first.wpilibj'
|
|
|
|
|
|
2018-09-26 21:10:26 -07:00
|
|
|
def examplesZipBaseName = '_GROUP_edu_wpi_first_wpilibj_ID_examples_CLS'
|
|
|
|
|
def templatesZipBaseName = '_GROUP_edu_wpi_first_wpilibj_ID_templates_CLS'
|
|
|
|
|
def commandsZipBaseName = '_GROUP_edu_wpi_first_wpilibj_ID_commands_CLS'
|
|
|
|
|
|
2017-10-21 15:33:42 -07:00
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
|
|
|
|
|
|
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 '/'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from('src/main/java/edu/wpi/first/wpilibj/examples') {
|
|
|
|
|
into 'examples'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 '/'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from('src/main/java/edu/wpi/first/wpilibj/templates') {
|
|
|
|
|
into 'templates'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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 '/'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from('src/main/java/edu/wpi/first/wpilibj/commands') {
|
|
|
|
|
into 'commands'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
groupId artifactGroupId
|
2019-08-22 21:48:43 -07:00
|
|
|
version wpilibVersioning.version.get()
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
templates(MavenPublication) {
|
|
|
|
|
artifact javaTemplatesZip
|
|
|
|
|
|
|
|
|
|
artifactId = baseTemplatesArtifactId
|
|
|
|
|
groupId artifactGroupId
|
2019-08-22 21:48:43 -07:00
|
|
|
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
|
|
|
|
|
groupId artifactGroupId
|
2019-08-22 21:48:43 -07:00
|
|
|
version wpilibVersioning.version.get()
|
2018-05-15 23:56:03 -07:00
|
|
|
}
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
}
|