Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove -jni artifacts #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading