From 3b32e9316447714da805172de48f1e86f37d7d20 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Sun, 20 Apr 2025 03:20:31 -0400 Subject: [PATCH 1/2] Clean up Gradle files --- photon-docs/build.gradle | 25 ++----------------------- shared/common.gradle | 34 ---------------------------------- shared/config.gradle | 26 -------------------------- 3 files changed, 2 insertions(+), 83 deletions(-) diff --git a/photon-docs/build.gradle b/photon-docs/build.gradle index e99e6c6975..ff46e79e82 100644 --- a/photon-docs/build.gradle +++ b/photon-docs/build.gradle @@ -132,29 +132,8 @@ task generateJavaDocs(type: Javadoc) { title = "PhotonVision $pubVersion" ext.entryPoint = "$destinationDir/index.html" - if (JavaVersion.current().isJava8Compatible() && project.hasProperty('docWarningsAsErrors')) { - // Treat javadoc warnings as errors. - // - // The second argument '-quiet' is a hack. The one parameter - // addStringOption() doesn't work, so we add '-quiet', which is added - // anyway by gradle. See https://github.com/gradle/gradle/issues/2354. - // - // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) - // for information about the nonstandard -Xwerror option. JDK 15+ has - // -Werror. - options.addStringOption('Xwerror', '-quiet') - } - - if (JavaVersion.current().isJava11Compatible()) { - if (!JavaVersion.current().isJava12Compatible()) { - options.addBooleanOption('-no-module-directories', true) - } - doLast { - // This is a work-around for https://bugs.openjdk.java.net/browse/JDK-8211194. Can be removed once that issue is fixed on JDK's side - // Since JDK 11, package-list is missing from javadoc output files and superseded by element-list file, but a lot of external tools still need it - // Here we generate this file manually - new File(destinationDir, 'package-list').text = new File(destinationDir, 'element-list').text - } + if (project.hasProperty('docWarningsAsErrors')) { + options.addBooleanOption('Werror', true) } } diff --git a/shared/common.gradle b/shared/common.gradle index 6a0cf794ca..9f3386c2c3 100644 --- a/shared/common.gradle +++ b/shared/common.gradle @@ -68,40 +68,6 @@ tasks.register('testHeadless', Test) { workingDir = "../" } -tasks.register('generateJavaDocs', Javadoc) { - source = sourceSets.main.allJava - classpath = sourceSets.main.compileClasspath - destinationDir = file("${projectDir}/build/docs") - - options.addBooleanOption("Xdoclint:html,missing,reference,syntax", true) - options.addBooleanOption('html5', true) - - if (JavaVersion.current().isJava8Compatible() && project.hasProperty('docWarningsAsErrors')) { - // Treat javadoc warnings as errors. - // - // The second argument '-quiet' is a hack. The one parameter - // addStringOption() doesn't work, so we add '-quiet', which is added - // anyway by gradle. See https://github.com/gradle/gradle/issues/2354. - // - // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) - // for information about the nonstandard -Xwerror option. JDK 15+ has - // -Werror. - options.addStringOption('Xwerror', '-quiet') - } - - if (JavaVersion.current().isJava11Compatible()) { - if (!JavaVersion.current().isJava12Compatible()) { - options.addBooleanOption('-no-module-directories', true) - } - doLast { - // This is a work-around for https://bugs.openjdk.java.net/browse/JDK-8211194. Can be removed once that issue is fixed on JDK's side - // Since JDK 11, package-list is missing from javadoc output files and superseded by element-list file, but a lot of external tools still need it - // Here we generate this file manually - new File(destinationDir, 'package-list').text = new File(destinationDir, 'element-list').text - } - } -} - jacoco { toolVersion = "0.8.10" reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir') diff --git a/shared/config.gradle b/shared/config.gradle index 1178f83721..307aa9712a 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -135,32 +135,6 @@ ext.createComponentZipTasks = { components, names, base, type, project, func -> return taskList } -ext.createAllCombined = { list, name, base, type, project -> - def outputsFolder = file("$project.buildDir/outputs") - - def task = project.tasks.create(base + "-all", type) { - description = "Creates component archive for all classifiers" - destinationDirectory = outputsFolder - classifier = "all" - archiveBaseName = base - duplicatesStrategy = 'exclude' - - list.each { - if (it.name.endsWith('debug')) return - from project.zipTree(it.archiveFile) - dependsOn it - } - } - - project.build.dependsOn task - - project.artifacts { - task - } - - return task -} - // Create the standard ZIP format for the dependencies. ext.includeStandardZipFormat = { task, value -> value.each { binary -> From 1cc060cd85bc32e52c980547e9ce524841c85b08 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Sun, 20 Apr 2025 03:28:03 -0400 Subject: [PATCH 2/2] Remove jogamp dependency --- build.gradle | 1 - photon-core/build.gradle | 6 ------ 2 files changed, 7 deletions(-) diff --git a/build.gradle b/build.gradle index 90ac4a7b00..3ec1fd50b9 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,6 @@ ext { wpimathVersion = wpilibVersion openCVYear = "2025" openCVversion = "4.10.0-3" - joglVersion = "2.4.0" javalinVersion = "5.6.2" libcameraDriverVersion = "v2025.0.3" rknnVersion = "dev-v2025.0.0-1-g33b6263" diff --git a/photon-core/build.gradle b/photon-core/build.gradle index 0f94fbec59..7faefdc9a0 100644 --- a/photon-core/build.gradle +++ b/photon-core/build.gradle @@ -26,12 +26,6 @@ nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal") nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + openCVYear, wpi.versions.opencvVersion.get()) dependencies { - // JOGL stuff (currently we only distribute for aarch64, which is Pi 4) - implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion" - implementation "org.jogamp.jogl:jogl-all:$joglVersion" - implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion:natives-linux-aarch64" - implementation "org.jogamp.jogl:jogl-all:$joglVersion:natives-linux-aarch64" - // Zip implementation 'org.zeroturnaround:zt-zip:1.14'