blob: c1dc00bd3b81109ea833d7654506c4b3085730a6 [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: [
Anton Hansson77ff72f2021-03-30 10:11:22 +010061 ":framework-non-updatable-stub-sources",
Anton Hansson35c0b092021-03-30 10:46:48 +010062
63 // Module sources
Paul Duffin404b26a2020-09-16 14:26:47 +010064 ":art.module.public.api{.public.stubs.source}",
Paul Duffine55d4e32020-05-14 17:55:46 +010065 ":conscrypt.module.public.api{.public.stubs.source}",
Anton Hansson35c0b092021-03-30 10:46:48 +010066 ":framework-appsearch-sources",
67 ":framework-connectivity-sources",
68 ":framework-graphics-srcs",
69 ":framework-mediaprovider-sources",
70 ":framework-permission-sources",
71 ":framework-permission-s-sources",
72 ":framework-scheduling-sources",
73 ":framework-sdkextensions-sources",
74 ":framework-statsd-sources",
75 ":framework-tethering-srcs",
76 ":framework-wifi-updatable-sources",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000077 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson35c0b092021-03-30 10:46:48 +010078 ":ike-srcs",
79 ":updatable-media-srcs",
80
81 // No longer part of the stubs, but are included in the docs.
82 "test-base/src/**/*.java",
Jiyong Park7fb4b182019-12-20 14:35:43 +090083 "test-mock/src/**/*.java",
84 "test-runner/src/**/*.java",
85 ],
86 libs: framework_docs_only_libs,
87 create_doc_stubs: true,
88 annotations_enabled: true,
89 api_levels_annotations_enabled: true,
90 api_levels_annotations_dirs: [
91 "sdk-dir",
92 "api-versions-jars-dir",
93 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +010094 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +090095 merge_annotations_dirs: [
96 "metalava-manual",
97 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -070098 // TODO(b/169090544): remove below aidl includes.
99 aidl: {
100 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700101 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700102 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900103}
104
105droidstubs {
106 name: "framework-doc-stubs",
107 defaults: ["framework-doc-stubs-default"],
108 arg_files: [
109 "core/res/AndroidManifest.xml",
110 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000111 args: metalava_framework_docs_args +
112 // Needed for hidden libcore annotations for now.
113 " --ignore-classes-on-classpath ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900114 write_sdk_values: true,
115}
116
117droidstubs {
118 name: "framework-doc-system-stubs",
119 defaults: ["framework-doc-stubs-default"],
120 arg_files: [
121 "core/res/AndroidManifest.xml",
122 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000123 args: metalava_framework_docs_args +
124 // Needed for hidden libcore annotations for now.
125 " --ignore-classes-on-classpath " +
126 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900127 write_sdk_values: true,
128}
129
130/////////////////////////////////////////////////////////////////////
131// API docs are created from the generated stub source files
132// using droiddoc
133/////////////////////////////////////////////////////////////////////
134
135framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
136 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
137 "-overview $(location core/java/overview.html) " +
138 // Federate Support Library references against local API file.
139 "-federate SupportLib https://developer.android.com " +
140 "-federationapi SupportLib $(location :current-support-api) " +
141 // Federate Support Library references against local API file.
142 "-federate AndroidX https://developer.android.com " +
143 "-federationapi AndroidX $(location :current-androidx-api) "
144
145doc_defaults {
146 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000147 libs: framework_docs_only_libs + [
148 "stub-annotations",
149 "unsupportedappusage",
150 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900151 html_dirs: [
152 "docs/html",
153 ],
154 knowntags: [
155 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100156 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900157 ],
158 custom_template: "droiddoc-templates-sdk",
159 resourcesdir: "docs/html/reference/images/",
160 resourcesoutdir: "reference/android/images/",
161 hdf: [
162 "dac true",
163 "sdk.codename O",
164 "sdk.preview.version 1",
165 "sdk.version 7.0",
166 "sdk.rel.id 1",
167 "sdk.preview 0",
168 ],
169 arg_files: [
170 "core/res/AndroidManifest.xml",
171 "core/java/overview.html",
172 ":current-support-api",
173 ":current-androidx-api",
174 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700175 // TODO(b/169090544): remove below aidl includes.
176 aidl: {
177 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700178 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700179 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900180}
181
182doc_defaults {
183 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900184}
185
186droiddoc {
187 name: "doc-comment-check-docs",
188 defaults: ["framework-docs-default"],
189 srcs: [
190 ":framework-doc-stubs",
191 ],
192 args: framework_docs_only_args + " -referenceonly -parsecomments",
193 installable: false,
194}
195
196droiddoc {
197 name: "offline-sdk-docs",
198 defaults: ["framework-docs-default"],
199 srcs: [
200 ":framework-doc-stubs",
201 ],
202 hdf: [
203 "android.whichdoc offline",
204 ],
atrostb1ee27b2020-02-03 11:03:16 +0000205 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900206 proofread_file: "offline-sdk-docs-proofrerad.txt",
207 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
208 static_doc_index_redirect: "docs/docs-preview-index.html",
209}
210
211droiddoc {
212 // Please sync with android-api-council@ before making any changes for the name property below.
213 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
214 // See b/116221385 for reference.
215 name: "offline-sdk-referenceonly-docs",
216 defaults: ["framework-docs-default"],
217 srcs: [
218 ":framework-doc-stubs",
219 ],
220 hdf: [
221 "android.whichdoc offline",
222 ],
223 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
224 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
225 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
226 static_doc_properties: "docs/source.properties",
227}
228
229droiddoc {
230 // Please sync with android-api-council@ before making any changes for the name property below.
231 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
232 // See b/116221385 for reference.
233 name: "offline-system-sdk-referenceonly-docs",
234 defaults: ["framework-docs-default"],
235 srcs: [
236 ":framework-doc-system-stubs",
237 ],
238 hdf: [
239 "android.whichdoc offline",
240 ],
241 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
242 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
243 " -offlinemode -title \"Android System SDK\" -referenceonly",
244 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
245 static_doc_properties: "docs/source.properties",
246}
247
248droiddoc {
249 name: "online-sdk-docs",
250 defaults: ["framework-docs-default"],
251 srcs: [
252 ":framework-doc-stubs",
253 ],
254 hdf: [
255 "android.whichdoc online",
256 "android.hasSamples true",
257 ],
258 proofread_file: "online-sdk-docs-proofrerad.txt",
259 args: framework_docs_only_args +
260 " -toroot / -samplegroup Admin " +
261 " -samplegroup Background " +
262 " -samplegroup Connectivity " +
263 " -samplegroup Content " +
264 " -samplegroup Input " +
265 " -samplegroup Media " +
266 " -samplegroup Notification " +
267 " -samplegroup RenderScript " +
268 " -samplegroup Security " +
269 " -samplegroup Sensors " +
270 " -samplegroup System " +
271 " -samplegroup Testing " +
272 " -samplegroup UI " +
273 " -samplegroup Views " +
274 " -samplegroup Wearable -samplesdir development/samples/browseable ",
275}
276
277droiddoc {
278 name: "online-system-api-sdk-docs",
279 defaults: ["framework-docs-default"],
280 srcs: [
281 ":framework-doc-system-stubs",
282 ],
283 hdf: [
284 "android.whichdoc online",
285 "android.hasSamples true",
286 ],
287 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
288 args: framework_docs_only_args +
289 " -referenceonly " +
290 " -title \"Android SDK - Including system APIs.\" " +
291 " -hide 101 " +
292 " -hide 104 " +
293 " -hide 108 " +
294 " -toroot / -samplegroup Admin " +
295 " -samplegroup Background " +
296 " -samplegroup Connectivity " +
297 " -samplegroup Content " +
298 " -samplegroup Input " +
299 " -samplegroup Media " +
300 " -samplegroup Notification " +
301 " -samplegroup RenderScript " +
302 " -samplegroup Security " +
303 " -samplegroup Sensors " +
304 " -samplegroup System " +
305 " -samplegroup Testing " +
306 " -samplegroup UI " +
307 " -samplegroup Views " +
308 " -samplegroup Wearable -samplesdir development/samples/browseable ",
309 installable: false,
310}
311
312droiddoc {
313 name: "ds-docs-java",
314 defaults: ["framework-docs-default"],
315 srcs: [
316 ":framework-doc-stubs",
317 ],
318 hdf: [
319 "android.whichdoc online",
320 "android.hasSamples true",
321 ],
322 proofread_file: "ds-docs-proofrerad.txt",
323 args: framework_docs_only_args +
324 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
325 " -samplegroup Background " +
326 " -samplegroup Connectivity " +
327 " -samplegroup Content " +
328 " -samplegroup Input " +
329 " -samplegroup Media " +
330 " -samplegroup Notification " +
331 " -samplegroup RenderScript " +
332 " -samplegroup Security " +
333 " -samplegroup Sensors " +
334 " -samplegroup System " +
335 " -samplegroup Testing " +
336 " -samplegroup UI " +
337 " -samplegroup Views " +
338 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
339}
340
341droiddoc {
342 name: "ds-docs-kt",
343 defaults: ["framework-dokka-docs-default"],
344 srcs: [
345 ":framework-doc-stubs",
346 ],
347 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700348 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900349 proofread_file: "ds-dokka-proofread.txt",
350 dokka_enabled: true,
351}
352
353java_genrule {
354 name: "ds-docs",
355 tools: [
356 "zip2zip",
357 "merge_zips",
358 ],
359 srcs: [
360 ":ds-docs-java{.docs.zip}",
361 ":ds-docs-kt{.docs.zip}",
362 ],
363 out: ["ds-docs.zip"],
364 dist: {
365 targets: ["docs"],
366 },
367 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 -0700368 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900369}
370
371java_genrule {
372 name: "ds-docs-switched",
373 tools: [
374 "switcher4",
375 "soong_zip",
376 ],
377 srcs: [
378 ":ds-docs-java{.docs.zip}",
379 ":ds-docs-kt{.docs.zip}",
380 ],
381 out: ["ds-docs-switched.zip"],
382 dist: {
383 targets: ["docs"],
384 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800385 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700386 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
387 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
388 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
389 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900390}
391
392droiddoc {
393 name: "ds-static-docs",
394 defaults: ["framework-docs-default"],
395 srcs: [
396 ":framework-doc-stubs",
397 ],
398 hdf: [
399 "android.whichdoc online",
400 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900401 args: framework_docs_only_args +
402 " -staticonly " +
403 " -toroot / " +
404 " -devsite " +
405 " -ignoreJdLinks ",
406}
407
408droiddoc {
409 name: "ds-ref-navtree-docs",
410 defaults: ["framework-docs-default"],
411 srcs: [
412 ":framework-doc-stubs",
413 ],
414 hdf: [
415 "android.whichdoc online",
416 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900417 args: framework_docs_only_args +
418 " -toroot / " +
419 " -atLinksNavtree " +
420 " -navtreeonly ",
421}
422
423droiddoc {
424 name: "online-sdk-dev-docs",
425 defaults: ["framework-docs-default"],
426 srcs: [
427 ":framework-doc-stubs",
428 ],
429 hdf: [
430 "android.whichdoc online",
431 "android.hasSamples true",
432 ],
433 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
434 args: framework_docs_only_args +
435 " -toroot / -samplegroup Admin " +
436 " -samplegroup Background " +
437 " -samplegroup Connectivity " +
438 " -samplegroup Content " +
439 " -samplegroup Input " +
440 " -samplegroup Media " +
441 " -samplegroup Notification " +
442 " -samplegroup RenderScript " +
443 " -samplegroup Security " +
444 " -samplegroup Sensors " +
445 " -samplegroup System " +
446 " -samplegroup Testing " +
447 " -samplegroup UI " +
448 " -samplegroup Views " +
449 " -samplegroup Wearable -samplesdir development/samples/browseable ",
450}
451
452droiddoc {
453 name: "hidden-docs",
454 defaults: ["framework-docs-default"],
455 srcs: [
456 ":framework-doc-stubs",
457 ],
458 proofread_file: "hidden-docs-proofrerad.txt",
459 args: framework_docs_only_args +
460 " -referenceonly " +
461 " -title \"Android SDK - Including hidden APIs.\"",
462}