|
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 { |
@@ -88,6 +89,7 @@ tasks.withType<Javadoc> { |
88 | 89 | // Gradle calls javadoc with a list of file and not a path. This prevents doc-files from being copied. |
89 | 90 | opt.addStringOption("sourcepath", project.projectDir.path + "/src/main/java") |
90 | 91 | opt.docFilesSubDirs(true) |
| 92 | + opt.addBooleanOption("Xdoclint:-missing", true) |
91 | 93 |
|
92 | 94 | doLast { |
93 | 95 | // Javadoc adds its decoration to html doc files, including quite some JS. This slows down the api spec |
@@ -175,7 +177,7 @@ publishing { |
175 | 177 | dependencies { |
176 | 178 | // Compile and test with the last 7.x version to make sure transition scenarios where |
177 | 179 | // the Java API client coexists with a 7.x HLRC work fine |
178 | | - val elasticsearchVersion = "7.17.4" |
| 180 | + val elasticsearchVersion = "7.17.7" |
179 | 181 | val jacksonVersion = "2.13.3" |
180 | 182 |
|
181 | 183 | // Apache 2.0 |
@@ -261,21 +263,31 @@ class SpdxReporter(val dest: File) : ReportRenderer { |
261 | 263 | FileWriter(dest).use { out -> |
262 | 264 | out.append("name,url,version,revision,license\n") |
263 | 265 | data?.allDependencies?.forEach { dep -> |
264 | | - val info = com.github.jk1.license.render.LicenseDataCollector.multiModuleLicenseInfo(dep) |
265 | 266 |
|
266 | 267 | val depVersion = dep.version |
267 | 268 | val depName = dep.group + ":" + dep.name |
268 | | - val depUrl = info.moduleUrls.first() |
269 | 269 |
|
270 | | - val licenseIds = info.licenses.mapNotNull { license -> |
271 | | - license.name?.let { |
272 | | - checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" } |
273 | | - } |
274 | | - }.toSet() |
| 270 | + //-------------- |
| 271 | + // FIXME: restore section below once 2.2 is released |
| 272 | + // See https://github.com/jk1/Gradle-License-Report/issues/251 |
| 273 | + val (depUrl, licenseId, licenseUrl) = LicenseDataCollector.singleModuleLicenseInfo(dep) |
| 274 | + checkNotNull(spdxIds[licenseId]) { "No SPDX identifier for $licenseId" } |
| 275 | + |
| 276 | + //-------------- |
| 277 | + // val info = LicenseDataCollector.multiModuleLicenseInfo(dep) |
| 278 | + // val depUrl = info.moduleUrls.first() |
| 279 | + // |
| 280 | + // val licenseIds = info.licenses.mapNotNull { license -> |
| 281 | + // license.name?.let { |
| 282 | + // checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" } |
| 283 | + // } |
| 284 | + // }.toSet() |
| 285 | + // |
| 286 | + // // Combine multiple licenses. |
| 287 | + // // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions |
| 288 | + // val licenseId = licenseIds.joinToString(" OR ") |
| 289 | + //-------------- |
275 | 290 |
|
276 | | - // Combine multiple licenses. |
277 | | - // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions |
278 | | - val licenseId = licenseIds.joinToString(" OR ") |
279 | 291 | out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n") |
280 | 292 | } |
281 | 293 | } |
|
0 commit comments