-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters