summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-02-26 14:33:31 -0800
committerDan Willemsen <dwillemsen@google.com>2018-03-01 02:10:51 +0000
commitcc090973598edd97b44a74146b2e0ce82c9ddef7 (patch)
tree617341c65117f1cdf4a922791dd9595c624ebed9 /java/java_test.go
parent3bb14200e2a6f691789d2f311b30cb881a8d99a0 (diff)
Add droiddoc_template
We prefer not to use absolute paths in modules, but to reference modules that have associated paths. This a few benefits: * it's easier to move a module than to update all the references * if the module doesn't exist, we treat it as a normal missing dependency, not having to deal with the missing dependency in path.go * implementing visibility(etc) in the future would be simpler if there was a module attached to the reference, so we don't have to do various path-based lookups to try and match things up. So define a `droiddoc_template` module, which takes a path, and will run the glob once in that module. All of the `droiddoc` modules can then specify it through the `custom_template` property, which will pull the necessary data. Also fix that htmldirs should be references from the local path, the htmldir2 argument never being specified, and complain if more than two htmldirs are specified, or if the custom template isn't specified. Test: m core-docs Test: out/soong/build.ninja is nearly identical - line numbers in comments - adds directories to droiddoc template dependency lists, which is more correct, since we need to rerun on added or removed files too. Change-Id: Iff630bddb3818b8eeed439de7e41fc7fbe7cdcb0
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 8bae019c6..5d6a6e0e8 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -81,6 +81,7 @@ func testContext(config android.Config, bp string,
ctx.RegisterModuleType("genrule", android.ModuleFactoryAdaptor(genrule.GenRuleFactory))
ctx.RegisterModuleType("droiddoc", android.ModuleFactoryAdaptor(DroiddocFactory))
ctx.RegisterModuleType("droiddoc_host", android.ModuleFactoryAdaptor(DroiddocHostFactory))
+ ctx.RegisterModuleType("droiddoc_template", android.ModuleFactoryAdaptor(DroiddocTemplateFactory))
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
@@ -865,6 +866,10 @@ func TestSharding(t *testing.T) {
func TestDroiddoc(t *testing.T) {
ctx := testJava(t, `
+ droiddoc_template {
+ name: "droiddoc-templates-sdk",
+ path: ".",
+ }
droiddoc {
name: "bar-doc",
srcs: [
@@ -873,7 +878,7 @@ func TestDroiddoc(t *testing.T) {
exclude_srcs: [
"bar-doc/b.java"
],
- custom_template_dir: "external/doclava/templates-sdk",
+ custom_template: "droiddoc-templates-sdk",
hdf: [
"android.whichdoc offline",
],