summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain Jobredeaux <jobredeaux@google.com>2023-02-14 19:49:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-02-14 19:49:59 +0000
commit1083340c02011375637104f8b7ae60955b65adf4 (patch)
treeed284b6d851615b7fa9fcc9e429db2e1071acc4c
parentb991ed277219518763ec3f456d15160b357e5d7a (diff)
parent7c229fd522fa6f4f4a36ce98e461855f8defb99d (diff)
downloadMusic-1083340c02011375637104f8b7ae60955b65adf4.tar.gz
Merge "Simplify Music app manual BUILD setup." am: 7c229fd522
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Music/+/2420742 Change-Id: If4c1d5979454655945bb4563167be0780a425d01 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--BUILD6
-rw-r--r--kotlin/BUILD33
2 files changed, 7 insertions, 32 deletions
diff --git a/BUILD b/BUILD
index bb1e5f0..7a8a5c6 100644
--- a/BUILD
+++ b/BUILD
@@ -1,9 +1,11 @@
-load("@rules_android//rules:rules.bzl", "android_binary", "android_library")
+load("//build/bazel/rules/android:rules.bzl", "android_binary")
android_binary(
name = "Music",
srcs = glob(["src/**/*.java"]),
custom_package = "com.android.music",
manifest = "AndroidManifest.xml",
- deps = ["//packages/apps/Music/kotlin:MusicResources"],
+ # TODO(b/179889880): this manual BUILD file exists because these resources,
+ # if listed as files, would cross package boundary.
+ resource_files = ["//packages/apps/Music/kotlin:MusicResourceFiles"],
)
diff --git a/kotlin/BUILD b/kotlin/BUILD
index ab0691c..40c96d3 100644
--- a/kotlin/BUILD
+++ b/kotlin/BUILD
@@ -1,31 +1,4 @@
-load("@rules_android//rules:rules.bzl", "android_binary", "android_library")
-
-# Placeholder manifest is required to build the android library below.
-genrule(
- name = "gen_placeholdermanifest",
- outs = ["AndroidManifest.xml"],
- cmd = """
-echo '<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.Music"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="21"
- android:targetSdkVersion="21" />
-</manifest>
-
-' > $@""",
-)
-
-# Workaround a bug where including resources at the top-level android_binary fails,
-# it seems due to the resource folder being nested. Instead, we create this
-# library to hold the resources and make the android_binary target depend on it.
-android_library(
- name = "MusicResources",
- srcs = [],
- custom_package = "com.android.music",
- manifest = "AndroidManifest.xml",
- resource_files = glob(["res/**"]),
- visibility = ["//visibility:public"],
+filegroup(
+ name = "MusicResourceFiles",
+ srcs = glob(["res/**"]),
)