mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.68k stars 423 forks source link

Missing content field for additional license #1034

Closed ElliotAl86 closed 4 days ago

ElliotAl86 commented 1 week ago

About this issue

Hello, thanks for the library! I am trying to download the text of additional licenses, but as a result, for GPL-3.0-or-later, although the entry is added, the content field is missing. At the same time, MPL-2.0 was added with the content field. What could be the problem?

// Full license text for license IDs mentioned here will be included, even if no detected dependency uses them.
additionalLicenses = arrayOf("GPL-3.0-or-later", "mpl_2_0")
"GPL-3.0-or-later": {
    "hash": "d6d1d3fa25a56a7ce6f3c6fb85719ac4",
    "url": "https://spdx.org/licenses/GPL-3.0-or-later.html",
    "spdxId": "GPL-3.0-or-later",
    "name": "GNU General Public License v3.0 or later"
},
"MPL-2.0": {
    "content": "here is the full text of the license, everything is fine",
    "hash": "da270a7a9b6a2d7eb8593af70f40651b",
    "url": "https://spdx.org/licenses/MPL-2.0.html",
    "spdxId": "MPL-2.0",
    "name": "Mozilla Public License 2.0"
},
mikepenz commented 1 week ago

Good day @ElliotAl86 do you see any info logs or similar indicating a problem loading the license?

ElliotAl86 commented 1 week ago

I use this line ./gradlew app:exportLibraryDefinitions -PexportPath=app/src/main/res/raw and the .json is generated as expected without any additional logs.

Once I've got GitHub rate_limit exhausted. Won't be able to use the GitHub API. ... but after adding a token - no logs.

mikepenz commented 1 week ago

Can you maybe re-run with debug level logs. Would be great to see if these logs show up:

https://github.com/mikepenz/AboutLibraries/blob/develop/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/LicenseUtil.kt#L43-L48

ElliotAl86 commented 1 week ago

./gradlew app:exportLibraryDefinitions -d > debug.log 2>&1 -PexportPath=app/src/main/res/raw I got a log file with 120k lines, but I couldn't find any line with did not match any known SpdxLicense or Could not load the license content, as well as any mentions of GPL-3.0-or-later or MPL-2.0.

mikepenz commented 4 days ago

So I dove more into it. the problem is that the txt based license file for GPL-3-0-or-later is no longer available: https://spdx.org/licenses/GPL-3.0-or-later.txt

The normal GPL-3.0 has a txt form: https://spdx.org/licenses/GPL-3.0.txt

also GitHub only has GPL-3.0, not 3.0 or later:

ElliotAl86 commented 4 days ago

If I understand it right, the GPL-3.0 license text is used for both GPL-3.0 only and GPL-3.0 or later, the clarification is made at the place of use. Now I tried additionalLicenses = arrayOf("GPL-3.0") and entry was not added to json. With GPL-3.0-only it works, but as for GPL-3.0-or-later the license text is missing. How can I load the GPL-3.0 license text? I can download it manually and add it, but it seems like it should work with additionalLicenses as well.

mikepenz commented 4 days ago

After some more digging, I found a useable mirror in txt format of the licenses: https://github.com/spdx/license-list-data/tree/main/text

Will look into using that one

mikepenz commented 4 days ago

Will release v11.3.0-rc01 which will fallback to the files from github

ElliotAl86 commented 4 days ago

v11.3.0-rc01 fixes the issue! Thanks for support!