summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-09-15 20:19:02 +0900
committerJiyong Park <jiyong@google.com>2019-09-16 13:12:59 +0900
commitae9972bda40fff4b0f67dc31d95e740a6973db72 (patch)
tree3c39136f751512e3a318a3a97c8ceac498a847c9
parent763cb4638a1ed6124569b71307ca9a78373326a1 (diff)
Use filter_packages to unbunden metalava
This change fixes a problem that entire framework source files are given to metalava even when many of the source files are not for public. Using the new property filter_packages, only source files that belongs to the public packages are given to metalava. This CL also changes the name of the filegroup 'framework-srcs' to 'framework-non-updatable-sources' to better describe its contents. In addition, a build-time only library 'framework-all' is introduced. This library produces a header jar for all framework sources for both non-updatable and updatable parts. It is put to the classpath when invoking metalava to give information on the hidden classes that were filtered-out. Bug: 140764681 Test: m Change-Id: I6e16679109ac07820e35037754d4327442c014f2
-rw-r--r--Android.bp44
-rw-r--r--location/lib/Android.bp2
-rw-r--r--media/lib/signer/Android.bp2
-rw-r--r--test-mock/Android.bp2
4 files changed, 38 insertions, 12 deletions
diff --git a/Android.bp b/Android.bp
index 8520d408b04d..7241417e6f5d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -163,7 +163,7 @@ filegroup {
}
filegroup {
- name: "framework-srcs",
+ name: "framework-non-updatable-sources",
srcs: [
// Java/AIDL sources under frameworks/base
":framework-core-sources",
@@ -211,6 +211,14 @@ filegroup {
],
}
+filegroup {
+ name: "framework-all-sources",
+ srcs: [
+ ":framework-non-updatable-sources",
+ ":updatable-media-srcs",
+ ],
+}
+
java_defaults {
name: "framework-aidl-export-defaults",
aidl: {
@@ -283,15 +291,12 @@ java_defaults {
defaults: ["framework-aidl-export-defaults"],
installable: true,
- srcs: [
- ":framework-srcs",
- "core/java/**/*.logtags",
- ],
-
aidl: {
generate_get_transaction_name: true,
},
+ srcs: ["core/java/**/*.logtags"],
+
exclude_srcs: [
// See comment on framework-atb-backward-compatibility module below
"core/java/android/content/pm/AndroidTestBaseUpdater.java",
@@ -356,6 +361,7 @@ filegroup {
java_library {
name: "framework",
defaults: ["framework-defaults"],
+ srcs: [":framework-non-updatable-sources"],
javac_shard_size: 150,
required: [
"framework-platform-compat-config",
@@ -365,8 +371,16 @@ java_library {
}
java_library {
+ name: "framework-all",
+ defaults: ["framework-defaults"],
+ srcs: [":framework-all-sources"],
+ installable: false,
+}
+
+java_library {
name: "framework-annotation-proc",
defaults: ["framework-defaults"],
+ srcs: [":framework-all-sources"],
installable: false,
plugins: [
"unsupportedappusage-annotation-processor",
@@ -878,10 +892,21 @@ metalava_framework_docs_args += " --replace-documentation " +
// replacement (with $1, $2 backreferences to the regex groups)
"'$$1https://docs.oracle.com/javase/8/docs/$$2\">' "
+packages_to_document = [
+ "android",
+ "java",
+ "javax",
+ "org.apache.http",
+ "org.json",
+ "org.w3c.dom",
+ "org.xml.sax",
+ "org.xmlpull",
+]
+
stubs_defaults {
name: "framework-doc-stubs-default",
srcs: [
- ":framework-srcs",
+ ":framework-non-updatable-sources",
"core/java/**/*.logtags",
"test-base/src/**/*.java",
":opt-telephony-srcs",
@@ -945,7 +970,7 @@ doc_defaults {
stubs_defaults {
name: "metalava-api-stubs-default",
srcs: [
- ":framework-srcs",
+ ":framework-non-updatable-sources",
"core/java/**/*.logtags",
":opt-telephony-srcs",
":opt-net-voip-srcs",
@@ -967,6 +992,7 @@ stubs_defaults {
"api-versions-jars-dir",
],
sdk_version: "core_platform",
+ filter_packages: packages_to_document,
}
droidstubs {
@@ -1465,7 +1491,7 @@ filegroup {
// annotations to private apis
aidl_mapping {
name: "framework-aidl-mappings",
- srcs: [":framework-srcs"],
+ srcs: [":framework-all-sources"],
output: "framework-aidl-mappings.txt",
}
diff --git a/location/lib/Android.bp b/location/lib/Android.bp
index 349b9e063784..3cd6ccf1ea18 100644
--- a/location/lib/Android.bp
+++ b/location/lib/Android.bp
@@ -18,7 +18,7 @@ java_sdk_library {
name: "com.android.location.provider",
srcs: [
"java/**/*.java",
- ":framework-srcs",
+ ":framework-all-sources",
],
api_packages: ["com.android.location.provider"],
}
diff --git a/media/lib/signer/Android.bp b/media/lib/signer/Android.bp
index 85a007f427b8..2286c5379e1a 100644
--- a/media/lib/signer/Android.bp
+++ b/media/lib/signer/Android.bp
@@ -18,7 +18,7 @@ java_sdk_library {
name: "com.android.mediadrm.signer",
srcs: [
"java/**/*.java",
- ":framework-srcs",
+ ":framework-all-sources",
],
api_packages: ["com.android.mediadrm.signer"],
}
diff --git a/test-mock/Android.bp b/test-mock/Android.bp
index 34ac3dcc824f..adc9e2251c0b 100644
--- a/test-mock/Android.bp
+++ b/test-mock/Android.bp
@@ -21,7 +21,7 @@ java_sdk_library {
srcs: [
"src/**/*.java",
- ":framework-srcs",
+ ":framework-all-sources",
],
api_packages: [