mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
99 lines
2.4 KiB
Groovy
99 lines
2.4 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 = 'gtest'
|
|
def artifactGroupId = 'edu.wpi.first.gtest'
|
|
def zipBaseName = '_GROUP_edu_wpi_first_gtest_ID_gtest_CLS'
|
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
task cppSourcesZip(type: Zip) {
|
|
destinationDir = outputsFolder
|
|
baseName = zipBaseName
|
|
classifier = "sources"
|
|
|
|
from("$projectDir/LICENSE") {
|
|
into '/'
|
|
}
|
|
|
|
from('src/main/native/cpp') {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
task cppHeadersZip(type: Zip) {
|
|
destinationDir = outputsFolder
|
|
baseName = zipBaseName
|
|
classifier = "headers"
|
|
|
|
from("$projectDir/LICENSE") {
|
|
into '/'
|
|
}
|
|
|
|
from('src/main/native/include') {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
build.dependsOn cppHeadersZip
|
|
build.dependsOn cppSourcesZip
|
|
|
|
addTaskToCopyAllOutputs(cppHeadersZip)
|
|
addTaskToCopyAllOutputs(cppSourcesZip)
|
|
|
|
model {
|
|
publishing {
|
|
def taskList = createComponentZipTasks($.components, 'gtest', zipBaseName, Zip, project, { task, value ->
|
|
task.from("$projectDir/LICENSE") {
|
|
into '/'
|
|
}
|
|
value.each { binary ->
|
|
if (binary.buildable) {
|
|
if (binary instanceof StaticLibraryBinarySpec) {
|
|
task.dependsOn binary.buildTask
|
|
task.from(binary.staticLibraryFile) {
|
|
into getPlatformPath(binary) + '/static'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
def allTask
|
|
if (!project.hasProperty('jenkinsBuild')) {
|
|
allTask = createAllCombined(taskList, 'gtest', zipBaseName, Zip, project)
|
|
}
|
|
|
|
publications {
|
|
cpp(MavenPublication) {
|
|
taskList.each {
|
|
artifact it
|
|
}
|
|
artifact cppHeadersZip
|
|
artifact cppSourcesZip
|
|
|
|
if (!project.hasProperty('jenkinsBuild')) {
|
|
artifact allTask
|
|
}
|
|
|
|
artifactId = "${baseArtifactId}-cpp"
|
|
groupId artifactGroupId
|
|
version pubVersion
|
|
}
|
|
}
|
|
}
|
|
}
|