2017-10-21 15:33:42 -07:00
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
|
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
|
|
|
|
|
|
|
|
|
|
if (!hasProperty('releaseType')) {
|
|
|
|
|
WPILibVersion {
|
|
|
|
|
releaseType = 'dev'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def pubVersion
|
|
|
|
|
if (project.hasProperty("publishVersion")) {
|
|
|
|
|
pubVersion = project.publishVersion
|
|
|
|
|
} else {
|
|
|
|
|
pubVersion = WPILibVersion.version
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def baseExamplesArtifactId = 'examples'
|
|
|
|
|
def baseTemplatesArtifactId = 'templates'
|
|
|
|
|
def artifactGroupId = 'edu.wpi.first.wpilibc'
|
|
|
|
|
|
|
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
|
|
|
|
|
|
task cppExamplesZip(type: Zip) {
|
|
|
|
|
destinationDir = outputsFolder
|
2017-11-07 14:54:17 -08:00
|
|
|
baseName = 'wpilibc-examples'
|
2017-10-21 15:33:42 -07:00
|
|
|
|
|
|
|
|
from(licenseFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from('src/main/cpp/examples') {
|
|
|
|
|
into 'examples'
|
|
|
|
|
}
|
2017-11-04 10:09:41 -07:00
|
|
|
|
|
|
|
|
from ('examples.xml') {
|
|
|
|
|
into 'examples'
|
|
|
|
|
}
|
2017-10-21 15:33:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task cppTemplatesZip(type: Zip) {
|
|
|
|
|
destinationDir = outputsFolder
|
2017-11-07 14:54:17 -08:00
|
|
|
baseName = 'wpilibc-templates'
|
2017-10-21 15:33:42 -07:00
|
|
|
|
|
|
|
|
from(licenseFile) {
|
|
|
|
|
into '/'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from('src/main/cpp/templates') {
|
|
|
|
|
into 'templates'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build.dependsOn cppTemplatesZip
|
|
|
|
|
build.dependsOn cppExamplesZip
|
|
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
|
publications {
|
|
|
|
|
examples(MavenPublication) {
|
|
|
|
|
artifact cppExamplesZip
|
|
|
|
|
|
|
|
|
|
artifactId = baseExamplesArtifactId
|
|
|
|
|
groupId artifactGroupId
|
|
|
|
|
version pubVersion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
templates(MavenPublication) {
|
|
|
|
|
artifact cppTemplatesZip
|
|
|
|
|
|
|
|
|
|
artifactId = baseTemplatesArtifactId
|
|
|
|
|
groupId artifactGroupId
|
|
|
|
|
version pubVersion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|