From 2f15471377c4944caf62d291166a7294db1683c4 Mon Sep 17 00:00:00 2001 From: Frank Salim Date: Wed, 4 May 2022 12:21:37 -0700 Subject: [PATCH] Add Bazel build. I realize this will make upstreaming changes less likely. At the moment, building requires Bazel 6.0.0-pre.20220421.3 due to https://github.com/bazelbuild/bazel/issues/13989. --- BUILD | 18 ++++++++++++++++++ WORKSPACE | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 BUILD create mode 100644 WORKSPACE diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..a17e9f9 --- /dev/null +++ b/BUILD @@ -0,0 +1,18 @@ +load("@build_bazel_rules_android//android:rules.bzl", "android_library") + +android_binary( + name = "markers", + srcs = glob(["src/**/*.java"]), + custom_package = "com.google.android.apps.markers", + manifest = "AndroidManifest.xml", + deps = [ + ":resources", + ], +) + +android_library( + name = "resources", + manifest = "AndroidManifest.xml", + custom_package = "org.dsandler.apps.markers", + resource_files = glob(["res/**"]), +) diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..725b8d5 --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,16 @@ +# Load the Android build rules +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "build_bazel_rules_android", + urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"], + sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + strip_prefix = "rules_android-0.1.1", +) + +# Configure Android SDK Path +load("@build_bazel_rules_android//android:rules.bzl", "android_sdk_repository") +android_sdk_repository( + name = "androidsdk", + path = "/home/frank/Android/Sdk", +) +