Files
allwpilib/thirdparty/imgui_suite/publish.gradle
Gold856 3bf67edc34 [build] Refactor zip base name generation for consistency (#8831)
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`.
2026-04-27 11:46:11 -07:00

94 lines
1.9 KiB
Groovy

apply plugin: 'maven-publish'
def baseArtifactId = 'imguiSuite-cpp'
def artifactGroupId = 'org.wpilib.thirdparty.imguiSuite'
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('generated/fonts/src') {
into '/'
}
from('generated/gl3w/src') {
into '/'
}
from('glfw/src') {
into '/'
}
from('imgui/cpp') {
into '/'
}
from('implot/cpp') {
into '/'
}
from('stb/cpp') {
into '/'
}
}
task cppHeadersZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
archiveClassifier = "headers"
from(licenseFile) {
into '/'
}
from('generated/fonts/include') {
into '/'
}
from('generated/gl3w/include') {
into '/'
}
from('glfw/include') {
into '/'
}
from('imgui/include') {
into '/'
}
from('implot/include') {
into '/'
}
from('stb/include') {
into '/'
}
}
build.dependsOn cppHeadersZip
build.dependsOn cppSourcesZip
addTaskToCopyAllOutputs(cppHeadersZip)
addTaskToCopyAllOutputs(cppSourcesZip)
model {
publishing {
def imguiSuiteTaskList = createComponentZipTasks($.components, ['imguiSuite'], zipBaseName, Zip, project, includeStandardZipFormat)
publications {
cpp(MavenPublication) {
imguiSuiteTaskList.each {
artifact it
}
artifact cppHeadersZip
artifact cppSourcesZip
artifactId = baseArtifactId
groupId = artifactGroupId
version = wpilibVersioning.version.get()
}
}
}
}