Files
allwpilib/simulation/halsim_adx_gyro_accelerometer/publish.gradle
2018-08-01 21:39:20 -07:00

81 lines
1.8 KiB
Groovy

apply plugin: 'maven-publish'
def pubVersion = ''
if (project.hasProperty("publishVersion")) {
pubVersion = project.publishVersion
} else {
pubVersion = WPILibVersion.version
}
def baseArtifactId = nativeName
def artifactGroupId = 'edu.wpi.first.halsim'
def zipBaseName = "_GROUP_edu_wpi_first_halsim_ID_${nativeName}_CLS"
def outputsFolder = file("$project.buildDir/outputs")
task cppSourcesZip(type: Zip) {
destinationDir = outputsFolder
baseName = zipBaseName
classifier = "sources"
from(licenseFile) {
into '/'
}
from('src/main/native/cpp') {
into '/'
}
}
task cppHeadersZip(type: Zip) {
destinationDir = outputsFolder
baseName = zipBaseName
classifier = "headers"
from(licenseFile) {
into '/'
}
from('src/main/native/include') {
into '/'
}
}
build.dependsOn cppSourcesZip
build.dependsOn cppHeadersZip
addTaskToCopyAllOutputs(cppSourcesZip)
addTaskToCopyAllOutputs(cppHeadersZip)
model {
publishing {
def halsim_adx_gyro_accelerometerTaskList = createComponentZipTasks($.components, nativeName, zipBaseName, Zip, project, includeStandardZipFormat)
def allTask
if (!project.hasProperty('jenkinsBuild')) {
allTask = createAllCombined(halsim_adx_gyro_accelerometerTaskList, nativeName, zipBaseName, Zip, project)
}
publications {
cpp(MavenPublication) {
halsim_adx_gyro_accelerometerTaskList.each {
artifact it
}
if (!project.hasProperty('jenkinsBuild')) {
artifact allTask
}
artifact cppHeadersZip
artifact cppSourcesZip
artifactId = baseArtifactId
groupId artifactGroupId
version pubVersion
}
}
}
}