Update droiddoc with combined generation of Java and Kotlin docs

Due to ownership change, this CL is a combination of the two CLs:

1) 1102398: Added droiddoc module to combined dokka, doclava and add
switcher.

Added ds-docs-switched that merges outputs of dokka, doclava, and
applies switcher4 to them.

Bug: 128540915
Test: m -j ds-docs-switched

===

2) 1098541: Combined target for dokka and doclava

Created a droiddoc module that creates reference docs using Kotlin.
Renamed droiddoc modules that only create one language ref-docs, and
created a genrule that merges them together.

Bug: 72394196
Bug: 138396395
Test: m -j ds-docs-kt
Test: m -j ds-docs-java
Test: m -j ds-docs

===

Change-Id: If9bed782feae84e986395a9ea6401025a51bc316
This commit is contained in:
Tiem Song
2019-08-26 11:27:27 -07:00
parent 660898768f
commit 730c19b99d

View File

@@ -849,6 +849,11 @@ doc_defaults {
create_stubs: false,
}
doc_defaults {
name: "framework-dokka-docs-default",
create_stubs: false,
}
stubs_defaults {
name: "metalava-api-stubs-default",
srcs: [
@@ -1020,7 +1025,7 @@ droiddoc {
}
droiddoc {
name: "ds-docs",
name: "ds-docs-java",
defaults: ["framework-docs-default"],
srcs: [
":framework-doc-stubs",
@@ -1048,6 +1053,58 @@ droiddoc {
" -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
}
droiddoc {
name: "ds-docs-kt",
defaults: ["framework-dokka-docs-default"],
srcs: [
":framework-doc-stubs",
],
args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
"-noStdlibLink",
proofread_file: "ds-dokka-proofread.txt",
dokka_enabled: true,
}
java_genrule {
name: "ds-docs",
tools: [
"zip2zip",
"merge_zips",
],
srcs: [
":ds-docs-java{.docs.zip}",
":ds-docs-kt{.docs.zip}",
],
out: ["ds-docs.zip"],
dist: {
targets: ["docs"],
},
cmd: "$(location zip2zip) -i $(location :ds-docs-kt{.docs.zip}) -o $(genDir)/ds-docs-kt-moved.zip **/*:en/reference/kotlin && " +
"$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
}
java_genrule {
name: "ds-docs-switched",
tools: [
"switcher4",
"soong_zip",
],
srcs: [
":ds-docs-java{.docs.zip}",
":ds-docs-kt{.docs.zip}",
],
out: ["ds-docs-switched.zip"],
dist: {
targets: ["docs"],
},
cmd: "unzip $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
"unzip $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
"SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
"(cd $(genDir)/en/reference && $$SWITCHER --work platform) && " +
"$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
}
droiddoc {
name: "ds-static-docs",
defaults: ["framework-docs-default"],