Commit 516015de authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android fetch_deps.py: Fixes to FALLBACK_PROPERTIES and remove annotationProcessorConfig

annotationProcessorConfig is now unused and provides no value over buildCompile
FALLBACK_PROPERTIES:
* Fix overrides being ignored for Java and Android deps.
* Added isShipped override.

Bug: 693079
Change-Id: I67da37bfdd03e04e39dc0cb293b861aff339a9bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903829Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713466}
parent 7c0b3512
...@@ -3,8 +3,8 @@ Short Name: jsr250-api ...@@ -3,8 +3,8 @@ Short Name: jsr250-api
URL: http://jcp.org/aboutJava/communityprocess/final/jsr250/index.html URL: http://jcp.org/aboutJava/communityprocess/final/jsr250/index.html
Version: 1.0 Version: 1.0
License: CDDLv1.0 License: CDDLv1.0
License File: LICENSE License File: NOT_SHIPPED
Security Critical: yes Security Critical: no
Description: Description:
JSR-250 Reference Implementation by Glassfish JSR-250 Reference Implementation by Glassfish
......
...@@ -24,38 +24,39 @@ class ChromiumDepGraph { ...@@ -24,38 +24,39 @@ class ChromiumDepGraph {
// It is provided here from manual lookups. Note that licenseUrl must provide textual content // It is provided here from manual lookups. Note that licenseUrl must provide textual content
// rather than be an html page. // rather than be an html page.
final def FALLBACK_PROPERTIES = [ final def FALLBACK_PROPERTIES = [
'com_google_errorprone_error_prone_annotations': new DependencyDescription( 'com_google_errorprone_error_prone_annotations': new PropertyOverride(
url: "https://errorprone.info/", url: "https://errorprone.info/",
licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt", licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt",
licenseName: "Apache 2.0"), licenseName: "Apache 2.0"),
'com_google_googlejavaformat_google_java_format': new DependencyDescription( 'com_google_googlejavaformat_google_java_format': new PropertyOverride(
url: "https://github.com/google/google-java-format", url: "https://github.com/google/google-java-format",
licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt", licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt",
licenseName: "Apache 2.0"), licenseName: "Apache 2.0"),
'com_google_guava_guava': new DependencyDescription( 'com_google_guava_guava': new PropertyOverride(
url: "https://github.com/google/guava", url: "https://github.com/google/guava",
licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt", licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt",
licenseName: "Apache 2.0"), licenseName: "Apache 2.0"),
'org_codehaus_mojo_animal_sniffer_annotations': new DependencyDescription( 'org_codehaus_mojo_animal_sniffer_annotations': new PropertyOverride(
url: "http://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/", url: "http://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/",
licenseUrl: "https://raw.githubusercontent.com/mojohaus/animal-sniffer/master/animal-sniffer-annotations/pom.xml", licenseUrl: "https://raw.githubusercontent.com/mojohaus/animal-sniffer/master/animal-sniffer-annotations/pom.xml",
licensePath: "licenses/Codehaus_License-2009.txt", licensePath: "licenses/Codehaus_License-2009.txt",
licenseName: "MIT"), licenseName: "MIT"),
'org_checkerframework_checker_compat_qual': new DependencyDescription( 'org_checkerframework_checker_compat_qual': new PropertyOverride(
licenseUrl: "https://raw.githubusercontent.com/typetools/checker-framework/master/LICENSE.txt", licenseUrl: "https://raw.githubusercontent.com/typetools/checker-framework/master/LICENSE.txt",
licenseName: "GPL v2 with the classpath exception"), licenseName: "GPL v2 with the classpath exception"),
'com_google_protobuf_protobuf_lite': new DependencyDescription( 'com_google_protobuf_protobuf_lite': new PropertyOverride(
url: "https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md", url: "https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md",
licenseUrl: "https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE", licenseUrl: "https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE",
licenseName: "BSD"), licenseName: "BSD"),
'com_google_ar_core': new DependencyDescription( 'com_google_ar_core': new PropertyOverride(
url: "https://github.com/google-ar/arcore-android-sdk", url: "https://github.com/google-ar/arcore-android-sdk",
licenseUrl: "https://raw.githubusercontent.com/google-ar/arcore-android-sdk/master/LICENSE", licenseUrl: "https://raw.githubusercontent.com/google-ar/arcore-android-sdk/master/LICENSE",
licenseName: "Apache 2.0"), licenseName: "Apache 2.0"),
'javax_annotation_jsr250_api': new DependencyDescription( 'javax_annotation_jsr250_api': new PropertyOverride(
isShipped: false, // Annotations are stripped by R8.
licenseName: "CDDLv1.0", licenseName: "CDDLv1.0",
licensePath: "licenses/CDDLv1.0.txt"), licensePath: "licenses/CDDLv1.0.txt"),
'net_sf_kxml_kxml2': new DependencyDescription( 'net_sf_kxml_kxml2': new PropertyOverride(
licenseUrl: "https://raw.githubusercontent.com/stefanhaustein/kxml2/master/license.txt", licenseUrl: "https://raw.githubusercontent.com/stefanhaustein/kxml2/master/license.txt",
licenseName: "MIT"), licenseName: "MIT"),
] ]
...@@ -66,13 +67,11 @@ class ChromiumDepGraph { ...@@ -66,13 +67,11 @@ class ChromiumDepGraph {
void collectDependencies() { void collectDependencies() {
def compileConfig = project.configurations.getByName('compile').resolvedConfiguration def compileConfig = project.configurations.getByName('compile').resolvedConfiguration
def buildCompileConfig = project.configurations.getByName('buildCompile').resolvedConfiguration def buildCompileConfig = project.configurations.getByName('buildCompile').resolvedConfiguration
def annotationProcessorConfig = project.configurations.getByName('annotationProcessor').resolvedConfiguration
def testCompileConfig = project.configurations.getByName('testCompile').resolvedConfiguration def testCompileConfig = project.configurations.getByName('testCompile').resolvedConfiguration
List<String> topLevelIds = [] List<String> topLevelIds = []
Set<ResolvedConfiguration> deps = [] Set<ResolvedConfiguration> deps = []
deps += compileConfig.firstLevelModuleDependencies deps += compileConfig.firstLevelModuleDependencies
deps += buildCompileConfig.firstLevelModuleDependencies deps += buildCompileConfig.firstLevelModuleDependencies
deps += annotationProcessorConfig.firstLevelModuleDependencies
deps += testCompileConfig.firstLevelModuleDependencies deps += testCompileConfig.firstLevelModuleDependencies
deps.each { dependency -> deps.each { dependency ->
...@@ -104,6 +103,14 @@ class ChromiumDepGraph { ...@@ -104,6 +103,14 @@ class ChromiumDepGraph {
dep.testOnly = false dep.testOnly = false
dep.isShipped = true dep.isShipped = true
} }
// Has a side-effect of ensuring we don't have any stale fallbackProperties.
FALLBACK_PROPERTIES.each { id, fallbackProperties ->
if (fallbackProperties?.isShipped != null) {
def dep = dependencies.get(id)
dep.isShipped = fallbackProperties.isShipped
}
}
} }
private ResolvedArtifactResult getPomFromArtifact(ComponentIdentifier componentId) { private ResolvedArtifactResult getPomFromArtifact(ComponentIdentifier componentId) {
...@@ -196,6 +203,7 @@ class ChromiumDepGraph { ...@@ -196,6 +203,7 @@ class ChromiumDepGraph {
private customizeDep(DependencyDescription dep) { private customizeDep(DependencyDescription dep) {
if (dep.id?.startsWith("com_google_android_")) { if (dep.id?.startsWith("com_google_android_")) {
project.logger.debug("Using Android license for ${dep.id}")
dep.licenseUrl = "" dep.licenseUrl = ""
// This should match fetch_all._ANDROID_SDK_LICENSE_PATH. // This should match fetch_all._ANDROID_SDK_LICENSE_PATH.
dep.licensePath = "licenses/Android_SDK_License-December_9_2016.txt" dep.licensePath = "licenses/Android_SDK_License-December_9_2016.txt"
...@@ -203,29 +211,30 @@ class ChromiumDepGraph { ...@@ -203,29 +211,30 @@ class ChromiumDepGraph {
dep.url = "https://developers.google.com/android/guides/setup" dep.url = "https://developers.google.com/android/guides/setup"
} }
} else if (dep.licenseUrl?.equals("http://openjdk.java.net/legal/gplv2+ce.html")) { } else if (dep.licenseUrl?.equals("http://openjdk.java.net/legal/gplv2+ce.html")) {
project.logger.debug("Detected GPL v2 /w classpath license for ${dep.id}")
// This avoids using html in a LICENSE file. // This avoids using html in a LICENSE file.
dep.licenseUrl = "" dep.licenseUrl = ""
dep.licenseName = "GPL v2 with the classpath exception"
dep.licensePath = "licenses/GNU_v2_with_Classpath_Exception_1991.txt" dep.licensePath = "licenses/GNU_v2_with_Classpath_Exception_1991.txt"
} else { }
def fallbackProperties = FALLBACK_PROPERTIES.get(dep.id)
if (fallbackProperties != null) { def fallbackProperties = FALLBACK_PROPERTIES.get(dep.id)
project.logger.debug("Using fallback properties for ${dep.id}") if (fallbackProperties != null) {
if (fallbackProperties.licenseName != null) { project.logger.debug("Using fallback properties for ${dep.id}")
dep.licenseName = fallbackProperties.licenseName if (fallbackProperties.licenseName != null) {
} dep.licenseName = fallbackProperties.licenseName
if (fallbackProperties.licenseUrl != null) { }
dep.licenseUrl = fallbackProperties.licenseUrl if (fallbackProperties.licenseUrl != null) {
} dep.licenseUrl = fallbackProperties.licenseUrl
if (fallbackProperties.licensePath != null) { }
dep.licensePath = fallbackProperties.licensePath if (fallbackProperties.licensePath != null) {
} dep.licensePath = fallbackProperties.licensePath
if (fallbackProperties.url != null) { }
dep.url = fallbackProperties.url if (fallbackProperties.url != null) {
} dep.url = fallbackProperties.url
if (fallbackProperties.cipdSuffix != null) { }
dep.cipdSuffix = fallbackProperties.cipdSuffix if (fallbackProperties.cipdSuffix != null) {
} dep.cipdSuffix = fallbackProperties.cipdSuffix
dep.licenseAndroidCompatible = fallbackProperties.licenseAndroidCompatible
} }
} }
...@@ -271,4 +280,11 @@ class ChromiumDepGraph { ...@@ -271,4 +280,11 @@ class ChromiumDepGraph {
List<String> children List<String> children
String cipdSuffix String cipdSuffix
} }
static class PropertyOverride {
String url
String licenseName, licenseUrl, licensePath
String cipdSuffix
Boolean isShipped
}
} }
...@@ -22,12 +22,6 @@ class ChromiumPlugin implements Plugin<Project> { ...@@ -22,12 +22,6 @@ class ChromiumPlugin implements Plugin<Project> {
/** Libraries that are only used during build. These support android. */ /** Libraries that are only used during build. These support android. */
buildCompile buildCompile
/**
* Marks that the dependency will only be used during building, as an annotation
* processor. It will not be usable in the APK, and not marked as supporting android.
*/
annotationProcessor
} }
} }
} }
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