mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Right now, the `zipBaseName` variable in various publish.gradle files contains the group ID and artifact ID for use by the combiner, however, they are also duplicated in `artifactGroupId` and `baseArtifactId`, leading to potential mistakes if they aren't updated together. This fixes that by adding a new utility function `makeZipBaseName` to automatically create the right name given a group ID and artifact ID. This also fixes publishing for thirdparty subprojects, which didn't update `zipBaseName`.
72 lines
1.6 KiB
Groovy
72 lines
1.6 KiB
Groovy
apply plugin: 'maven-publish'
|
|
|
|
def baseArtifactId = 'wpigui-cpp'
|
|
def artifactGroupId = 'org.wpilib.wpigui'
|
|
def zipBaseName = makeZipBaseName(artifactGroupId, baseArtifactId)
|
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
task cppSourcesZip(type: Zip) {
|
|
destinationDirectory = outputsFolder
|
|
archiveBaseName = zipBaseName
|
|
archiveClassifier = "sources"
|
|
|
|
from(licenseFile) {
|
|
into '/'
|
|
}
|
|
|
|
from('src/main/native/cpp') {
|
|
into '/'
|
|
}
|
|
from('src/main/native/directx11') {
|
|
into '/'
|
|
}
|
|
from('src/main/native/metal') {
|
|
into '/'
|
|
}
|
|
from('src/main/native/opengl3') {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
task cppHeadersZip(type: Zip) {
|
|
destinationDirectory = outputsFolder
|
|
archiveBaseName = zipBaseName
|
|
archiveClassifier = "headers"
|
|
|
|
from(licenseFile) {
|
|
into '/'
|
|
}
|
|
|
|
from('src/main/native/include') {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
build.dependsOn cppHeadersZip
|
|
build.dependsOn cppSourcesZip
|
|
|
|
addTaskToCopyAllOutputs(cppHeadersZip)
|
|
addTaskToCopyAllOutputs(cppSourcesZip)
|
|
|
|
model {
|
|
publishing {
|
|
def wpiguiTaskList = createComponentZipTasks($.components, ['wpigui'], zipBaseName, Zip, project, includeStandardZipFormat)
|
|
|
|
publications {
|
|
cpp(MavenPublication) {
|
|
wpiguiTaskList.each {
|
|
artifact it
|
|
}
|
|
|
|
artifact cppHeadersZip
|
|
artifact cppSourcesZip
|
|
|
|
artifactId = baseArtifactId
|
|
groupId = artifactGroupId
|
|
version = wpilibVersioning.version.get()
|
|
}
|
|
}
|
|
}
|
|
}
|