diff options
author | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-06-13 18:24:38 +0200 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-06-14 11:55:13 +0200 |
commit | 20969089336b69c915f541f7c45d06b9465f26cd (patch) | |
tree | 085efbac2624ddf785e7ad13e303bd4533d6cf3f /platform/android/scripts | |
parent | 3584ee40f431200ae2ef33dfcff26483aeacf1a1 (diff) | |
download | qtlocation-mapboxgl-20969089336b69c915f541f7c45d06b9465f26cd.tar.gz |
[android] - added Android licenses make target
Diffstat (limited to 'platform/android/scripts')
-rw-r--r-- | platform/android/scripts/generate-license.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/platform/android/scripts/generate-license.py b/platform/android/scripts/generate-license.py new file mode 100644 index 0000000000..a05169e096 --- /dev/null +++ b/platform/android/scripts/generate-license.py @@ -0,0 +1,39 @@ +#!/usr/bin/python + +import os +import json + +path = os.getcwd() + "/platform/android/" +with open(path + "LICENSE.md", 'w') as licenseFile: + licenseFile.write("<!-- This file was generated. Use `make android-license` to update. -->\n") + licenseFile.write("## Additional Mapbox GL licenses\n") + with open(path + "MapboxGLAndroidSDK/build/reports/licenses/licenseReleaseReport.json", 'r') as dataFile: + data = json.load(dataFile) + + gradleLicensePlugin =""" + { + "project": "Gradle License Plugin", + "url": "https://github.com/jaredsburrows/gradle-license-plugin", + "licenses": [ + { + "license": "The Apache Software License, Version 2.0", + "license_url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + ] + } + """ + data.append(json.loads(gradleLicensePlugin)) + + licenseName = "" + licenseUrl = "" + for entry in data: + projectName = entry["project"] + projectUrl = entry["url"] + for license in entry["licenses"]: + licenseName = license["license"] + licenseUrl = license["license_url"] + + licenseFile.write("Mapbox GL uses portions of the %s.\n" % projectName + + ("URL: [%s](%s)\n" % (projectUrl, projectUrl) if projectUrl is not None else "") + + "License: [%s](%s)" % (licenseName, licenseUrl) + + "\n\n===========================================================================\n\n") |