Skip to content

Commit

Permalink
Remove -jni artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Dec 22, 2024
1 parent 8a1e1ca commit 735dbb8
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def outputsFolder = file("$project.buildDir/outputs")
def baseArtifactId = 'opencv'
def artifactGroupId = 'edu.wpi.first.thirdparty.frc2025.opencv'
def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_frc2025_opencv_ID_opencv-cpp_CLS'
def jniBaseName = "_GROUP_edu_wpi_first_thirdparty_frc2025_opencv_ID_opencv-jni_CLS"
def javaBaseName = "_GROUP_edu_wpi_first_thirdparty_frc2025_opencv_ID_opencv-java_CLS"

def versionFile = file("$outputsFolder/version.txt")
Expand Down Expand Up @@ -255,64 +254,6 @@ task cppHeadersZip(type: Zip, dependsOn: make) {
}
}
}

project.tasks.create('jniJar' + buildType, Jar) {
dependsOn tasks.named('make' + buildType)
dependsOn tasks.named('nativeLibLinks' + buildType)
destinationDirectory = outputsFolder
archiveClassifier = outputClassifier
archiveBaseName = jniBaseName
duplicatesStrategy = 'exclude'

manifest {
attributes(
"Created-By": "WPILib Gradle Build Script",
"Implementation-Title": "OpenCV JNI Library, ${project.ext.platformClassifier}",
"Implementation-Version": pubVersion,
"Implementation-Vendor": "Itseez",

"Bundle-Name": "${archiveBaseName.get()}",
"Bundle-Version": pubVersion,
"Bundle-License": "https://opensource.org/licenses/BSD-3-Clause",
"Bundle-Vendor": "WPILib")
}

from(licenseFile) {
into '/'
}

def directory
def jniFileName
def jniFile

if (project.platform.startsWith("linux")) {
directory = staticBuildDir.resolve("lib").toFile()
jniFileName = "libopencv_java${libVersion}.so"
jniFile = new File(directory.absolutePath, "${jniFileName}")
} else if (project.platform.startsWith("osx")) {
directory = staticBuildDir.resolve("lib").resolve(buildTypeFolder).toFile()
System.out.println(directory.absolutePath)
jniFileName = "libopencv_java${libVersion}.dylib"
jniFile = new File(directory.absolutePath, "${jniFileName}")
} else {
directory = staticBuildDir.resolve("lib").resolve(buildTypeFolder).toFile()
jniFileName = "opencv_java${libVersion}.dll"
jniFile = new File(directory.absolutePath, "${jniFileName}")
}

def hashFile = new File(directory.absolutePath, "opencv_java${libVersion}.hash")
it.outputs.file(hashFile)
it.from(hashFile) {
into project.platformPath
}
it.doFirst {
hashFile.text = MessageDigest.getInstance("MD5").digest(jniFile.bytes).encodeHex().toString()
}
it.from(jniFile) {
into project.platformPath
}
}

}

task outputJar(type: Jar, dependsOn: make) {
Expand Down Expand Up @@ -362,21 +303,17 @@ task sourcesJar(type: Jar, dependsOn: make) {


if (!project.hasProperty('skipRelease')) {
build.dependsOn jniJar
build.dependsOn cppLibsZip
build.dependsOn cppLibsZipStatic
addTaskToCopyAllOutputs(cppLibsZip)
addTaskToCopyAllOutputs(jniJar)
addTaskToCopyAllOutputs(cppLibsZipStatic)
}

if (!project.hasProperty('skipDebug')) {
build.dependsOn cppLibsZipDebug
build.dependsOn cppLibsZipStaticDebug
build.dependsOn jniJarDebug

addTaskToCopyAllOutputs(cppLibsZipDebug)
addTaskToCopyAllOutputs(jniJarDebug)
addTaskToCopyAllOutputs(cppLibsZipStaticDebug)
}

Expand All @@ -396,11 +333,9 @@ if (!project.hasProperty('jenkinsBuild')) {
archives cppHeadersZip
archives cppSourcesZip
archives cppLibsZip
archives jniJar
archives cppLibsZipDebug
archives cppLibsZipStatic
archives cppLibsZipStaticDebug
archives jniJarDebug
archives outputJar
archives sourcesJar
}
Expand All @@ -418,14 +353,6 @@ model {
groupId artifactGroupId
version pubVersion
}
jni(MavenPublication) {
artifact jniJar
artifact jniJarDebug

artifactId = "${baseArtifactId}-jni"
groupId artifactGroupId
version pubVersion
}
cpp(MavenPublication) {
artifact cppHeadersZip
artifact cppSourcesZip
Expand Down

0 comments on commit 735dbb8

Please sign in to comment.