blob: 65a6547b4493b1b15abfa1bf58c067a1d389df04 [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 {
Anton Hanssonc7f5e7d2021-05-05 10:32:31 +010059 name: "android-non-updatable-doc-stubs-defaults",
60 defaults: ["android-non-updatable-stubs-defaults"],
61 srcs: [
62 // No longer part of the stubs, but are included in the docs.
63 "test-base/src/**/*.java",
64 "test-mock/src/**/*.java",
65 "test-runner/src/**/*.java",
66 ],
67 libs: framework_docs_only_libs,
68 create_doc_stubs: true,
69 write_sdk_values: true,
70}
71
72stubs_defaults {
Jiyong Park7fb4b182019-12-20 14:35:43 +090073 name: "framework-doc-stubs-default",
74 srcs: [
Anton Hanssonc7f5e7d2021-05-05 10:32:31 +010075 ":android-non-updatable-stub-sources",
Anton Hansson703cde02021-03-30 10:46:48 +010076
77 // Module sources
Paul Duffin404b26a2020-09-16 14:26:47 +010078 ":art.module.public.api{.public.stubs.source}",
Paul Duffine55d4e32020-05-14 17:55:46 +010079 ":conscrypt.module.public.api{.public.stubs.source}",
Anton Hansson703cde02021-03-30 10:46:48 +010080 ":framework-connectivity-sources",
81 ":framework-mediaprovider-sources",
82 ":framework-permission-sources",
83 ":framework-sdkextensions-sources",
84 ":framework-statsd-sources",
85 ":framework-tethering-srcs",
86 ":framework-wifi-updatable-sources",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000087 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson703cde02021-03-30 10:46:48 +010088 ":ike-srcs",
89 ":updatable-media-srcs",
90
91 // No longer part of the stubs, but are included in the docs.
Anton Hansson2e25fdc2021-05-10 12:40:05 +010092 ":android-test-base-sources",
93 ":android-test-mock-sources",
94 ":android-test-runner-sources",
Jiyong Park7fb4b182019-12-20 14:35:43 +090095 ],
96 libs: framework_docs_only_libs,
97 create_doc_stubs: true,
98 annotations_enabled: true,
Anton Hansson76ac4cc2021-05-05 19:22:52 +010099 filter_packages: packages_to_document,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900100 api_levels_annotations_enabled: true,
101 api_levels_annotations_dirs: [
102 "sdk-dir",
103 "api-versions-jars-dir",
104 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +0100105 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900106 merge_annotations_dirs: [
107 "metalava-manual",
108 ],
109}
110
111droidstubs {
Anton Hanssonc7f5e7d2021-05-05 10:32:31 +0100112 name: "android-non-updatable-doc-stubs",
113 defaults: ["android-non-updatable-doc-stubs-defaults"],
114 args: metalava_framework_docs_args,
115}
116
117droidstubs {
118 name: "android-non-updatable-doc-stubs-system",
119 defaults: ["android-non-updatable-doc-stubs-defaults"],
120 args: metalava_framework_docs_args +
121 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
122}
123
124droidstubs {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900125 name: "framework-doc-stubs",
126 defaults: ["framework-doc-stubs-default"],
127 arg_files: [
128 "core/res/AndroidManifest.xml",
129 ],
Anton Hansson26c843f2021-05-05 11:11:57 +0100130 args: metalava_framework_docs_args,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900131 write_sdk_values: true,
132}
133
134droidstubs {
135 name: "framework-doc-system-stubs",
136 defaults: ["framework-doc-stubs-default"],
137 arg_files: [
138 "core/res/AndroidManifest.xml",
139 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000140 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000141 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900142 write_sdk_values: true,
satayevbc7c83e2021-06-29 22:27:06 +0100143 api_levels_sdk_type: "system",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900144}
145
146/////////////////////////////////////////////////////////////////////
147// API docs are created from the generated stub source files
148// using droiddoc
149/////////////////////////////////////////////////////////////////////
150
151framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
152 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
153 "-overview $(location core/java/overview.html) " +
154 // Federate Support Library references against local API file.
155 "-federate SupportLib https://developer.android.com " +
156 "-federationapi SupportLib $(location :current-support-api) " +
157 // Federate Support Library references against local API file.
158 "-federate AndroidX https://developer.android.com " +
159 "-federationapi AndroidX $(location :current-androidx-api) "
160
161doc_defaults {
162 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000163 libs: framework_docs_only_libs + [
164 "stub-annotations",
165 "unsupportedappusage",
166 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900167 html_dirs: [
168 "docs/html",
169 ],
170 knowntags: [
171 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100172 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900173 ],
174 custom_template: "droiddoc-templates-sdk",
175 resourcesdir: "docs/html/reference/images/",
176 resourcesoutdir: "reference/android/images/",
177 hdf: [
178 "dac true",
179 "sdk.codename O",
180 "sdk.preview.version 1",
181 "sdk.version 7.0",
182 "sdk.rel.id 1",
183 "sdk.preview 0",
184 ],
185 arg_files: [
186 "core/res/AndroidManifest.xml",
187 "core/java/overview.html",
188 ":current-support-api",
189 ":current-androidx-api",
190 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900191}
192
193doc_defaults {
194 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900195}
196
197droiddoc {
198 name: "doc-comment-check-docs",
199 defaults: ["framework-docs-default"],
200 srcs: [
201 ":framework-doc-stubs",
202 ],
203 args: framework_docs_only_args + " -referenceonly -parsecomments",
204 installable: false,
205}
206
207droiddoc {
208 name: "offline-sdk-docs",
209 defaults: ["framework-docs-default"],
210 srcs: [
211 ":framework-doc-stubs",
212 ],
213 hdf: [
214 "android.whichdoc offline",
215 ],
atrostb1ee27b2020-02-03 11:03:16 +0000216 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900217 proofread_file: "offline-sdk-docs-proofrerad.txt",
218 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
219 static_doc_index_redirect: "docs/docs-preview-index.html",
220}
221
222droiddoc {
223 // Please sync with android-api-council@ before making any changes for the name property below.
224 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
225 // See b/116221385 for reference.
226 name: "offline-sdk-referenceonly-docs",
227 defaults: ["framework-docs-default"],
228 srcs: [
229 ":framework-doc-stubs",
230 ],
231 hdf: [
232 "android.whichdoc offline",
233 ],
234 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
235 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
236 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
237 static_doc_properties: "docs/source.properties",
238}
239
240droiddoc {
241 // Please sync with android-api-council@ before making any changes for the name property below.
242 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
243 // See b/116221385 for reference.
244 name: "offline-system-sdk-referenceonly-docs",
245 defaults: ["framework-docs-default"],
246 srcs: [
247 ":framework-doc-system-stubs",
248 ],
249 hdf: [
250 "android.whichdoc offline",
251 ],
252 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
253 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
254 " -offlinemode -title \"Android System SDK\" -referenceonly",
255 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
256 static_doc_properties: "docs/source.properties",
257}
258
259droiddoc {
260 name: "online-sdk-docs",
261 defaults: ["framework-docs-default"],
262 srcs: [
263 ":framework-doc-stubs",
264 ],
265 hdf: [
266 "android.whichdoc online",
267 "android.hasSamples true",
268 ],
269 proofread_file: "online-sdk-docs-proofrerad.txt",
270 args: framework_docs_only_args +
271 " -toroot / -samplegroup Admin " +
272 " -samplegroup Background " +
273 " -samplegroup Connectivity " +
274 " -samplegroup Content " +
275 " -samplegroup Input " +
276 " -samplegroup Media " +
277 " -samplegroup Notification " +
278 " -samplegroup RenderScript " +
279 " -samplegroup Security " +
280 " -samplegroup Sensors " +
281 " -samplegroup System " +
282 " -samplegroup Testing " +
283 " -samplegroup UI " +
284 " -samplegroup Views " +
285 " -samplegroup Wearable -samplesdir development/samples/browseable ",
286}
287
288droiddoc {
289 name: "online-system-api-sdk-docs",
290 defaults: ["framework-docs-default"],
291 srcs: [
292 ":framework-doc-system-stubs",
293 ],
294 hdf: [
295 "android.whichdoc online",
296 "android.hasSamples true",
297 ],
298 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
299 args: framework_docs_only_args +
300 " -referenceonly " +
301 " -title \"Android SDK - Including system APIs.\" " +
302 " -hide 101 " +
303 " -hide 104 " +
304 " -hide 108 " +
305 " -toroot / -samplegroup Admin " +
306 " -samplegroup Background " +
307 " -samplegroup Connectivity " +
308 " -samplegroup Content " +
309 " -samplegroup Input " +
310 " -samplegroup Media " +
311 " -samplegroup Notification " +
312 " -samplegroup RenderScript " +
313 " -samplegroup Security " +
314 " -samplegroup Sensors " +
315 " -samplegroup System " +
316 " -samplegroup Testing " +
317 " -samplegroup UI " +
318 " -samplegroup Views " +
319 " -samplegroup Wearable -samplesdir development/samples/browseable ",
320 installable: false,
321}
322
323droiddoc {
324 name: "ds-docs-java",
325 defaults: ["framework-docs-default"],
326 srcs: [
327 ":framework-doc-stubs",
328 ],
329 hdf: [
330 "android.whichdoc online",
331 "android.hasSamples true",
332 ],
333 proofread_file: "ds-docs-proofrerad.txt",
334 args: framework_docs_only_args +
335 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
336 " -samplegroup Background " +
337 " -samplegroup Connectivity " +
338 " -samplegroup Content " +
339 " -samplegroup Input " +
340 " -samplegroup Media " +
341 " -samplegroup Notification " +
342 " -samplegroup RenderScript " +
343 " -samplegroup Security " +
344 " -samplegroup Sensors " +
345 " -samplegroup System " +
346 " -samplegroup Testing " +
347 " -samplegroup UI " +
348 " -samplegroup Views " +
349 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
350}
351
352droiddoc {
353 name: "ds-docs-kt",
354 defaults: ["framework-dokka-docs-default"],
355 srcs: [
356 ":framework-doc-stubs",
357 ],
358 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700359 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900360 proofread_file: "ds-dokka-proofread.txt",
361 dokka_enabled: true,
362}
363
364java_genrule {
365 name: "ds-docs",
366 tools: [
367 "zip2zip",
368 "merge_zips",
369 ],
370 srcs: [
371 ":ds-docs-java{.docs.zip}",
372 ":ds-docs-kt{.docs.zip}",
373 ],
374 out: ["ds-docs.zip"],
375 dist: {
376 targets: ["docs"],
377 },
378 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 -0700379 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900380}
381
382java_genrule {
383 name: "ds-docs-switched",
384 tools: [
385 "switcher4",
386 "soong_zip",
387 ],
388 srcs: [
389 ":ds-docs-java{.docs.zip}",
390 ":ds-docs-kt{.docs.zip}",
391 ],
392 out: ["ds-docs-switched.zip"],
393 dist: {
394 targets: ["docs"],
395 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800396 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700397 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
398 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
399 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
400 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900401}
402
403droiddoc {
404 name: "ds-static-docs",
405 defaults: ["framework-docs-default"],
406 srcs: [
407 ":framework-doc-stubs",
408 ],
409 hdf: [
410 "android.whichdoc online",
411 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900412 args: framework_docs_only_args +
413 " -staticonly " +
414 " -toroot / " +
415 " -devsite " +
416 " -ignoreJdLinks ",
417}
418
419droiddoc {
420 name: "ds-ref-navtree-docs",
421 defaults: ["framework-docs-default"],
422 srcs: [
423 ":framework-doc-stubs",
424 ],
425 hdf: [
426 "android.whichdoc online",
427 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900428 args: framework_docs_only_args +
429 " -toroot / " +
430 " -atLinksNavtree " +
431 " -navtreeonly ",
432}
433
434droiddoc {
435 name: "online-sdk-dev-docs",
436 defaults: ["framework-docs-default"],
437 srcs: [
438 ":framework-doc-stubs",
439 ],
440 hdf: [
441 "android.whichdoc online",
442 "android.hasSamples true",
443 ],
444 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
445 args: framework_docs_only_args +
446 " -toroot / -samplegroup Admin " +
447 " -samplegroup Background " +
448 " -samplegroup Connectivity " +
449 " -samplegroup Content " +
450 " -samplegroup Input " +
451 " -samplegroup Media " +
452 " -samplegroup Notification " +
453 " -samplegroup RenderScript " +
454 " -samplegroup Security " +
455 " -samplegroup Sensors " +
456 " -samplegroup System " +
457 " -samplegroup Testing " +
458 " -samplegroup UI " +
459 " -samplegroup Views " +
460 " -samplegroup Wearable -samplesdir development/samples/browseable ",
461}
462
463droiddoc {
464 name: "hidden-docs",
465 defaults: ["framework-docs-default"],
466 srcs: [
467 ":framework-doc-stubs",
468 ],
469 proofread_file: "hidden-docs-proofrerad.txt",
470 args: framework_docs_only_args +
471 " -referenceonly " +
472 " -title \"Android SDK - Including hidden APIs.\"",
473}