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 This is the Android Software Development Kit License Agreement
1. Introduction 1. Introduction
......
...@@ -3,6 +3,7 @@ Short Name: android_deps ...@@ -3,6 +3,7 @@ Short Name: android_deps
URL: https://chromium.googlesource.com/chromium/src/+/master/tools/android/roll/android_deps/README.md URL: https://chromium.googlesource.com/chromium/src/+/master/tools/android/roll/android_deps/README.md
Version: 1 Version: 1
License: Refer to additional_readme_paths.json License: Refer to additional_readme_paths.json
License Android Compatible: yes
License File: NOT_SHIPPED License File: NOT_SHIPPED
Security Critical: no Security Critical: no
...@@ -11,14 +12,15 @@ A gradle-specified repository for Android and Java dependencies. ...@@ -11,14 +12,15 @@ A gradle-specified repository for Android and Java dependencies.
Local Modifications: Local Modifications:
Everything directly here is chromium code, and third_party code lives under 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 third_party/android_deps
├── .gitignore (hand written) ├── .gitignore (hand written)
├── Android_SDK_License-December_9_2016.txt ([1])
├── additional_license_paths.json (generated) ├── additional_license_paths.json (generated)
├── BUILD.gn (partly generated) ├── BUILD.gn (partly generated)
├── repository (generated) ├── libs (generated)
│   ├── dependency_group_name_and_version │   ├── dependency_group_name_and_version
│   │ ├── dependency_name_and_version.jar (third_party) │   │ ├── dependency_name_and_version.jar (third_party)
│   │ ├── LICENSE (third_party) │   │ ├── LICENSE (third_party)
...@@ -28,6 +30,8 @@ third_party/android_deps ...@@ -28,6 +30,8 @@ third_party/android_deps
│   ├── LICENSE (third_party) │   ├── LICENSE (third_party)
│   └── README.chromium (generated) │   └── README.chromium (generated)
└── README.chromium (hand written) └── README.chromium (hand written)
[1] - Copied main text verbatim from https://developer.android.com/studio/terms
``` ```
Instructions for adding/updating dependencies are in: Instructions for adding/updating dependencies are in:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-auth ...@@ -3,7 +3,7 @@ Short Name: play-services-auth
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-auth-api-phone ...@@ -3,7 +3,7 @@ Short Name: play-services-auth-api-phone
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-auth-base ...@@ -3,7 +3,7 @@ Short Name: play-services-auth-base
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-base ...@@ -3,7 +3,7 @@ Short Name: play-services-base
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-basement ...@@ -3,7 +3,7 @@ Short Name: play-services-basement
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-cast ...@@ -3,7 +3,7 @@ Short Name: play-services-cast
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-cast-framework ...@@ -3,7 +3,7 @@ Short Name: play-services-cast-framework
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-fido ...@@ -3,7 +3,7 @@ Short Name: play-services-fido
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-gcm ...@@ -3,7 +3,7 @@ Short Name: play-services-gcm
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-iid ...@@ -3,7 +3,7 @@ Short Name: play-services-iid
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-instantapps ...@@ -3,7 +3,7 @@ Short Name: play-services-instantapps
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-location ...@@ -3,7 +3,7 @@ Short Name: play-services-location
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-tasks ...@@ -3,7 +3,7 @@ Short Name: play-services-tasks
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-vision ...@@ -3,7 +3,7 @@ Short Name: play-services-vision
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -3,7 +3,7 @@ Short Name: play-services-vision-common ...@@ -3,7 +3,7 @@ Short Name: play-services-vision-common
URL: https://developers.google.com/android/guides/setup URL: https://developers.google.com/android/guides/setup
Version: 12.0.1 Version: 12.0.1
License: Android Software Development Kit License 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 Security Critical: yes
Description: Description:
......
...@@ -53,11 +53,13 @@ including the original CIPD symlinks under ...@@ -53,11 +53,13 @@ including the original CIPD symlinks under
`build.gradle` modifications. `build.gradle` modifications.
If you are updating any of the gms dependencies, please ensure that the license 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 file that they use, explained in the [README.chromium][readme_chromium_link] is
[website][android_sdk_link]. 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 [docs_link]: ../../../../docs/adding_to_third_party.md
[android_sdk_link]: https://developer.android.com/studio/terms [android_sdk_link]: https://developer.android.com/studio/terms
[readme_chromium_link]: ../../../../third_party/android_deps/README.chromium
### Implementation notes: ### Implementation notes:
The script invokes a Gradle plugin to leverage its dependency resolution The script invokes a Gradle plugin to leverage its dependency resolution
......
...@@ -78,6 +78,9 @@ class BuildConfigGenerator extends DefaultTask { ...@@ -78,6 +78,9 @@ class BuildConfigGenerator extends DefaultTask {
new File("${absoluteDepDir}/OWNERS").write(makeOwners()) new File("${absoluteDepDir}/OWNERS").write(makeOwners())
if (!dependency.licenseUrl?.trim()?.isEmpty()) { if (!dependency.licenseUrl?.trim()?.isEmpty()) {
downloadFile(dependency.licenseUrl, new File("${absoluteDepDir}/LICENSE")) 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 { ...@@ -231,9 +234,6 @@ class BuildConfigGenerator extends DefaultTask {
} }
def licenseFile = dependency.supportsAndroid ? "LICENSE" : "NOT_SHIPPED" def licenseFile = dependency.supportsAndroid ? "LICENSE" : "NOT_SHIPPED"
if (!dependency.licensePath?.isEmpty()) {
licenseFile = dependency.licensePath
}
return """\ return """\
Name: ${dependency.displayName} Name: ${dependency.displayName}
......
...@@ -133,7 +133,8 @@ class ChromiumDepGraph { ...@@ -133,7 +133,8 @@ class ChromiumDepGraph {
private customizeDep(DependencyDescription dep) { private customizeDep(DependencyDescription dep) {
if (dep.id?.startsWith("com_google_android_gms_play_services_")) { if (dep.id?.startsWith("com_google_android_gms_play_services_")) {
dep.licenseUrl = "" 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()) { if (dep.url?.isEmpty()) {
dep.url = "https://developers.google.com/android/guides/setup" dep.url = "https://developers.google.com/android/guides/setup"
} }
......
...@@ -50,6 +50,10 @@ _ANDROID_DEPS_SUBDIR = 'third_party/android_deps' ...@@ -50,6 +50,10 @@ _ANDROID_DEPS_SUBDIR = 'third_party/android_deps'
# Path to BUILD.gn file under android_deps/ # Path to BUILD.gn file under android_deps/
_ANDROID_DEPS_BUILD_GN = _ANDROID_DEPS_SUBDIR + '/BUILD.gn' _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 # Path to additional_readme_paths.json
_ANDROID_DEPS_ADDITIONAL_README_PATHS = ( _ANDROID_DEPS_ADDITIONAL_README_PATHS = (
_ANDROID_DEPS_SUBDIR + '/additional_readme_paths.json') _ANDROID_DEPS_SUBDIR + '/additional_readme_paths.json')
...@@ -73,6 +77,7 @@ _UPDATED_GIT_FILES = [ ...@@ -73,6 +77,7 @@ _UPDATED_GIT_FILES = [
# The list of files that are copied to the build directory by this script. # The list of files that are copied to the build directory by this script.
# Should not include _UPDATED_GIT_FILES. # Should not include _UPDATED_GIT_FILES.
_COPIED_PATHS = [ _COPIED_PATHS = [
_ANDROID_SDK_LICENSE_PATH,
_BUILD_GRADLE_PATH, _BUILD_GRADLE_PATH,
_GRADLE_BUILDSRC_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