GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #1163 from mikepenz/develop · felex13/AboutLibraries@e1947a4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • README.md
  • app-test
    • README.md
    • files
      • aboutlibraries.json
  • gradle.properties
  • plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin
    • mapping
      • License.kt
      • SpdxLicense.kt
    • util
      • DependencyCollector.kt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This library collects dependency details, including licenses at compile time, an
4242
## Latest releases 🛠
4343

4444
- Compose UI updates | Gradle Plugin refresh | [v12.0.1](https://github.com/mikepenz/AboutLibraries/tree/12.0.1)
45-
- Compose 1.8.x | Plugin refactor | [v12.1.0](https://github.com/mikepenz/AboutLibraries/tree/12.1.0)
45+
- Compose 1.8.x | Plugin refactor | [v12.1.1](https://github.com/mikepenz/AboutLibraries/tree/12.1.1)
4646

4747
## Gradle Plugin
4848

Collapse file

‎app-test/README.md‎

Copy file name to clipboardExpand all lines: app-test/README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
### Generate Dependency Information
44

55
```bash
6-
./gradlew :app-test:exportLibraryDefinitions -PaboutLibraries.exportPath=files/
6+
./gradlew :app-test:exportLibraryDefinitions
77
```
Collapse file

‎app-test/files/aboutlibraries.json‎

Copy file name to clipboardExpand all lines: app-test/files/aboutlibraries.json
+3-4Lines changed: 3 additions & 4 deletions
Large diffs are not rendered by default.
Collapse file

‎gradle.properties‎

Copy file name to clipboardExpand all lines: gradle.properties
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GROUP=com.mikepenz
22

3-
VERSION_NAME=12.1.0
4-
VERSION_CODE=120100
3+
VERSION_NAME=12.1.1
4+
VERSION_CODE=120101
55

66
POM_URL=https://github.com/mikepenz/AboutLibraries
77
POM_SCM_URL=https://github.com/mikepenz/AboutLibraries
Collapse file

‎plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/mapping/License.kt‎

Copy file name to clipboardExpand all lines: plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/mapping/License.kt
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ data class License(
2525
} else {
2626
field
2727
}
28+
set(value) {
29+
// do not set `NOASSERTION` as spdxId
30+
if (value != "NOASSERTION") {
31+
field = value
32+
}
33+
}
2834

2935
override fun equals(other: Any?): Boolean {
3036
if (this === other) return true
@@ -51,7 +57,7 @@ data class License(
5157
* Ensures and applies fixes to the library names (shorten, ...)
5258
*/
5359
private fun resolveLicenseId(name: String, url: String?): String? {
54-
for (l: SpdxLicense in SpdxLicense.values()) {
60+
for (l: SpdxLicense in SpdxLicense.entries) {
5561
val matcher = l.customMatcher
5662
if (l.id.equals(name, true) || l.name.equals(name, true) || l.fullName.equals(name, true) || (matcher != null && matcher.invoke(name, url))) {
5763
return l.id
Collapse file

‎plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/mapping/SpdxLicense.kt‎

Copy file name to clipboardExpand all lines: plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/mapping/SpdxLicense.kt
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ enum class SpdxLicense(
151151
EPL_1_0("Eclipse Public License 1.0", "EPL-1.0"),
152152
EPL_2_0("Eclipse Public License 2.0", "EPL-2.0", "epl_2_0", customMatcher = { _, url ->
153153
url == "https://www.eclipse.org/legal/epl-v20.html"
154+
|| url == "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt"
154155
}),
155156
ErlPL_1_1("Erlang Public License v1.1", "ErlPL-1.1"),
156157
etalab_2_0("Etalab Open License 2.0", "etalab-2.0"),
@@ -392,19 +393,19 @@ enum class SpdxLicense(
392393

393394
// Special handling section
394395
Apache_2_0("Apache License 2.0", "Apache-2.0", customMatcher = { name, url ->
395-
name.contains("Apache", true) || url?.endsWith("LICENSE-2.0.txt") == true
396+
name.contains("Apache", true)
397+
|| url?.endsWith("LICENSE-2.0.txt") == true
396398
}),
397399
BSD_2_Clause("BSD 2-Clause \"Simplified\" License", "BSD-2-Clause", customMatcher = { name, url ->
398400
name.equals("BSD 2-Clause License", true)
399401
|| url?.endsWith("opensource.org/licenses/BSD-2-Clause", true) == true
400402
|| url?.endsWith("opensource.org/licenses/bsd-license", true) == true
401403
}),
402404
BSD_3_Clause("BSD 3-Clause \"New\" or \"Revised\" License", "BSD-3-Clause", customMatcher = { name, url ->
403-
name.equals("New BSD License", true) || name.equals("Modified BSD License", true) || name.equals(
404-
"BSD 3-clause",
405-
true
406-
) ||
407-
url?.endsWith("opensource.org/licenses/BSD-3-Clause", true) == true
405+
name.equals("New BSD License", true)
406+
|| name.equals("Modified BSD License", true)
407+
|| name.equals("BSD 3-clause", true)
408+
|| url?.endsWith("opensource.org/licenses/BSD-3-Clause", true) == true
408409
}),
409410
MIT("MIT License", "MIT", customMatcher = { name, _ ->
410411
name.contains("MIT", true)
@@ -426,7 +427,10 @@ enum class SpdxLicense(
426427
GPL_2_0_CPE(
427428
"GNU General Public License, version 2, with the Classpath Exception",
428429
"GPL-2.0-CPE",
429-
customUrl = "https://openjdk.org/legal/gplv2+ce.html"
430+
customUrl = "https://openjdk.org/legal/gplv2+ce.html",
431+
customMatcher = { name, url ->
432+
url?.equals("https://www.gnu.org/software/classpath/license.html") == true
433+
}
430434
);
431435

432436
fun getUrl(): String = customUrl ?: "https://spdx.org/licenses/$id.html"
Collapse file

‎plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/DependencyCollector.kt‎

Copy file name to clipboardExpand all lines: plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/DependencyCollector.kt
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,12 @@ internal class DependencyCollector(
208208
if (artifactVersion.isNullOrBlank()) LOGGER.info("----> Failed to identify version for: $uniqueId")
209209
val libraryWebsite = chooseStringValue(pom, parentRawModel) { it.url }
210210

211-
val licenses = combineValues(pom, parentRawModel) { it.licenses }.map { License(it.name, it.url) }.toHashSet()
211+
val licenses = chooseValue(pom, parentRawModel) { it.licenses }?.map {
212+
if (it.name == null) LOGGER.info("----> License name was null url: ${it.url} for: $uniqueId")
213+
License(it.name ?: "", it.url)
214+
}?.toHashSet() ?: emptySet()
212215
val scm = chooseValue(pom, parentRawModel) { it.scm }?.let { Scm(it.connection, it.developerConnection, it.url) }
213-
val developers = combineValues(pom, parentRawModel) { it.developers }.map { Developer(it.name, it.organizationUrl) }.toHashSet().toList()
216+
val developers = chooseValue(pom, parentRawModel) { it.developers }?.map { Developer(it.name, it.organizationUrl) }?.toHashSet()?.toList() ?: emptyList()
214217
val organization = chooseValue(pom, parentRawModel) { it.organization }?.let { Organization(it.name, it.url) }
215218
return DependencyData(
216219
dependencyCoordinates = coordinates,
@@ -233,13 +236,6 @@ internal class DependencyCollector(
233236

234237
private fun <T> chooseValue(pom: Model, parentRawModel: List<Model>, block: (Model) -> T?): T? = pom.let(block) ?: parentRawModel.firstOrNull()?.let(block)
235238

236-
private fun <T> combineValues(pom: Model, parentRawModel: List<Model>, block: (Model) -> List<T>): List<T> {
237-
val combined = mutableListOf<T>()
238-
pom.let(block).also { combined.addAll(it) }
239-
parentRawModel.onEach { block(it).also { value -> combined.addAll(value) } }
240-
return combined
241-
}
242-
243239
/**
244240
* Fetches the pom files for all [ResolvedVariantResult]s.
245241
*

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.