|
19 | 19 |
|
20 | 20 | import com.github.jk1.license.ProjectData |
21 | 21 | import com.github.jk1.license.render.ReportRenderer |
| 22 | +import com.github.jk1.license.render.LicenseDataCollector |
22 | 23 | import java.io.FileWriter |
23 | 24 |
|
24 | 25 | plugins { |
25 | 26 | java |
26 | 27 | `java-library` |
27 | 28 | checkstyle |
28 | 29 | `maven-publish` |
29 | | - id("com.github.jk1.dependency-license-report") version "1.19" |
30 | | - id("de.thetaphi.forbiddenapis") version "3.3" |
| 30 | + id("com.github.jk1.dependency-license-report") version "2.1" |
| 31 | + id("de.thetaphi.forbiddenapis") version "3.4" |
31 | 32 | } |
32 | 33 |
|
33 | 34 | java { |
@@ -179,7 +180,7 @@ publishing { |
179 | 180 | dependencies { |
180 | 181 | // Compile and test with the last 7.x version to make sure transition scenarios where |
181 | 182 | // the Java API client coexists with a 7.x HLRC work fine |
182 | | - val elasticsearchVersion = "7.17.4" |
| 183 | + val elasticsearchVersion = "7.17.7" |
183 | 184 | val jacksonVersion = "2.13.3" |
184 | 185 |
|
185 | 186 | // Apache 2.0 |
@@ -265,21 +266,31 @@ class SpdxReporter(val dest: File) : ReportRenderer { |
265 | 266 | FileWriter(dest).use { out -> |
266 | 267 | out.append("name,url,version,revision,license\n") |
267 | 268 | data?.allDependencies?.forEach { dep -> |
268 | | - val info = com.github.jk1.license.render.LicenseDataCollector.multiModuleLicenseInfo(dep) |
269 | 269 |
|
270 | 270 | val depVersion = dep.version |
271 | 271 | val depName = dep.group + ":" + dep.name |
272 | | - val depUrl = info.moduleUrls.first() |
273 | 272 |
|
274 | | - val licenseIds = info.licenses.mapNotNull { license -> |
275 | | - license.name?.let { |
276 | | - checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" } |
277 | | - } |
278 | | - }.toSet() |
| 273 | + //-------------- |
| 274 | + // FIXME: restore section below once 2.2 is released |
| 275 | + // See https://github.com/jk1/Gradle-License-Report/issues/251 |
| 276 | + val (depUrl, licenseId, licenseUrl) = LicenseDataCollector.singleModuleLicenseInfo(dep) |
| 277 | + checkNotNull(spdxIds[licenseId]) { "No SPDX identifier for $licenseId" } |
| 278 | + |
| 279 | + //-------------- |
| 280 | + // val info = LicenseDataCollector.multiModuleLicenseInfo(dep) |
| 281 | + // val depUrl = info.moduleUrls.first() |
| 282 | + // |
| 283 | + // val licenseIds = info.licenses.mapNotNull { license -> |
| 284 | + // license.name?.let { |
| 285 | + // checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" } |
| 286 | + // } |
| 287 | + // }.toSet() |
| 288 | + // |
| 289 | + // // Combine multiple licenses. |
| 290 | + // // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions |
| 291 | + // val licenseId = licenseIds.joinToString(" OR ") |
| 292 | + //-------------- |
279 | 293 |
|
280 | | - // Combine multiple licenses. |
281 | | - // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions |
282 | | - val licenseId = licenseIds.joinToString(" OR ") |
283 | 294 | out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n") |
284 | 295 | } |
285 | 296 | } |
|
0 commit comments