blob: 7ed7ec526686fbc833de44e1cdb29e651ddd0dad [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: [
61 ":framework-mime-sources",
62 ":framework-non-updatable-sources",
63 ":framework-updatable-sources",
64 "core/java/**/*.logtags",
65 "test-base/src/**/*.java",
66 ":opt-telephony-srcs",
67 ":opt-net-voip-srcs",
Paul Duffin404b26a2020-09-16 14:26:47 +010068 ":art.module.public.api{.public.stubs.source}",
Paul Duffine55d4e32020-05-14 17:55:46 +010069 ":conscrypt.module.public.api{.public.stubs.source}",
Paul Duffin5c89e702020-03-26 15:33:48 +000070 ":android_icu4j_public_api_files",
Jiyong Park7fb4b182019-12-20 14:35:43 +090071 "test-mock/src/**/*.java",
72 "test-runner/src/**/*.java",
73 ],
74 libs: framework_docs_only_libs,
75 create_doc_stubs: true,
76 annotations_enabled: true,
77 api_levels_annotations_enabled: true,
78 api_levels_annotations_dirs: [
79 "sdk-dir",
80 "api-versions-jars-dir",
81 ],
Anton Hanssonf68ddea2020-05-02 17:49:26 +010082 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +090083 merge_annotations_dirs: [
84 "metalava-manual",
85 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -070086 // TODO(b/169090544): remove below aidl includes.
87 aidl: {
88 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -070089 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -070090 },
Jiyong Park7fb4b182019-12-20 14:35:43 +090091}
92
93droidstubs {
94 name: "framework-doc-stubs",
95 defaults: ["framework-doc-stubs-default"],
96 arg_files: [
97 "core/res/AndroidManifest.xml",
98 ],
99 args: metalava_framework_docs_args,
100 write_sdk_values: true,
101}
102
103droidstubs {
104 name: "framework-doc-system-stubs",
105 defaults: ["framework-doc-stubs-default"],
106 arg_files: [
107 "core/res/AndroidManifest.xml",
108 ],
Jiyong Park02255332020-05-02 22:05:50 +0900109 args: metalava_framework_docs_args + " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900110 write_sdk_values: true,
111}
112
113/////////////////////////////////////////////////////////////////////
114// API docs are created from the generated stub source files
115// using droiddoc
116/////////////////////////////////////////////////////////////////////
117
118framework_docs_only_args = " -android -manifest $(location core/res/AndroidManifest.xml) " +
119 "-werror -lerror -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " +
120 "-overview $(location core/java/overview.html) " +
121 // Federate Support Library references against local API file.
122 "-federate SupportLib https://developer.android.com " +
123 "-federationapi SupportLib $(location :current-support-api) " +
124 // Federate Support Library references against local API file.
125 "-federate AndroidX https://developer.android.com " +
126 "-federationapi AndroidX $(location :current-androidx-api) "
127
128doc_defaults {
129 name: "framework-docs-default",
Artur Satayevffd7f952020-01-13 16:16:27 +0000130 libs: framework_docs_only_libs + [
131 "stub-annotations",
132 "unsupportedappusage",
133 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900134 html_dirs: [
135 "docs/html",
136 ],
137 knowntags: [
138 "docs/knowntags.txt",
Paul Duffin8c083f62020-09-08 20:22:49 +0100139 ":art.module.public.api{.doctags}",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900140 ],
141 custom_template: "droiddoc-templates-sdk",
142 resourcesdir: "docs/html/reference/images/",
143 resourcesoutdir: "reference/android/images/",
144 hdf: [
145 "dac true",
146 "sdk.codename O",
147 "sdk.preview.version 1",
148 "sdk.version 7.0",
149 "sdk.rel.id 1",
150 "sdk.preview 0",
151 ],
152 arg_files: [
153 "core/res/AndroidManifest.xml",
154 "core/java/overview.html",
155 ":current-support-api",
156 ":current-androidx-api",
157 ],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700158 // TODO(b/169090544): remove below aidl includes.
159 aidl: {
160 local_include_dirs: ["media/aidl"],
Ytai Ben-Tsvic3cd3cd2020-10-30 12:34:51 -0700161 include_dirs: ["frameworks/av/aidl"],
Ytai Ben-Tsvida7c21e2020-09-16 13:04:31 -0700162 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900163}
164
165doc_defaults {
166 name: "framework-dokka-docs-default",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900167}
168
169droiddoc {
170 name: "doc-comment-check-docs",
171 defaults: ["framework-docs-default"],
172 srcs: [
173 ":framework-doc-stubs",
174 ],
175 args: framework_docs_only_args + " -referenceonly -parsecomments",
176 installable: false,
177}
178
179droiddoc {
180 name: "offline-sdk-docs",
181 defaults: ["framework-docs-default"],
182 srcs: [
183 ":framework-doc-stubs",
184 ],
185 hdf: [
186 "android.whichdoc offline",
187 ],
atrostb1ee27b2020-02-03 11:03:16 +0000188 compat_config: ":global-compat-config",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900189 proofread_file: "offline-sdk-docs-proofrerad.txt",
190 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
191 static_doc_index_redirect: "docs/docs-preview-index.html",
192}
193
194droiddoc {
195 // Please sync with android-api-council@ before making any changes for the name property below.
196 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
197 // See b/116221385 for reference.
198 name: "offline-sdk-referenceonly-docs",
199 defaults: ["framework-docs-default"],
200 srcs: [
201 ":framework-doc-stubs",
202 ],
203 hdf: [
204 "android.whichdoc offline",
205 ],
206 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
207 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
208 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
209 static_doc_properties: "docs/source.properties",
210}
211
212droiddoc {
213 // Please sync with android-api-council@ before making any changes for the name property below.
214 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
215 // See b/116221385 for reference.
216 name: "offline-system-sdk-referenceonly-docs",
217 defaults: ["framework-docs-default"],
218 srcs: [
219 ":framework-doc-system-stubs",
220 ],
221 hdf: [
222 "android.whichdoc offline",
223 ],
224 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
225 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
226 " -offlinemode -title \"Android System SDK\" -referenceonly",
227 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
228 static_doc_properties: "docs/source.properties",
229}
230
231droiddoc {
232 name: "online-sdk-docs",
233 defaults: ["framework-docs-default"],
234 srcs: [
235 ":framework-doc-stubs",
236 ],
237 hdf: [
238 "android.whichdoc online",
239 "android.hasSamples true",
240 ],
241 proofread_file: "online-sdk-docs-proofrerad.txt",
242 args: framework_docs_only_args +
243 " -toroot / -samplegroup Admin " +
244 " -samplegroup Background " +
245 " -samplegroup Connectivity " +
246 " -samplegroup Content " +
247 " -samplegroup Input " +
248 " -samplegroup Media " +
249 " -samplegroup Notification " +
250 " -samplegroup RenderScript " +
251 " -samplegroup Security " +
252 " -samplegroup Sensors " +
253 " -samplegroup System " +
254 " -samplegroup Testing " +
255 " -samplegroup UI " +
256 " -samplegroup Views " +
257 " -samplegroup Wearable -samplesdir development/samples/browseable ",
258}
259
260droiddoc {
261 name: "online-system-api-sdk-docs",
262 defaults: ["framework-docs-default"],
263 srcs: [
264 ":framework-doc-system-stubs",
265 ],
266 hdf: [
267 "android.whichdoc online",
268 "android.hasSamples true",
269 ],
270 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
271 args: framework_docs_only_args +
272 " -referenceonly " +
273 " -title \"Android SDK - Including system APIs.\" " +
274 " -hide 101 " +
275 " -hide 104 " +
276 " -hide 108 " +
277 " -toroot / -samplegroup Admin " +
278 " -samplegroup Background " +
279 " -samplegroup Connectivity " +
280 " -samplegroup Content " +
281 " -samplegroup Input " +
282 " -samplegroup Media " +
283 " -samplegroup Notification " +
284 " -samplegroup RenderScript " +
285 " -samplegroup Security " +
286 " -samplegroup Sensors " +
287 " -samplegroup System " +
288 " -samplegroup Testing " +
289 " -samplegroup UI " +
290 " -samplegroup Views " +
291 " -samplegroup Wearable -samplesdir development/samples/browseable ",
292 installable: false,
293}
294
295droiddoc {
296 name: "ds-docs-java",
297 defaults: ["framework-docs-default"],
298 srcs: [
299 ":framework-doc-stubs",
300 ],
301 hdf: [
302 "android.whichdoc online",
303 "android.hasSamples true",
304 ],
305 proofread_file: "ds-docs-proofrerad.txt",
306 args: framework_docs_only_args +
307 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
308 " -samplegroup Background " +
309 " -samplegroup Connectivity " +
310 " -samplegroup Content " +
311 " -samplegroup Input " +
312 " -samplegroup Media " +
313 " -samplegroup Notification " +
314 " -samplegroup RenderScript " +
315 " -samplegroup Security " +
316 " -samplegroup Sensors " +
317 " -samplegroup System " +
318 " -samplegroup Testing " +
319 " -samplegroup UI " +
320 " -samplegroup Views " +
321 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
322}
323
324droiddoc {
325 name: "ds-docs-kt",
326 defaults: ["framework-dokka-docs-default"],
327 srcs: [
328 ":framework-doc-stubs",
329 ],
330 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700331 "-noStdlibLink",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900332 proofread_file: "ds-dokka-proofread.txt",
333 dokka_enabled: true,
334}
335
336java_genrule {
337 name: "ds-docs",
338 tools: [
339 "zip2zip",
340 "merge_zips",
341 ],
342 srcs: [
343 ":ds-docs-java{.docs.zip}",
344 ":ds-docs-kt{.docs.zip}",
345 ],
346 out: ["ds-docs.zip"],
347 dist: {
348 targets: ["docs"],
349 },
350 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 -0700351 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900352}
353
354java_genrule {
355 name: "ds-docs-switched",
356 tools: [
357 "switcher4",
358 "soong_zip",
359 ],
360 srcs: [
361 ":ds-docs-java{.docs.zip}",
362 ":ds-docs-kt{.docs.zip}",
363 ],
364 out: ["ds-docs-switched.zip"],
365 dist: {
366 targets: ["docs"],
367 },
Colin Crossa2410eb2020-02-26 13:04:57 -0800368 cmd: "unzip -q $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
Dan Willemsencece97c2020-04-20 22:32:45 -0700369 "unzip -q $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
370 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
371 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) > /dev/null && " +
372 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900373}
374
375droiddoc {
376 name: "ds-static-docs",
377 defaults: ["framework-docs-default"],
378 srcs: [
379 ":framework-doc-stubs",
380 ],
381 hdf: [
382 "android.whichdoc online",
383 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900384 args: framework_docs_only_args +
385 " -staticonly " +
386 " -toroot / " +
387 " -devsite " +
388 " -ignoreJdLinks ",
389}
390
391droiddoc {
392 name: "ds-ref-navtree-docs",
393 defaults: ["framework-docs-default"],
394 srcs: [
395 ":framework-doc-stubs",
396 ],
397 hdf: [
398 "android.whichdoc online",
399 ],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900400 args: framework_docs_only_args +
401 " -toroot / " +
402 " -atLinksNavtree " +
403 " -navtreeonly ",
404}
405
406droiddoc {
407 name: "online-sdk-dev-docs",
408 defaults: ["framework-docs-default"],
409 srcs: [
410 ":framework-doc-stubs",
411 ],
412 hdf: [
413 "android.whichdoc online",
414 "android.hasSamples true",
415 ],
416 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
417 args: framework_docs_only_args +
418 " -toroot / -samplegroup Admin " +
419 " -samplegroup Background " +
420 " -samplegroup Connectivity " +
421 " -samplegroup Content " +
422 " -samplegroup Input " +
423 " -samplegroup Media " +
424 " -samplegroup Notification " +
425 " -samplegroup RenderScript " +
426 " -samplegroup Security " +
427 " -samplegroup Sensors " +
428 " -samplegroup System " +
429 " -samplegroup Testing " +
430 " -samplegroup UI " +
431 " -samplegroup Views " +
432 " -samplegroup Wearable -samplesdir development/samples/browseable ",
433}
434
435droiddoc {
436 name: "hidden-docs",
437 defaults: ["framework-docs-default"],
438 srcs: [
439 ":framework-doc-stubs",
440 ],
441 proofread_file: "hidden-docs-proofrerad.txt",
442 args: framework_docs_only_args +
443 " -referenceonly " +
444 " -title \"Android SDK - Including hidden APIs.\"",
445}