blob: 3862795ce87ff1647012d43e16e5471a5ba66487 [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 Hansson26c843f2021-05-05 11:11:57 +0100111 args: metalava_framework_docs_args,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900112 write_sdk_values: true,
113}
114
115droidstubs {
116 name: "framework-doc-system-stubs",
117 defaults: ["framework-doc-stubs-default"],
118 arg_files: [
119 "core/res/AndroidManifest.xml",
120 ],
Anton Hansson121ccbc2020-12-17 14:56:06 +0000121 args: metalava_framework_docs_args +
Anton Hansson121ccbc2020-12-17 14:56:06 +0000122 " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900123 write_sdk_values: true,
124}
125
126/////////////////////////////////////////////////////////////////////
127// API docs are created from the generated stub source files
128// using droiddoc
129/////////////////////////////////////////////////////////////////////
130
131framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
132 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
133 "-overview $(location core/java/overview.html) " +
134 // Federate Support Library references against local API file.
135 "-federate SupportLib https://developer.android.com " +
136 "-federationapi SupportLib $(location :current-support-api) " +
137 // Federate Support Library references against local API file.
138 "-federate AndroidX https://developer.android.com " +
139 "-federationapi AndroidX $(location :current-androidx-api) "
140
141doc_defaults {
142 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000143 libs: framework_docs_only_libs + [
144 "stub-annotations",
145 "unsupportedappusage",
146 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900147 html_dirs: [
148 "docs/html",
149 ],
150 knowntags: [
151 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100152 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900153 ],
154 custom_template: "droiddoc-templates-sdk",
155 resourcesdir: "docs/html/reference/images/",
156 resourcesoutdir: "reference/android/images/",
157 hdf: [
158 "dac true",
159 "sdk.codename O",
160 "sdk.preview.version 1",
161 "sdk.version 7.0",
162 "sdk.rel.id 1",
163 "sdk.preview 0",
164 ],
165 arg_files: [
166 "core/res/AndroidManifest.xml",
167 "core/java/overview.html",
168 ":current-support-api",
169 ":current-androidx-api",
170 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700171 // TODO(b/169090544): remove below aidl includes.
172 aidl: {
173 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700174 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700175 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900176}
177
178doc_defaults {
179 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900180}
181
182droiddoc {
183 name: "doc-comment-check-docs",
184 defaults: ["framework-docs-default"],
185 srcs: [
186 ":framework-doc-stubs",
187 ],
188 args: framework_docs_only_args + " -referenceonly -parsecomments",
189 installable: false,
190}
191
192droiddoc {
193 name: "offline-sdk-docs",
194 defaults: ["framework-docs-default"],
195 srcs: [
196 ":framework-doc-stubs",
197 ],
198 hdf: [
199 "android.whichdoc offline",
200 ],
atrostb1ee27b2020-02-03 11:03:16 +0000201 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900202 proofread_file: "offline-sdk-docs-proofrerad.txt",
203 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
204 static_doc_index_redirect: "docs/docs-preview-index.html",
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-sdk-referenceonly-docs-docs.zip periodically.
210 // See b/116221385 for reference.
211 name: "offline-sdk-referenceonly-docs",
212 defaults: ["framework-docs-default"],
213 srcs: [
214 ":framework-doc-stubs",
215 ],
216 hdf: [
217 "android.whichdoc offline",
218 ],
219 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
220 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
221 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
222 static_doc_properties: "docs/source.properties",
223}
224
225droiddoc {
226 // Please sync with android-api-council@ before making any changes for the name property below.
227 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
228 // See b/116221385 for reference.
229 name: "offline-system-sdk-referenceonly-docs",
230 defaults: ["framework-docs-default"],
231 srcs: [
232 ":framework-doc-system-stubs",
233 ],
234 hdf: [
235 "android.whichdoc offline",
236 ],
237 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
238 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
239 " -offlinemode -title \"Android System SDK\" -referenceonly",
240 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
241 static_doc_properties: "docs/source.properties",
242}
243
244droiddoc {
245 name: "online-sdk-docs",
246 defaults: ["framework-docs-default"],
247 srcs: [
248 ":framework-doc-stubs",
249 ],
250 hdf: [
251 "android.whichdoc online",
252 "android.hasSamples true",
253 ],
254 proofread_file: "online-sdk-docs-proofrerad.txt",
255 args: framework_docs_only_args +
256 " -toroot / -samplegroup Admin " +
257 " -samplegroup Background " +
258 " -samplegroup Connectivity " +
259 " -samplegroup Content " +
260 " -samplegroup Input " +
261 " -samplegroup Media " +
262 " -samplegroup Notification " +
263 " -samplegroup RenderScript " +
264 " -samplegroup Security " +
265 " -samplegroup Sensors " +
266 " -samplegroup System " +
267 " -samplegroup Testing " +
268 " -samplegroup UI " +
269 " -samplegroup Views " +
270 " -samplegroup Wearable -samplesdir development/samples/browseable ",
271}
272
273droiddoc {
274 name: "online-system-api-sdk-docs",
275 defaults: ["framework-docs-default"],
276 srcs: [
277 ":framework-doc-system-stubs",
278 ],
279 hdf: [
280 "android.whichdoc online",
281 "android.hasSamples true",
282 ],
283 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
284 args: framework_docs_only_args +
285 " -referenceonly " +
286 " -title \"Android SDK - Including system APIs.\" " +
287 " -hide 101 " +
288 " -hide 104 " +
289 " -hide 108 " +
290 " -toroot / -samplegroup Admin " +
291 " -samplegroup Background " +
292 " -samplegroup Connectivity " +
293 " -samplegroup Content " +
294 " -samplegroup Input " +
295 " -samplegroup Media " +
296 " -samplegroup Notification " +
297 " -samplegroup RenderScript " +
298 " -samplegroup Security " +
299 " -samplegroup Sensors " +
300 " -samplegroup System " +
301 " -samplegroup Testing " +
302 " -samplegroup UI " +
303 " -samplegroup Views " +
304 " -samplegroup Wearable -samplesdir development/samples/browseable ",
305 installable: false,
306}
307
308droiddoc {
309 name: "ds-docs-java",
310 defaults: ["framework-docs-default"],
311 srcs: [
312 ":framework-doc-stubs",
313 ],
314 hdf: [
315 "android.whichdoc online",
316 "android.hasSamples true",
317 ],
318 proofread_file: "ds-docs-proofrerad.txt",
319 args: framework_docs_only_args +
320 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
321 " -samplegroup Background " +
322 " -samplegroup Connectivity " +
323 " -samplegroup Content " +
324 " -samplegroup Input " +
325 " -samplegroup Media " +
326 " -samplegroup Notification " +
327 " -samplegroup RenderScript " +
328 " -samplegroup Security " +
329 " -samplegroup Sensors " +
330 " -samplegroup System " +
331 " -samplegroup Testing " +
332 " -samplegroup UI " +
333 " -samplegroup Views " +
334 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
335}
336
337droiddoc {
338 name: "ds-docs-kt",
339 defaults: ["framework-dokka-docs-default"],
340 srcs: [
341 ":framework-doc-stubs",
342 ],
343 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700344 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900345 proofread_file: "ds-dokka-proofread.txt",
346 dokka_enabled: true,
347}
348
349java_genrule {
350 name: "ds-docs",
351 tools: [
352 "zip2zip",
353 "merge_zips",
354 ],
355 srcs: [
356 ":ds-docs-java{.docs.zip}",
357 ":ds-docs-kt{.docs.zip}",
358 ],
359 out: ["ds-docs.zip"],
360 dist: {
361 targets: ["docs"],
362 },
363 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 -0700364 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900365}
366
367java_genrule {
368 name: "ds-docs-switched",
369 tools: [
370 "switcher4",
371 "soong_zip",
372 ],
373 srcs: [
374 ":ds-docs-java{.docs.zip}",
375 ":ds-docs-kt{.docs.zip}",
376 ],
377 out: ["ds-docs-switched.zip"],
378 dist: {
379 targets: ["docs"],
380 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800381 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700382 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
383 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
384 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
385 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900386}
387
388droiddoc {
389 name: "ds-static-docs",
390 defaults: ["framework-docs-default"],
391 srcs: [
392 ":framework-doc-stubs",
393 ],
394 hdf: [
395 "android.whichdoc online",
396 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900397 args: framework_docs_only_args +
398 " -staticonly " +
399 " -toroot / " +
400 " -devsite " +
401 " -ignoreJdLinks ",
402}
403
404droiddoc {
405 name: "ds-ref-navtree-docs",
406 defaults: ["framework-docs-default"],
407 srcs: [
408 ":framework-doc-stubs",
409 ],
410 hdf: [
411 "android.whichdoc online",
412 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900413 args: framework_docs_only_args +
414 " -toroot / " +
415 " -atLinksNavtree " +
416 " -navtreeonly ",
417}
418
419droiddoc {
420 name: "online-sdk-dev-docs",
421 defaults: ["framework-docs-default"],
422 srcs: [
423 ":framework-doc-stubs",
424 ],
425 hdf: [
426 "android.whichdoc online",
427 "android.hasSamples true",
428 ],
429 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
430 args: framework_docs_only_args +
431 " -toroot / -samplegroup Admin " +
432 " -samplegroup Background " +
433 " -samplegroup Connectivity " +
434 " -samplegroup Content " +
435 " -samplegroup Input " +
436 " -samplegroup Media " +
437 " -samplegroup Notification " +
438 " -samplegroup RenderScript " +
439 " -samplegroup Security " +
440 " -samplegroup Sensors " +
441 " -samplegroup System " +
442 " -samplegroup Testing " +
443 " -samplegroup UI " +
444 " -samplegroup Views " +
445 " -samplegroup Wearable -samplesdir development/samples/browseable ",
446}
447
448droiddoc {
449 name: "hidden-docs",
450 defaults: ["framework-docs-default"],
451 srcs: [
452 ":framework-doc-stubs",
453 ],
454 proofread_file: "hidden-docs-proofrerad.txt",
455 args: framework_docs_only_args +
456 " -referenceonly " +
457 " -title \"Android SDK - Including hidden APIs.\"",
458}