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