Commit 6b74593b authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: android_deps copy license files

Allows each target to then append and customize the license file based
on their third-party sub-licenses.

Bug: 869935
Change-Id: I732c132abaf386f7ce763fb7452384717c1264ed
Reviewed-on: https://chromium-review.googlesource.com/1158964
Commit-Queue: Peter Wen <wnwen@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579867}
parent 3d8ab230
Terms and conditions
This is the Android Software Development Kit License Agreement
1. Introduction
......
......@@ -3,6 +3,7 @@ Short Name: android_deps
URL: https://chromium.googlesource.com/chromium/src/+/master/tools/android/roll/android_deps/README.md
Version: 1
License: Refer to additional_readme_paths.json
License Android Compatible: yes
License File: NOT_SHIPPED
Security Critical: no
......@@ -11,14 +12,15 @@ A gradle-specified repository for Android and Java dependencies.
Local Modifications:
Everything directly here is chromium code, and third_party code lives under
`repository`, where each library has its own README.chromium and LICENSE:
`libs`, where each library has its own README.chromium and LICENSE:
```
third_party/android_deps
├── .gitignore (hand written)
├── Android_SDK_License-December_9_2016.txt ([1])
├── additional_license_paths.json (generated)
├── BUILD.gn (partly generated)
├── repository (generated)
├── libs (generated)
│   ├── dependency_group_name_and_version
│   │ ├── dependency_name_and_version.jar (third_party)
│   │ ├── LICENSE (third_party)
......@@ -28,6 +30,8 @@ third_party/android_deps
│   ├── LICENSE (third_party)
│   └── README.chromium (generated)
└── README.chromium (hand written)
[1] - Copied main text verbatim from https://developer.android.com/studio/terms
```
Instructions for adding/updating dependencies are in:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-auth
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-auth-api-phone
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-auth-base
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-base
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-basement
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-cast
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-cast-framework
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-fido
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-gcm
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-iid
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-instantapps
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-location
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-tasks
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-vision
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -3,7 +3,7 @@ Short Name: play-services-vision-common
URL: https://developers.google.com/android/guides/setup
Version: 12.0.1
License: Android Software Development Kit License
License File: /third_party/android_deps/Android_SDK_License-December_9_2016.txt
License File: LICENSE
Security Critical: yes
Description:
......
......@@ -53,11 +53,13 @@ including the original CIPD symlinks under
`build.gradle` modifications.
If you are updating any of the gms dependencies, please ensure that the license
file that they reference is up-to-date with the one on android's
[website][android_sdk_link].
file that they use, explained in the [README.chromium][readme_chromium_link] is
up-to-date with the one on android's [website][android_sdk_link], last updated
date is at the bottom.
[docs_link]: ../../../../docs/adding_to_third_party.md
[android_sdk_link]: https://developer.android.com/studio/terms
[readme_chromium_link]: ../../../../third_party/android_deps/README.chromium
### Implementation notes:
The script invokes a Gradle plugin to leverage its dependency resolution
......
......@@ -78,6 +78,9 @@ class BuildConfigGenerator extends DefaultTask {
new File("${absoluteDepDir}/OWNERS").write(makeOwners())
if (!dependency.licenseUrl?.trim()?.isEmpty()) {
downloadFile(dependency.licenseUrl, new File("${absoluteDepDir}/LICENSE"))
} else if (!dependency.licensePath?.isEmpty()) {
new File("${absoluteDepDir}/LICENSE").write(
new File("${normalisedRepoPath}/${dependency.licensePath}").text)
}
}
......@@ -231,9 +234,6 @@ class BuildConfigGenerator extends DefaultTask {
}
def licenseFile = dependency.supportsAndroid ? "LICENSE" : "NOT_SHIPPED"
if (!dependency.licensePath?.isEmpty()) {
licenseFile = dependency.licensePath
}
return """\
Name: ${dependency.displayName}
......
......@@ -133,7 +133,8 @@ class ChromiumDepGraph {
private customizeDep(DependencyDescription dep) {
if (dep.id?.startsWith("com_google_android_gms_play_services_")) {
dep.licenseUrl = ""
dep.licensePath = "/third_party/android_deps/Android_SDK_License-December_9_2016.txt"
// This should match fetch_all._ANDROID_SDK_LICENSE_PATH
dep.licensePath = "Android_SDK_License-December_9_2016.txt"
if (dep.url?.isEmpty()) {
dep.url = "https://developers.google.com/android/guides/setup"
}
......
......@@ -50,6 +50,10 @@ _ANDROID_DEPS_SUBDIR = 'third_party/android_deps'
# Path to BUILD.gn file under android_deps/
_ANDROID_DEPS_BUILD_GN = _ANDROID_DEPS_SUBDIR + '/BUILD.gn'
# Path to updated Android SDK License under android_deps/
_ANDROID_SDK_LICENSE_PATH = (
_ANDROID_DEPS_SUBDIR + '/Android_SDK_License-December_9_2016.txt')
# Path to additional_readme_paths.json
_ANDROID_DEPS_ADDITIONAL_README_PATHS = (
_ANDROID_DEPS_SUBDIR + '/additional_readme_paths.json')
......@@ -73,6 +77,7 @@ _UPDATED_GIT_FILES = [
# The list of files that are copied to the build directory by this script.
# Should not include _UPDATED_GIT_FILES.
_COPIED_PATHS = [
_ANDROID_SDK_LICENSE_PATH,
_BUILD_GRADLE_PATH,
_GRADLE_BUILDSRC_PATH,
]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment