mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-06 03:31:41 +00:00
Add photon.pb.h/PhotonVersion to cpp headers zip & create combined sources zip (#1335)
Combined sources zip is useful for robotpy to build both targeting & lib in the same build
This commit is contained in:
@@ -159,6 +159,7 @@ task generateVendorJson() {
|
||||
}
|
||||
|
||||
build.mustRunAfter generateVendorJson
|
||||
publish.mustRunAfter generateVendorJson
|
||||
|
||||
task writeCurrentVersion {
|
||||
def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in")
|
||||
@@ -216,3 +217,65 @@ model {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add photonversion to cpp sources zip
|
||||
tasks.named('cppSourcesZip') {
|
||||
dependsOn writeCurrentVersion
|
||||
|
||||
from("$projectDir/src/generate/native/cpp") {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
// Publish an uberzip with photon-lib and photon-targeting. This makes python binding easier to have it in one place
|
||||
def zipBaseNameCombined = '_GROUP_org.photonvision_combinedcpp_ID_photonvision-combinedcpp_CLS'
|
||||
task combinedCppSourcesZip(type: Zip) {
|
||||
dependsOn(':photon-lib:cppSourcesZip', ':photon-targeting:cppSourcesZip')
|
||||
mustRunAfter(':photon-lib:cppHeadersZip', ':photon-targeting:cppHeadersZip')
|
||||
|
||||
destinationDirectory = file("$buildDir/outputs")
|
||||
archiveBaseName = zipBaseNameCombined
|
||||
archiveClassifier = "sources"
|
||||
|
||||
// Include the contents of the photon-lib cppSourcesZip. Magic chatgpt nonsense
|
||||
from(zipTree(project(':photon-lib').tasks.cppSourcesZip.archiveFile.get().asFile)) {
|
||||
into 'photon-lib'
|
||||
}
|
||||
from(zipTree(project(':photon-targeting').tasks.cppSourcesZip.archiveFile.get().asFile)) {
|
||||
into 'photon-targeting'
|
||||
}
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||
}
|
||||
task combinedHeadersZip(type: Zip) {
|
||||
dependsOn(':photon-lib:cppHeadersZip', ':photon-targeting:cppHeadersZip')
|
||||
mustRunAfter(':photon-lib:cppHeadersZip', ':photon-targeting:cppHeadersZip')
|
||||
|
||||
destinationDirectory = file("$buildDir/outputs")
|
||||
archiveBaseName = zipBaseNameCombined
|
||||
archiveClassifier = "headers"
|
||||
|
||||
// Include the contents of the photon-lib cppHeadersZip. Magic chatgpt nonsense
|
||||
from(zipTree(project(':photon-lib').tasks.cppHeadersZip.archiveFile.get().asFile)) {
|
||||
into 'photon-lib'
|
||||
}
|
||||
from(zipTree(project(':photon-targeting').tasks.cppHeadersZip.archiveFile.get().asFile)) {
|
||||
into 'photon-targeting'
|
||||
}
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||
}
|
||||
|
||||
// Add the uberzip to our maven publications
|
||||
publishing {
|
||||
publications {
|
||||
combinedcpp(MavenPublication) {
|
||||
artifact combinedCppSourcesZip
|
||||
artifact combinedHeadersZip
|
||||
|
||||
artifactId = "${nativeName}-combinedcpp"
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user