Add external licenses to jar (#2369)

This commit is contained in:
Jade
2026-02-25 16:31:14 +08:00
committed by GitHub
parent 77bf5bd1e3
commit 70ea61c1cb
17 changed files with 2129 additions and 3 deletions

View File

@@ -19,6 +19,8 @@ nativeUtils.wpi.addWarningsAsErrors()
nativeUtils.setSinglePrintPerPlatform()
def externalLicensesFolder = file("$rootDir/ExternalLicenses")
// Enable builds for all platforms.
model {
components {
@@ -121,6 +123,10 @@ ext.createComponentZipTasks = { components, names, base, type, project, func ->
into '/'
}
from(externalLicensesFolder) {
into '/'
}
func(it, value)
}
taskList.add(task)

View File

@@ -14,6 +14,7 @@ def javaBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactI
def outputsFolder = file("$buildDir/outputs")
def licenseFile = ext.licenseFile
def externalLicensesFolder = file("$rootDir/ExternalLicenses")
javadoc {
options {
@@ -24,18 +25,21 @@ javadoc {
jar {
from licenseFile
from externalLicensesFolder
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
from licenseFile
from externalLicensesFolder
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
from licenseFile
from externalLicensesFolder
}
task outputJar(type: Jar, dependsOn: classes) {
@@ -43,6 +47,7 @@ task outputJar(type: Jar, dependsOn: classes) {
destinationDirectory = outputsFolder
from sourceSets.main.output
from licenseFile
from externalLicensesFolder
}
task outputSourcesJar(type: Jar, dependsOn: classes) {
@@ -51,6 +56,7 @@ task outputSourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
from licenseFile
from externalLicensesFolder
}
task outputJavadocJar(type: Jar, dependsOn: javadoc) {
@@ -59,6 +65,7 @@ task outputJavadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
from licenseFile
from externalLicensesFolder
}
artifacts {

View File

@@ -8,6 +8,7 @@ def artifactGroupId = 'org.photonvision'
def zipBaseName = "_GROUP_org_photonvision_${baseArtifactId}_ID_${baseArtifactId}-cpp_CLS"
def licenseFile = ext.licenseFile
// Quick hack to make this name visible to photon-lib for combined
ext.zipBaseName = zipBaseName
ext.artifactGroupId = artifactGroupId