Skip to content

Instantly share code, notes, and snippets.

@FareesHussain
Created March 4, 2021 04:37
Show Gist options
  • Save FareesHussain/f4d5f0297e314807e60c593500b25890 to your computer and use it in GitHub Desktop.
Save FareesHussain/f4d5f0297e314807e60c593500b25890 to your computer and use it in GitHub Desktop.
example app BUILD.bazel
load("@rules_android//android:rules.bzl", "android_binary", "android_library")
# The final binary rule, which builds the APK and sets the application manifest,
# as well as any other resources needed by the application.
# The package for the R class for resources is normally inferred from the
# directory containing the BUILD file, but this BUILD file is not under a java
# directory, so we specify it manually.
android_binary(
name = "android",
custom_package = "com.google.bazel.example.android",
manifest = "src/main/java/com/google/bazel/example/android/AndroidManifest.xml",
resource_files = glob(["src/main/java/com/google/bazel/example/android/res/**"]),
visibility = ["//visibility:public"],
deps = [":activities"],
)
# A library which compiles some Java sources and associated resources.
# Because it has resources, it requires a manifest.
android_library(
name = "activities",
srcs = glob(["src/main/java/com/google/bazel/example/android/activities/*.java"]),
custom_package = "com.google.bazel.example.android.activities",
manifest = "src/main/java/com/google/bazel/example/android/activities/AndroidManifest.xml",
resource_files = glob(["src/main/java/com/google/bazel/example/android/activities/res/**"]),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment