mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[build] Remove statically linked JNI artifacts (#7553)
This commit is contained in:
@@ -7,7 +7,6 @@ def baseArtifactId = nativeName
|
||||
def artifactGroupId = "edu.wpi.first.${nativeName}"
|
||||
def zipBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-cpp_CLS"
|
||||
ext.zipBaseName = zipBaseName
|
||||
def jniBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-jni_CLS"
|
||||
def jniCvStaticBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-jnicvstatic_CLS"
|
||||
|
||||
def licenseFile = file("$rootDir/license.md")
|
||||
@@ -77,28 +76,6 @@ model {
|
||||
"${nativeName}JNIShared"
|
||||
], zipBaseName, Zip, project, includeStandardZipFormat)
|
||||
|
||||
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 {
|
||||
cpp(MavenPublication) {
|
||||
taskList.each {
|
||||
@@ -111,15 +88,6 @@ model {
|
||||
groupId artifactGroupId
|
||||
version wpilibVersioning.version.get()
|
||||
}
|
||||
jni(MavenPublication) {
|
||||
jniTaskList.each {
|
||||
artifact it
|
||||
}
|
||||
|
||||
artifactId = "${baseArtifactId}-jni"
|
||||
groupId artifactGroupId
|
||||
version wpilibVersioning.version.get()
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty('cvStaticBuild') && project.getProperty('cvStaticBuild') == true) {
|
||||
|
||||
@@ -145,53 +145,6 @@ model {
|
||||
}
|
||||
}
|
||||
}
|
||||
"${nativeName}JNI"(JniNativeLibrarySpec) {
|
||||
if (project.hasProperty('setBaseName')) {
|
||||
baseName = setBaseName + 'jni'
|
||||
} else {
|
||||
baseName = nativeName + 'jni'
|
||||
}
|
||||
|
||||
if (project.hasProperty('skipJniSymbols')) {
|
||||
checkSkipSymbols = skipJniSymbols
|
||||
}
|
||||
|
||||
enableCheckTask !project.hasProperty('skipJniCheck')
|
||||
javaCompileTasks << compileJava
|
||||
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.roborio)
|
||||
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm32)
|
||||
jniCrossCompileOptions << JniCrossCompileOptions(nativeUtils.wpi.platforms.linuxarm64)
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/main/native/cpp'
|
||||
if (project.hasProperty('generatedSources')) {
|
||||
srcDir generatedSources
|
||||
}
|
||||
include '**/jni/**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDir 'src/main/native/include'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
if (it instanceof StaticLibraryBinarySpec) {
|
||||
it.buildable = false
|
||||
return
|
||||
}
|
||||
if (!project.hasProperty('noWpiutil')) {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
}
|
||||
if (project.hasProperty('jniSplitSetup')) {
|
||||
jniSplitSetup(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
// By default, a development executable will be generated. This is to help the case of
|
||||
// testing specific functionality of the library.
|
||||
"${nativeName}Dev"(NativeExecutableSpec) {
|
||||
|
||||
Reference in New Issue
Block a user