mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
82 lines
1.8 KiB
Groovy
82 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 lowfiSimTaskList = createComponentZipTasks($.components, nativeName, zipBaseName, Zip, project, includeStandardZipFormat)
|
|
def allTask
|
|
if (!project.hasProperty('jenkinsBuild')) {
|
|
allTask = createAllCombined(lowfiSimTaskList, nativeName, zipBaseName, Zip, project)
|
|
}
|
|
|
|
|
|
|
|
publications {
|
|
cpp(MavenPublication) {
|
|
lowfiSimTaskList.each {
|
|
artifact it
|
|
}
|
|
|
|
if (!project.hasProperty('jenkinsBuild')) {
|
|
artifact allTask
|
|
}
|
|
|
|
artifact cppHeadersZip
|
|
artifact cppSourcesZip
|
|
|
|
|
|
artifactId = baseArtifactId
|
|
groupId artifactGroupId
|
|
version pubVersion
|
|
}
|
|
}
|
|
}
|
|
}
|