From 585cac22d9126fc094db3ba8963336d98836cee1 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Mon, 6 Jul 2020 09:12:57 -0700 Subject: Add array type property flags, equivalent to args The property args is currently a string, but represents a collection of arguments to metalava/doclava. This has resulted in variables being used rather than default modules to share arguments. Test: go test java_tests Bug: 145644363 Change-Id: I670235e8f1cf19bfe8909049c4765637d0accd47 --- java/java_test.go | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index fb003619f..db3f18740 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1097,7 +1097,7 @@ func TestDroiddoc(t *testing.T) { ], proofread_file: "libcore-proofread.txt", todo_file: "libcore-docs-todo.html", - args: "-offlinemode -title \"libcore\"", + flags: ["-offlinemode -title \"libcore\""], } `, map[string][]byte{ @@ -1124,6 +1124,42 @@ func TestDroiddoc(t *testing.T) { } } +func TestDroiddocArgsAndFlagsCausesError(t *testing.T) { + testJavaError(t, "flags is set. Cannot set args", ` + droiddoc_exported_dir { + name: "droiddoc-templates-sdk", + path: ".", + } + filegroup { + name: "bar-doc-aidl-srcs", + srcs: ["bar-doc/IBar.aidl"], + path: "bar-doc", + } + droiddoc { + name: "bar-doc", + srcs: [ + "bar-doc/a.java", + "bar-doc/IFoo.aidl", + ":bar-doc-aidl-srcs", + ], + exclude_srcs: [ + "bar-doc/b.java" + ], + custom_template: "droiddoc-templates-sdk", + hdf: [ + "android.whichdoc offline", + ], + knowntags: [ + "bar-doc/known_oj_tags.txt", + ], + proofread_file: "libcore-proofread.txt", + todo_file: "libcore-docs-todo.html", + flags: ["-offlinemode -title \"libcore\""], + args: "-offlinemode -title \"libcore\"", + } + `) +} + func TestDroidstubsWithSystemModules(t *testing.T) { ctx, _ := testJava(t, ` droidstubs { -- cgit v1.2.3-59-g8ed1b