mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
99 lines
2.3 KiB
Groovy
99 lines
2.3 KiB
Groovy
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 baseArtifactId = pluginName
|
|
def artifactGroupId = 'edu.wpi.first.halsim'
|
|
def zipBaseName = "_GROUP_edu_wpi_first_halsim_ID_${pluginName}_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 pluginTaskList = createComponentZipTasks($.components, pluginName, zipBaseName, Zip, project, { task, value ->
|
|
value.each { binary ->
|
|
if (binary.buildable) {
|
|
if (binary instanceof SharedLibraryBinarySpec) {
|
|
task.dependsOn binary.buildTask
|
|
task.from(binary.sharedLibraryFile) {
|
|
into getPlatformPath(binary) + '/shared'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
def allTask
|
|
if (!project.hasProperty('jenkinsBuild')) {
|
|
allTask = createAllCombined(pluginTaskList, pluginName, zipBaseName, Zip, project)
|
|
}
|
|
|
|
publications {
|
|
cpp(MavenPublication) {
|
|
pluginTaskList.each {
|
|
artifact it
|
|
}
|
|
|
|
if (!project.hasProperty('jenkinsBuild')) {
|
|
artifact allTask
|
|
}
|
|
|
|
artifact cppHeadersZip
|
|
artifact cppSourcesZip
|
|
|
|
|
|
artifactId = baseArtifactId
|
|
groupId artifactGroupId
|
|
version pubVersion
|
|
}
|
|
}
|
|
}
|
|
}
|