diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f0c40d47..95e88623 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,3 +34,5 @@ jobs: run: ./gradlew test${{ matrix.buildvariant }}DebugUnitTest --no-daemon - name: Run Android Lint run: ./gradlew lint${{ matrix.buildvariant }}Debug --no-daemon + - name: Check licenses + run: ./gradlew exportLibraryDefinitions --no-daemon diff --git a/.gitignore b/.gitignore index a98f0bde..194955ff 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ apikeys.xml /app/**/*.apk /_img/connectors/*.ai api-7125266970515251116-798419-8e2dda660c80.json -output-metadata.json \ No newline at end of file +output-metadata.json +licenses_*.csv \ No newline at end of file diff --git a/_tools/export_licenses_faurecia.py b/_tools/export_licenses_faurecia.py new file mode 100644 index 00000000..ea1e0d01 --- /dev/null +++ b/_tools/export_licenses_faurecia.py @@ -0,0 +1,23 @@ +import subprocess +import json + +build_types = ["fossNormalRelease", "fossAutomotiveRelease"] + +for build_type in build_types: + result = subprocess.run(["gradlew.bat", f"generateLibraryDefinitions{build_type.capitalize()}"], + capture_output=True) + + data = json.load( + open(f"app/build/generated/aboutLibraries/{build_type}/res/raw/aboutlibraries.json")) + + with open(f"licenses_{build_type}.csv", "w") as f: + f.write("component_name;license_title;license_url;public_repository;copyrights\n") + for lib in data["libraries"]: + license = data["licenses"][lib["licenses"][0]] if len(lib["licenses"]) > 0 else None + license_name = license["name"] if license is not None else " " + license_url = license["url"] if license is not None else " " + copyrights = ", ".join([dev["name"] for dev in lib["developers"] if "name" in dev]) + if copyrights == "": + copyrights = " " + repo_url = lib['scm']['url'] if 'scm' in lib else '' + f.write(f"{lib['name']};{license_name};{license_url};\"{copyrights}\";{repo_url}\n") diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 05993eac..0570700c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -250,10 +250,14 @@ configurations { aboutLibraries { allowedLicenses = arrayOf( - "Apache-2.0", "mit", "BSD-2-Clause", + "Apache-2.0", "mit", "BSD-2-Clause", "BSD-3-Clause", "EPL-1.0", "asdkl", // Android SDK "Dual OpenSSL and SSLeay License", // Android NDK OpenSSL - "Google Maps Platform Terms of Service" // Google Maps SDK + "Google Maps Platform Terms of Service", // Google Maps SDK + "provided without support or warranty", // org.json + "Unicode/ICU License", // icu4j + "Bouncy Castle Licence", // bcprov + "CDDL + GPLv2 with classpath exception", // javax.annotation-api ) strictMode = com.mikepenz.aboutlibraries.plugin.StrictMode.FAIL }