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