blob: ada80bbc9874183e5599e152a5dd73ed106b234d [file] [log] [blame]
Jiyong Park7fb4b182019-12-20 14:35:43 +09001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// How API docs are generated:
16//
17// raw source files --(metalava)--> stub source files --(doclava)--> API doc
18//
19// The metalava conversion is done by droidstub modules framework-doc-*-stubs.
20// The API doc generation is done by the various droiddoc modules each of which
21// is for different format.
22
23/////////////////////////////////////////////////////////////////////
24// stub source files are generated using metalava
25/////////////////////////////////////////////////////////////////////
26
27framework_docs_only_libs = [
28 "voip-common",
29 "android.test.mock",
30 "android-support-annotations",
31 "android-support-compat",
32 "android-support-core-ui",
33 "android-support-core-utils",
34 "android-support-design",
35 "android-support-dynamic-animation",
36 "android-support-exifinterface",
37 "android-support-fragment",
38 "android-support-media-compat",
39 "android-support-percent",
40 "android-support-transition",
41 "android-support-v7-cardview",
42 "android-support-v7-gridlayout",
43 "android-support-v7-mediarouter",
44 "android-support-v7-palette",
45 "android-support-v7-preference",
46 "android-support-v13",
47 "android-support-v14-preference",
48 "android-support-v17-leanback",
49 "android-support-vectordrawable",
50 "android-support-animatedvectordrawable",
51 "android-support-v7-appcompat",
52 "android-support-v7-recyclerview",
53 "android-support-v8-renderscript",
54 "android-support-multidex",
55 "android-support-multidex-instrumentation",
56]
57
58stubs_defaults {
59 name: "framework-doc-stubs-default",
60 srcs: [
61 ":framework-mime-sources",
62 ":framework-non-updatable-sources",
63 ":framework-updatable-sources",
64 "core/java/**/*.logtags",
65 "test-base/src/**/*.java",
66 ":opt-telephony-srcs",
67 ":opt-net-voip-srcs",
Paul Duffin404b26a2020-09-16 14:26:47 +010068 ":art.module.public.api{.public.stubs.source}",
Paul Duffine55d4e32020-05-14 17:55:46 +010069 ":conscrypt.module.public.api{.public.stubs.source}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000070 ":i18n.module.public.api{.public.stubs.source}",
Jiyong Park7fb4b182019-12-20 14:35:43 +090071 "test-mock/src/**/*.java",
72 "test-runner/src/**/*.java",
73 ],
74 libs: framework_docs_only_libs,
75 create_doc_stubs: true,
76 annotations_enabled: true,
77 api_levels_annotations_enabled: true,
78 api_levels_annotations_dirs: [
79 "sdk-dir",
80 "api-versions-jars-dir",
81 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +010082 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +090083 merge_annotations_dirs: [
84 "metalava-manual",
85 ],
86}
87
88droidstubs {
89 name: "framework-doc-stubs",
90 defaults: ["framework-doc-stubs-default"],
91 arg_files: [
92 "core/res/AndroidManifest.xml",
93 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +000094 args: metalava_framework_docs_args +
95 // Needed for hidden libcore annotations for now.
96 " --ignore-classes-on-classpath ",
Jiyong Park7fb4b182019-12-20 14:35:43 +090097 write_sdk_values: true,
98}
99
100droidstubs {
101 name: "framework-doc-system-stubs",
102 defaults: ["framework-doc-stubs-default"],
103 arg_files: [
104 "core/res/AndroidManifest.xml",
105 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000106 args: metalava_framework_docs_args +
107 // Needed for hidden libcore annotations for now.
108 " --ignore-classes-on-classpath " +
109 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900110 write_sdk_values: true,
111}
112
113/////////////////////////////////////////////////////////////////////
114// API docs are created from the generated stub source files
115// using droiddoc
116/////////////////////////////////////////////////////////////////////
117
118framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
119 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
120 "-overview $(location core/java/overview.html) " +
121 // Federate Support Library references against local API file.
122 "-federate SupportLib https://developer.android.com " +
123 "-federationapi SupportLib $(location :current-support-api) " +
124 // Federate Support Library references against local API file.
125 "-federate AndroidX https://developer.android.com " +
126 "-federationapi AndroidX $(location :current-androidx-api) "
127
128doc_defaults {
129 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000130 libs: framework_docs_only_libs + [
131 "stub-annotations",
132 "unsupportedappusage",
133 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900134 html_dirs: [
135 "docs/html",
136 ],
137 knowntags: [
138 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100139 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900140 ],
141 custom_template: "droiddoc-templates-sdk",
142 resourcesdir: "docs/html/reference/images/",
143 resourcesoutdir: "reference/android/images/",
144 hdf: [
145 "dac true",
146 "sdk.codename O",
147 "sdk.preview.version 1",
148 "sdk.version 7.0",
149 "sdk.rel.id 1",
150 "sdk.preview 0",
151 ],
152 arg_files: [
153 "core/res/AndroidManifest.xml",
154 "core/java/overview.html",
155 ":current-support-api",
156 ":current-androidx-api",
157 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900158}
159
160doc_defaults {
161 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900162}
163
164droiddoc {
165 name: "doc-comment-check-docs",
166 defaults: ["framework-docs-default"],
167 srcs: [
168 ":framework-doc-stubs",
169 ],
170 args: framework_docs_only_args + " -referenceonly -parsecomments",
171 installable: false,
172}
173
174droiddoc {
175 name: "offline-sdk-docs",
176 defaults: ["framework-docs-default"],
177 srcs: [
178 ":framework-doc-stubs",
179 ],
180 hdf: [
181 "android.whichdoc offline",
182 ],
atrostb1ee27b2020-02-03 11:03:16 +0000183 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900184 proofread_file: "offline-sdk-docs-proofrerad.txt",
185 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
186 static_doc_index_redirect: "docs/docs-preview-index.html",
187}
188
189droiddoc {
190 // Please sync with android-api-council@ before making any changes for the name property below.
191 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
192 // See b/116221385 for reference.
193 name: "offline-sdk-referenceonly-docs",
194 defaults: ["framework-docs-default"],
195 srcs: [
196 ":framework-doc-stubs",
197 ],
198 hdf: [
199 "android.whichdoc offline",
200 ],
201 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
202 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
203 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
204 static_doc_properties: "docs/source.properties",
205}
206
207droiddoc {
208 // Please sync with android-api-council@ before making any changes for the name property below.
209 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
210 // See b/116221385 for reference.
211 name: "offline-system-sdk-referenceonly-docs",
212 defaults: ["framework-docs-default"],
213 srcs: [
214 ":framework-doc-system-stubs",
215 ],
216 hdf: [
217 "android.whichdoc offline",
218 ],
219 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
220 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
221 " -offlinemode -title \"Android System SDK\" -referenceonly",
222 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
223 static_doc_properties: "docs/source.properties",
224}
225
226droiddoc {
227 name: "online-sdk-docs",
228 defaults: ["framework-docs-default"],
229 srcs: [
230 ":framework-doc-stubs",
231 ],
232 hdf: [
233 "android.whichdoc online",
234 "android.hasSamples true",
235 ],
236 proofread_file: "online-sdk-docs-proofrerad.txt",
237 args: framework_docs_only_args +
238 " -toroot / -samplegroup Admin " +
239 " -samplegroup Background " +
240 " -samplegroup Connectivity " +
241 " -samplegroup Content " +
242 " -samplegroup Input " +
243 " -samplegroup Media " +
244 " -samplegroup Notification " +
245 " -samplegroup RenderScript " +
246 " -samplegroup Security " +
247 " -samplegroup Sensors " +
248 " -samplegroup System " +
249 " -samplegroup Testing " +
250 " -samplegroup UI " +
251 " -samplegroup Views " +
252 " -samplegroup Wearable -samplesdir development/samples/browseable ",
253}
254
255droiddoc {
256 name: "online-system-api-sdk-docs",
257 defaults: ["framework-docs-default"],
258 srcs: [
259 ":framework-doc-system-stubs",
260 ],
261 hdf: [
262 "android.whichdoc online",
263 "android.hasSamples true",
264 ],
265 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
266 args: framework_docs_only_args +
267 " -referenceonly " +
268 " -title \"Android SDK - Including system APIs.\" " +
269 " -hide 101 " +
270 " -hide 104 " +
271 " -hide 108 " +
272 " -toroot / -samplegroup Admin " +
273 " -samplegroup Background " +
274 " -samplegroup Connectivity " +
275 " -samplegroup Content " +
276 " -samplegroup Input " +
277 " -samplegroup Media " +
278 " -samplegroup Notification " +
279 " -samplegroup RenderScript " +
280 " -samplegroup Security " +
281 " -samplegroup Sensors " +
282 " -samplegroup System " +
283 " -samplegroup Testing " +
284 " -samplegroup UI " +
285 " -samplegroup Views " +
286 " -samplegroup Wearable -samplesdir development/samples/browseable ",
287 installable: false,
288}
289
290droiddoc {
291 name: "ds-docs-java",
292 defaults: ["framework-docs-default"],
293 srcs: [
294 ":framework-doc-stubs",
295 ],
296 hdf: [
297 "android.whichdoc online",
298 "android.hasSamples true",
299 ],
300 proofread_file: "ds-docs-proofrerad.txt",
301 args: framework_docs_only_args +
302 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
303 " -samplegroup Background " +
304 " -samplegroup Connectivity " +
305 " -samplegroup Content " +
306 " -samplegroup Input " +
307 " -samplegroup Media " +
308 " -samplegroup Notification " +
309 " -samplegroup RenderScript " +
310 " -samplegroup Security " +
311 " -samplegroup Sensors " +
312 " -samplegroup System " +
313 " -samplegroup Testing " +
314 " -samplegroup UI " +
315 " -samplegroup Views " +
316 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
317}
318
319droiddoc {
320 name: "ds-docs-kt",
321 defaults: ["framework-dokka-docs-default"],
322 srcs: [
323 ":framework-doc-stubs",
324 ],
325 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700326 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900327 proofread_file: "ds-dokka-proofread.txt",
328 dokka_enabled: true,
329}
330
331java_genrule {
332 name: "ds-docs",
333 tools: [
334 "zip2zip",
335 "merge_zips",
336 ],
337 srcs: [
338 ":ds-docs-java{.docs.zip}",
339 ":ds-docs-kt{.docs.zip}",
340 ],
341 out: ["ds-docs.zip"],
342 dist: {
343 targets: ["docs"],
344 },
345 cmd: "$(location zip2zip) -i $(location :ds-docs-kt{.docs.zip}) -o $(genDir)/ds-docs-kt-moved.zip **/*:en/reference/kotlin && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700346 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900347}
348
349java_genrule {
350 name: "ds-docs-switched",
351 tools: [
352 "switcher4",
353 "soong_zip",
354 ],
355 srcs: [
356 ":ds-docs-java{.docs.zip}",
357 ":ds-docs-kt{.docs.zip}",
358 ],
359 out: ["ds-docs-switched.zip"],
360 dist: {
361 targets: ["docs"],
362 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800363 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700364 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
365 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
366 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
367 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900368}
369
370droiddoc {
371 name: "ds-static-docs",
372 defaults: ["framework-docs-default"],
373 srcs: [
374 ":framework-doc-stubs",
375 ],
376 hdf: [
377 "android.whichdoc online",
378 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900379 args: framework_docs_only_args +
380 " -staticonly " +
381 " -toroot / " +
382 " -devsite " +
383 " -ignoreJdLinks ",
384}
385
386droiddoc {
387 name: "ds-ref-navtree-docs",
388 defaults: ["framework-docs-default"],
389 srcs: [
390 ":framework-doc-stubs",
391 ],
392 hdf: [
393 "android.whichdoc online",
394 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900395 args: framework_docs_only_args +
396 " -toroot / " +
397 " -atLinksNavtree " +
398 " -navtreeonly ",
399}
400
401droiddoc {
402 name: "online-sdk-dev-docs",
403 defaults: ["framework-docs-default"],
404 srcs: [
405 ":framework-doc-stubs",
406 ],
407 hdf: [
408 "android.whichdoc online",
409 "android.hasSamples true",
410 ],
411 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
412 args: framework_docs_only_args +
413 " -toroot / -samplegroup Admin " +
414 " -samplegroup Background " +
415 " -samplegroup Connectivity " +
416 " -samplegroup Content " +
417 " -samplegroup Input " +
418 " -samplegroup Media " +
419 " -samplegroup Notification " +
420 " -samplegroup RenderScript " +
421 " -samplegroup Security " +
422 " -samplegroup Sensors " +
423 " -samplegroup System " +
424 " -samplegroup Testing " +
425 " -samplegroup UI " +
426 " -samplegroup Views " +
427 " -samplegroup Wearable -samplesdir development/samples/browseable ",
428}
429
430droiddoc {
431 name: "hidden-docs",
432 defaults: ["framework-docs-default"],
433 srcs: [
434 ":framework-doc-stubs",
435 ],
436 proofread_file: "hidden-docs-proofrerad.txt",
437 args: framework_docs_only_args +
438 " -referenceonly " +
439 " -title \"Android SDK - Including hidden APIs.\"",
440}