Skip to content

Commit 04ec99f

Browse files
authored
Add license to jars (#1530)
Fixes GPL violation, the license has been missing since 2024. This also puts licenses in as many JARs and native library archives as possible (for good measure.)
1 parent 150561a commit 04ec99f

File tree

7 files changed

+18
-4
lines changed

7 files changed

+18
-4
lines changed

photon-core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44

55
import java.nio.file.Path
66

7+
ext.licenseFile = file("$rootDir/LICENSE")
78
apply from: "${rootDir}/shared/common.gradle"
89

910
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()

photon-lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ext {
99
includePhotonTargeting = true
1010
// Include the generated Version file
1111
generatedHeaders = "src/generate/native/include"
12+
licenseFile = file("LICENSE")
1213
}
1314

1415
apply plugin: 'cpp'

photon-server/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ application {
2525
mainClass = 'org.photonvision.Main'
2626
}
2727

28+
jar {
29+
from file("$rootDir/LICENSE")
30+
}
31+
2832
shadowJar {
2933
archiveBaseName = "photonvision"
3034
archiveVersion = project.version as String

photon-targeting/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ apply plugin: 'edu.wpi.first.NativeUtils'
88
apply plugin: 'edu.wpi.first.WpilibTools'
99
apply plugin: 'edu.wpi.first.GradleJni'
1010

11+
ext.licenseFile = file("$rootDir/LICENSE")
1112
apply from: "${rootDir}/shared/config.gradle"
1213
apply from: "${rootDir}/shared/javacommon.gradle"
1314

shared/config.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ ext.appendDebugPathToBinaries = { binaries ->
8585
}
8686
}
8787

88-
def licenseFile = file("$rootDir/LICENCE")
89-
9088
// Create ZIP tasks for each component.
9189
ext.createComponentZipTasks = { components, names, base, type, project, func ->
9290
def stringNames = names.collect { it.toString() }

shared/javacommon.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def artifactGroupId = 'org.photonvision'
1313
def javaBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId}-java_CLS"
1414

1515
def outputsFolder = file("$buildDir/outputs")
16+
def licenseFile = ext.licenseFile
1617

1718
javadoc {
1819
options {
@@ -21,34 +22,43 @@ javadoc {
2122
}
2223
}
2324

25+
jar {
26+
from licenseFile
27+
}
28+
2429
task sourcesJar(type: Jar, dependsOn: classes) {
2530
archiveClassifier = 'sources'
2631
from sourceSets.main.allSource
32+
from licenseFile
2733
}
2834

2935
task javadocJar(type: Jar, dependsOn: javadoc) {
3036
archiveClassifier = 'javadoc'
3137
from javadoc.destinationDir
38+
from licenseFile
3239
}
3340

3441
task outputJar(type: Jar, dependsOn: classes) {
3542
archiveBaseName = javaBaseName
3643
destinationDirectory = outputsFolder
3744
from sourceSets.main.output
45+
from licenseFile
3846
}
3947

4048
task outputSourcesJar(type: Jar, dependsOn: classes) {
4149
archiveBaseName = javaBaseName
4250
destinationDirectory = outputsFolder
4351
archiveClassifier = 'sources'
4452
from sourceSets.main.allSource
53+
from licenseFile
4554
}
4655

4756
task outputJavadocJar(type: Jar, dependsOn: javadoc) {
4857
archiveBaseName = javaBaseName
4958
destinationDirectory = outputsFolder
5059
archiveClassifier = 'javadoc'
5160
from javadoc.destinationDir
61+
from licenseFile
5262
}
5363

5464
artifacts {

shared/javacpp/publish.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def zipBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId
1010
def jniBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-jni_CLS"
1111
def jniCvStaticBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-jnicvstatic_CLS"
1212

13-
def licenseFile = file("$rootDir/LICENCE")
14-
13+
def licenseFile = ext.licenseFile
1514
// Quick hack to make this name visible to photon-lib for combined
1615
ext.zipBaseName = zipBaseName
1716
ext.artifactGroupId = artifactGroupId

0 commit comments

Comments
 (0)