diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2020-02-05 13:42:45 +0900 |
---|---|---|
committer | Remi NGUYEN VAN <reminv@google.com> | 2020-02-05 23:58:30 +0900 |
commit | 255d4913e3fd5c98280ca7924937c4829fb1ef3c (patch) | |
tree | 6d1006d4d6689bbd626366653a18bf14a422f66c /Android.bp | |
parent | 9018b1ca861a68146adfb2cbb1b7851da410d0f8 (diff) |
Generate NetworkStackNext manifest from xml
Instead of a genrule, use an actual manifest merge with a separate
AndroidManifest_Next.xml for NetworkStackNext.
This is necessary as the tooling does not support injecting the train
version number to a genrule, it needs an actual manifest file.
Bug: 148907674
Test: m NetworkStackNext, diff aapt dump xmltree from parent build
Change-Id: I84d97e9108616cac1bd737dc0e4f250cc96a73da
Diffstat (limited to 'Android.bp')
-rw-r--r-- | Android.bp | 27 |
1 files changed, 10 insertions, 17 deletions
@@ -165,13 +165,21 @@ android_app { required: ["PlatformNetworkPermissionConfig", "PlatformCaptivePortalLogin"], } +// Pre-merge the AndroidManifest for NetworkStackNext, so that its manifest can be merged on top +android_library { + name: "NetworkStackNextManifestBase", + defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], + static_libs: ["NetworkStackApiCurrentLib"], + manifest: "AndroidManifest.xml" +} + // NetworkStack build targeting the current API release, for testing on in-development SDK android_app { name: "NetworkStackNext", defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], - static_libs: ["NetworkStackApiCurrentLib"], + static_libs: ["NetworkStackNextManifestBase"], certificate: "networkstack", - manifest: ":NetworkStackNextAndroidManifest", + manifest: "AndroidManifest_Next.xml", // The permission configuration *must* be included to ensure security of the device required: ["NetworkPermissionConfig"], } @@ -256,21 +264,6 @@ genrule { visibility: ["//visibility:private"], } -// genrule to modify the NetworkStack manifest for NetworkStackNext, which is the "next" version -// that builds against the "next", non-stable APIs. -// A genrule seems simpler than having yet another manifest to merge. The only elements that would -// change in the manifest are the version code, and the min/target SDK which are populated -// automatically on build with the current SDK. -genrule { - name: "NetworkStackNextAndroidManifest", - srcs: ["AndroidManifest.xml"], - out: ["NetworkStackNextAndroidManifest.xml"], - cmd: "sed -E 's/versionCode=\"[0-9]+\"/versionCode=\"" - + version_code_networkstack_next - + "\"/' $(in) > $(out)", - visibility: ["//visibility:private"], -} - android_app { name: "TestNetworkStack", defaults: ["NetworkStackAppDefaults", "NetworkStackDevApiLevel"], |