From af5694bb730ededf4513ff17b69181bc72759907 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:52:25 -0500 Subject: [PATCH 1/4] Fix GPL violation --- shared/config.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/config.gradle b/shared/config.gradle index 33b6c467f7..8a1d0cd0c9 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -85,7 +85,7 @@ ext.appendDebugPathToBinaries = { binaries -> } } -def licenseFile = file("$rootDir/LICENCE") +def licenseFile = file("$rootDir/LICENSE") // Create ZIP tasks for each component. ext.createComponentZipTasks = { components, names, base, type, project, func -> From f137fbea338bf3cafe862d15d747017e388ec988 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:10:43 -0500 Subject: [PATCH 2/4] Another fix --- shared/javacpp/publish.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/javacpp/publish.gradle b/shared/javacpp/publish.gradle index d6c9468062..356e51e05f 100644 --- a/shared/javacpp/publish.gradle +++ b/shared/javacpp/publish.gradle @@ -10,7 +10,7 @@ def zipBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId 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/LICENCE") +def licenseFile = file("$rootDir/LICENSE") // Quick hack to make this name visible to photon-lib for combined ext.zipBaseName = zipBaseName From 7b0fcfb1da39bd939102643537a29af10140acf1 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Wed, 6 Nov 2024 23:19:52 -0500 Subject: [PATCH 3/4] Specify license for everything --- photon-core/build.gradle | 1 + photon-lib/build.gradle | 1 + photon-targeting/build.gradle | 1 + shared/config.gradle | 2 -- shared/javacommon.gradle | 6 ++++++ shared/javacpp/publish.gradle | 3 +-- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/photon-core/build.gradle b/photon-core/build.gradle index 5cf4a2bb45..0a481d6520 100644 --- a/photon-core/build.gradle +++ b/photon-core/build.gradle @@ -4,6 +4,7 @@ plugins { import java.nio.file.Path +ext.licenseFile = file("$rootDir/LICENSE") apply from: "${rootDir}/shared/common.gradle" wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get() diff --git a/photon-lib/build.gradle b/photon-lib/build.gradle index 5aa403c953..08a792e951 100644 --- a/photon-lib/build.gradle +++ b/photon-lib/build.gradle @@ -9,6 +9,7 @@ ext { includePhotonTargeting = true // Include the generated Version file generatedHeaders = "src/generate/native/include" + licenseFile = file("LICENSE") } apply plugin: 'cpp' diff --git a/photon-targeting/build.gradle b/photon-targeting/build.gradle index 1215c062e4..6b35a95987 100644 --- a/photon-targeting/build.gradle +++ b/photon-targeting/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'edu.wpi.first.NativeUtils' apply plugin: 'edu.wpi.first.WpilibTools' apply plugin: 'edu.wpi.first.GradleJni' +ext.licenseFile = file("$rootDir/LICENSE") apply from: "${rootDir}/shared/config.gradle" apply from: "${rootDir}/shared/javacommon.gradle" diff --git a/shared/config.gradle b/shared/config.gradle index 8a1d0cd0c9..4f984871b4 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -85,8 +85,6 @@ ext.appendDebugPathToBinaries = { binaries -> } } -def licenseFile = file("$rootDir/LICENSE") - // Create ZIP tasks for each component. ext.createComponentZipTasks = { components, names, base, type, project, func -> def stringNames = names.collect { it.toString() } diff --git a/shared/javacommon.gradle b/shared/javacommon.gradle index 0779bee112..31b3103538 100644 --- a/shared/javacommon.gradle +++ b/shared/javacommon.gradle @@ -13,6 +13,7 @@ def artifactGroupId = 'org.photonvision' def javaBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId}-java_CLS" def outputsFolder = file("$buildDir/outputs") +def licenseFile = ext.licenseFile javadoc { options { @@ -24,17 +25,20 @@ javadoc { task sourcesJar(type: Jar, dependsOn: classes) { archiveClassifier = 'sources' from sourceSets.main.allSource + from licenseFile } task javadocJar(type: Jar, dependsOn: javadoc) { archiveClassifier = 'javadoc' from javadoc.destinationDir + from licenseFile } task outputJar(type: Jar, dependsOn: classes) { archiveBaseName = javaBaseName destinationDirectory = outputsFolder from sourceSets.main.output + from licenseFile } task outputSourcesJar(type: Jar, dependsOn: classes) { @@ -42,6 +46,7 @@ task outputSourcesJar(type: Jar, dependsOn: classes) { destinationDirectory = outputsFolder archiveClassifier = 'sources' from sourceSets.main.allSource + from licenseFile } task outputJavadocJar(type: Jar, dependsOn: javadoc) { @@ -49,6 +54,7 @@ task outputJavadocJar(type: Jar, dependsOn: javadoc) { destinationDirectory = outputsFolder archiveClassifier = 'javadoc' from javadoc.destinationDir + from licenseFile } artifacts { diff --git a/shared/javacpp/publish.gradle b/shared/javacpp/publish.gradle index 356e51e05f..cbbd91ea91 100644 --- a/shared/javacpp/publish.gradle +++ b/shared/javacpp/publish.gradle @@ -10,8 +10,7 @@ def zipBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId 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") - +def licenseFile = ext.licenseFile // Quick hack to make this name visible to photon-lib for combined ext.zipBaseName = zipBaseName ext.artifactGroupId = artifactGroupId From 1a56ccf0b40775d56a0932e1cec0b759845dda1e Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Thu, 7 Nov 2024 00:05:02 -0500 Subject: [PATCH 4/4] More fixes --- photon-server/build.gradle | 4 ++++ shared/javacommon.gradle | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/photon-server/build.gradle b/photon-server/build.gradle index 80cf3a344a..fb140545fc 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -25,6 +25,10 @@ application { mainClass = 'org.photonvision.Main' } +jar { + from file("$rootDir/LICENSE") +} + shadowJar { archiveBaseName = "photonvision" archiveVersion = project.version as String diff --git a/shared/javacommon.gradle b/shared/javacommon.gradle index 31b3103538..0c8605b577 100644 --- a/shared/javacommon.gradle +++ b/shared/javacommon.gradle @@ -22,6 +22,10 @@ javadoc { } } +jar { + from licenseFile +} + task sourcesJar(type: Jar, dependsOn: classes) { archiveClassifier = 'sources' from sourceSets.main.allSource