aboutsummaryrefslogtreecommitdiff
path: root/Changes.md
diff options
context:
space:
mode:
authorVinh Tran <vinhdaitran@google.com>2022-06-21 12:00:02 -0400
committerVinh Tran <vinhdaitran@google.com>2022-06-27 12:05:11 -0400
commit3fae6fe0db5b428d12b6547a12c8b7e1cfec0738 (patch)
tree63c59ac795d6bd3dc6a3564d30d5e2e82f546305 /Changes.md
parentf68794510fcbfd10a38bdfbf8d5d6c1f6d206afb (diff)
downloadbuild-3fae6fe0db5b428d12b6547a12c8b7e1cfec0738.tar.gz
Default BuildBrokenDepfile to empty (false)
Test: The builds should still pass because all depfile is cleanup in AOSP Bug: 179452413 Change-Id: Ifb6f5320f72c3beb44ddd6654100645e0a62e659
Diffstat (limited to 'Changes.md')
-rw-r--r--Changes.md57
1 files changed, 57 insertions, 0 deletions
diff --git a/Changes.md b/Changes.md
index cabbed6a5a..a03a48c554 100644
--- a/Changes.md
+++ b/Changes.md
@@ -1,5 +1,62 @@
# Build System Changes for Android.mk Writers
+## Gensrcs starts disallowing depfile property
+
+To migrate all gensrcs to Bazel, we are restricting the use of depfile property
+because Bazel requires specifying the dependencies directly.
+
+To fix existing uses, remove depfile and directly specify all the dependencies
+in .bp files. For example:
+
+```
+gensrcs {
+ name: "framework-cppstream-protos",
+ tools: [
+ "aprotoc",
+ "protoc-gen-cppstream",
+ ],
+ cmd: "mkdir -p $(genDir)/$(in) " +
+ "&& $(location aprotoc) " +
+ " --plugin=$(location protoc-gen-cppstream) " +
+ " -I . " +
+ " $(in) ",
+ srcs: [
+ "bar.proto",
+ ],
+ output_extension: "srcjar",
+}
+```
+where `bar.proto` imports `external.proto` would become
+
+```
+gensrcs {
+ name: "framework-cppstream-protos",
+ tools: [
+ "aprotoc",
+ "protoc-gen-cpptream",
+ ],
+ tool_files: [
+ "external.proto",
+ ],
+ cmd: "mkdir -p $(genDir)/$(in) " +
+ "&& $(location aprotoc) " +
+ " --plugin=$(location protoc-gen-cppstream) " +
+ " $(in) ",
+ srcs: [
+ "bar.proto",
+ ],
+ output_extension: "srcjar",
+}
+```
+as in https://android-review.googlesource.com/c/platform/frameworks/base/+/2125692/.
+
+`BUILD_BROKEN_DEPFILE` can be used to allowlist usage of depfile in `gensrcs`.
+
+If `depfile` is needed for generating javastream proto, `java_library` with `proto.type`
+set `stream` is the alternative solution. Sees
+https://android-review.googlesource.com/c/platform/packages/modules/Permission/+/2118004/
+for an example.
+
## Genrule starts disallowing directory inputs
To better specify the inputs to the build, we are restricting use of directories