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