You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classSpdxReporter(valdest:File) : ReportRenderer {
// License names to their SPDX identifierval spdxIds =mapOf(
"Apache License, Version 2.0" to "Apache-2.0",
"The Apache Software License, Version 2.0" to "Apache-2.0",
"BSD Zero Clause License" to "0BSD",
"Eclipse Public License 2.0" to "EPL-2.0",
"Eclipse Public License v. 2.0" to "EPL-2.0",
"GNU General Public License, version 2 with the GNU Classpath Exception" to "GPL-2.0 WITH Classpath-exception-2.0",
"COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" to "CDDL-1.0"
)
privatefunquote(str:String) : String {
returnif (str.contains(',') || str.contains("\"")) {
"\""+ str.replace("\"", "\"\"") +"\""
} else {
str
}
}
overridefunrender(data:ProjectData?) {
dest.parentFile.mkdirs()
FileWriter(dest).use { out->out.append("name,url,version,revision,license\n")
data?.allDependencies?.forEach { dep ->val info = com.github.jk1.license.render.LicenseDataCollector.multiModuleLicenseInfo(dep)
val depVersion = dep.version
val depName = dep.group +":"+ dep.name
val depUrl = info.moduleUrls.first()
val licenseIds = info.licenses.mapNotNull { license ->
license.name?.let {
checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" }
}
}.toSet()
// Combine multiple licenses.// See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressionsval licenseId = licenseIds.joinToString(" OR ")
out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n")
}
}
}
}
It works fine with version 1.+, but I have problem when try to upgrade plugin to last version:
Problem with fields moduleUrls and licenses. Gradle tell me that I haven't access :
e: D:\Work\contrib\java-client\build.gradle.kts:263:35: Cannot access 'moduleUrls': it is public in '<anonymous>'
e: D:\Work\contrib\java-client\build.gradle.kts:265:39: Cannot access 'licenses': it is public in '<anonymous>'
The text was updated successfully, but these errors were encountered:
altro3
changed the title
[bug] Problem with dependency-license-report 2.1
[bug] Problem with MultiLicenseInfo fields access in dependency-license-report 2.1
May 8, 2022
I tried to use my custom Reporter:
It works fine with version 1.+, but I have problem when try to upgrade plugin to last version:
Problem with fields
moduleUrls
andlicenses
. Gradle tell me that I haven't access :The text was updated successfully, but these errors were encountered: