Add a java binary, a java library, and an android app target building to bp2build ci.
(Second attempt at https://android-review.googlesource.com/c/platform/build/bazel/+/1788469)
Adding the --fat_apk_cpu=k8 flag to common.bazelrc as it only applies to android app building rules, and it is currently required to successfully build them.
Forcing the use of the checked in Java JDK to avoid falling back to the local machine's JDK.
This may be overkill, but I wrote a small doc to justify the new approach of setting JAVA_HOME in bazel.sh: go/aosp-bazel-jdk
Test: b build examples/java/...; b build examples/android_app/...; lunch; b build examples/java/...; b build examples/android_app/...
Change-Id: I9ce3886a3e6f1eec903de52493251ec3c5fa7681
diff --git a/common.bazelrc b/common.bazelrc
index fad3990..4f21317 100644
--- a/common.bazelrc
+++ b/common.bazelrc
@@ -8,6 +8,7 @@
# Ensure that the host_javabase always use @local_jdk, the checked-in JDK.
build --tool_java_runtime_version=local_jdk
+build --java_runtime_version=local_jdk
# Lock down the PATH variable in actions to /usr/bin and /usr/local/bin.
build --experimental_strict_action_env
@@ -72,6 +73,7 @@
build --define=android_incremental_dexing_tool=d8_dexbuilder
build --define=android_dexmerger_tool=d8_dexmerger
build --nouse_workers_with_dexbuilder
+build --fat_apk_cpu=k8
# Developer instance for result storage. This only works if you have access
# to the Bazel GCP project. Follow the GCP gcloud client's auth instructions to