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