mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
Remove unused JNI artifacts (#1603)
Also removes unnecessary `_M_` prefix from artifacts.
This commit is contained in:
@@ -110,7 +110,7 @@ ext.createComponentZipTasks = { components, names, base, type, project, func ->
|
|||||||
description = 'Creates component archive for platform ' + key
|
description = 'Creates component archive for platform ' + key
|
||||||
destinationDirectory = outputsFolder
|
destinationDirectory = outputsFolder
|
||||||
archiveClassifier = key
|
archiveClassifier = key
|
||||||
archiveBaseName = '_M_' + base
|
archiveBaseName = base
|
||||||
duplicatesStrategy = 'exclude'
|
duplicatesStrategy = 'exclude'
|
||||||
|
|
||||||
from(licenseFile) {
|
from(licenseFile) {
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ def baseArtifactId = nativeName
|
|||||||
def artifactGroupId = 'org.photonvision'
|
def artifactGroupId = 'org.photonvision'
|
||||||
def zipBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId}-cpp_CLS"
|
def zipBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId}-cpp_CLS"
|
||||||
|
|
||||||
def jniBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-jni_CLS"
|
|
||||||
def jniCvStaticBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-jnicvstatic_CLS"
|
|
||||||
|
|
||||||
def licenseFile = ext.licenseFile
|
def licenseFile = ext.licenseFile
|
||||||
// Quick hack to make this name visible to photon-lib for combined
|
// Quick hack to make this name visible to photon-lib for combined
|
||||||
ext.zipBaseName = zipBaseName
|
ext.zipBaseName = zipBaseName
|
||||||
@@ -80,29 +77,6 @@ model {
|
|||||||
"${nativeName}JNI"
|
"${nativeName}JNI"
|
||||||
], zipBaseName, Zip, project, includeStandardZipFormat)
|
], zipBaseName, Zip, project, includeStandardZipFormat)
|
||||||
|
|
||||||
// From https://github.com/wpilibsuite/allwpilib/blob/1c220ebc607daa8da7d983b8f17bc40323633cb2/shared/jni/publish.gradle#L80C9-L100C11
|
|
||||||
def jniTaskList = createComponentZipTasks($.components, ["${nativeName}JNI"], jniBaseName, Jar, project, { task, value ->
|
|
||||||
value.each { binary ->
|
|
||||||
if (binary.buildable) {
|
|
||||||
if (binary instanceof SharedLibraryBinarySpec) {
|
|
||||||
task.dependsOn binary.tasks.link
|
|
||||||
def hashFile = new File(binary.sharedLibraryFile.parentFile.absolutePath, "${binary.component.baseName}.hash")
|
|
||||||
task.outputs.file(hashFile)
|
|
||||||
task.inputs.file(binary.sharedLibraryFile)
|
|
||||||
task.from(hashFile) {
|
|
||||||
into nativeUtils.getPlatformPath(binary)
|
|
||||||
}
|
|
||||||
task.doFirst {
|
|
||||||
hashFile.text = MessageDigest.getInstance("MD5").digest(binary.sharedLibraryFile.bytes).encodeHex().toString()
|
|
||||||
}
|
|
||||||
task.from(binary.sharedLibraryFile) {
|
|
||||||
into nativeUtils.getPlatformPath(binary)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
publications {
|
publications {
|
||||||
cpp(MavenPublication) {
|
cpp(MavenPublication) {
|
||||||
cppTaskList.each {
|
cppTaskList.each {
|
||||||
@@ -115,15 +89,6 @@ model {
|
|||||||
groupId artifactGroupId
|
groupId artifactGroupId
|
||||||
version pubVersion
|
version pubVersion
|
||||||
}
|
}
|
||||||
jni(MavenPublication) {
|
|
||||||
jniTaskList.each {
|
|
||||||
artifact it
|
|
||||||
}
|
|
||||||
|
|
||||||
artifactId = "${baseArtifactId}-jni"
|
|
||||||
groupId artifactGroupId
|
|
||||||
version pubVersion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Reference in New Issue
Block a user