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