1 // Copyright (C) 2019 The Android Open Source Project
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
15 // How API docs are generated:
17 // raw source files --(metalava)--> stub source files --(doclava)--> API doc
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.
23 /////////////////////////////////////////////////////////////////////
24 // stub source files are generated using metalava
25 /////////////////////////////////////////////////////////////////////
27 framework_docs_only_libs = [
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",
59 name: "framework-doc-stubs-default",
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",
68 ":art-module-public-api-stubs-source",
69 ":conscrypt.module.public.api{.public.stubs.source}",
70 ":android_icu4j_public_api_files",
71 "test-mock/src/**/*.java",
72 "test-runner/src/**/*.java",
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: [
80 "api-versions-jars-dir",
82 previous_api: ":android.api.public.latest",
83 merge_annotations_dirs: [
89 name: "framework-doc-stubs",
90 defaults: ["framework-doc-stubs-default"],
92 "core/res/AndroidManifest.xml",
94 args: metalava_framework_docs_args,
95 write_sdk_values: true,
99 name: "framework-doc-system-stubs",
100 defaults: ["framework-doc-stubs-default"],
102 "core/res/AndroidManifest.xml",
104 args: metalava_framework_docs_args + " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.PRIVILEGED_APPS\\) ",
105 write_sdk_values: true,
108 /////////////////////////////////////////////////////////////////////
109 // API docs are created from the generated stub source files
111 /////////////////////////////////////////////////////////////////////
113 framework_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) "
124 name: "framework-docs-default",
125 libs: framework_docs_only_libs + [
127 "unsupportedappusage",
133 "docs/knowntags.txt",
136 custom_template: "droiddoc-templates-sdk",
137 resourcesdir: "docs/html/reference/images/",
138 resourcesoutdir: "reference/android/images/",
142 "sdk.preview.version 1",
148 "core/res/AndroidManifest.xml",
149 "core/java/overview.html",
150 ":current-support-api",
151 ":current-androidx-api",
157 name: "framework-dokka-docs-default",
162 name: "doc-comment-check-docs",
163 defaults: ["framework-docs-default"],
165 ":framework-doc-stubs",
167 args: framework_docs_only_args + " -referenceonly -parsecomments",
172 name: "offline-sdk-docs",
173 defaults: ["framework-docs-default"],
175 ":framework-doc-stubs",
178 "android.whichdoc offline",
180 compat_config: ":global-compat-config",
181 proofread_file: "offline-sdk-docs-proofrerad.txt",
182 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\"",
183 static_doc_index_redirect: "docs/docs-preview-index.html",
187 // Please sync with android-api-council@ before making any changes for the name property below.
188 // Since there's cron jobs that fetch offline-sdk-referenceonly-docs-docs.zip periodically.
189 // See b/116221385 for reference.
190 name: "offline-sdk-referenceonly-docs",
191 defaults: ["framework-docs-default"],
193 ":framework-doc-stubs",
196 "android.whichdoc offline",
198 proofread_file: "offline-sdk-referenceonly-docs-proofrerad.txt",
199 args: framework_docs_only_args + " -offlinemode -title \"Android SDK\" -referenceonly",
200 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
201 static_doc_properties: "docs/source.properties",
205 // Please sync with android-api-council@ before making any changes for the name property below.
206 // Since there's cron jobs that fetch offline-system-sdk-referenceonly-docs-docs.zip periodically.
207 // See b/116221385 for reference.
208 name: "offline-system-sdk-referenceonly-docs",
209 defaults: ["framework-docs-default"],
211 ":framework-doc-system-stubs",
214 "android.whichdoc offline",
216 proofread_file: "offline-system-sdk-referenceonly-docs-proofrerad.txt",
217 args: framework_docs_only_args + " -hide 101 -hide 104 -hide 108" +
218 " -offlinemode -title \"Android System SDK\" -referenceonly",
219 static_doc_index_redirect: "docs/docs-documentation-redirect.html",
220 static_doc_properties: "docs/source.properties",
224 name: "online-sdk-docs",
225 defaults: ["framework-docs-default"],
227 ":framework-doc-stubs",
230 "android.whichdoc online",
231 "android.hasSamples true",
233 proofread_file: "online-sdk-docs-proofrerad.txt",
234 args: framework_docs_only_args +
235 " -toroot / -samplegroup Admin " +
236 " -samplegroup Background " +
237 " -samplegroup Connectivity " +
238 " -samplegroup Content " +
239 " -samplegroup Input " +
240 " -samplegroup Media " +
241 " -samplegroup Notification " +
242 " -samplegroup RenderScript " +
243 " -samplegroup Security " +
244 " -samplegroup Sensors " +
245 " -samplegroup System " +
246 " -samplegroup Testing " +
247 " -samplegroup UI " +
248 " -samplegroup Views " +
249 " -samplegroup Wearable -samplesdir development/samples/browseable ",
253 name: "online-system-api-sdk-docs",
254 defaults: ["framework-docs-default"],
256 ":framework-doc-system-stubs",
259 "android.whichdoc online",
260 "android.hasSamples true",
262 proofread_file: "online-system-api-sdk-docs-proofrerad.txt",
263 args: framework_docs_only_args +
265 " -title \"Android SDK - Including system APIs.\" " +
269 " -toroot / -samplegroup Admin " +
270 " -samplegroup Background " +
271 " -samplegroup Connectivity " +
272 " -samplegroup Content " +
273 " -samplegroup Input " +
274 " -samplegroup Media " +
275 " -samplegroup Notification " +
276 " -samplegroup RenderScript " +
277 " -samplegroup Security " +
278 " -samplegroup Sensors " +
279 " -samplegroup System " +
280 " -samplegroup Testing " +
281 " -samplegroup UI " +
282 " -samplegroup Views " +
283 " -samplegroup Wearable -samplesdir development/samples/browseable ",
288 name: "ds-docs-java",
289 defaults: ["framework-docs-default"],
291 ":framework-doc-stubs",
294 "android.whichdoc online",
295 "android.hasSamples true",
297 proofread_file: "ds-docs-proofrerad.txt",
298 args: framework_docs_only_args +
299 " -toroot / -yamlV2 -metalavaApiSince -samplegroup Admin " +
300 " -samplegroup Background " +
301 " -samplegroup Connectivity " +
302 " -samplegroup Content " +
303 " -samplegroup Input " +
304 " -samplegroup Media " +
305 " -samplegroup Notification " +
306 " -samplegroup RenderScript " +
307 " -samplegroup Security " +
308 " -samplegroup Sensors " +
309 " -samplegroup System " +
310 " -samplegroup Testing " +
311 " -samplegroup UI " +
312 " -samplegroup Views " +
313 " -samplegroup Wearable -devsite -samplesdir development/samples/browseable ",
318 defaults: ["framework-dokka-docs-default"],
320 ":framework-doc-stubs",
322 args: "-noJdkLink -links https://kotlinlang.org/api/latest/jvm/stdlib/^external/dokka/package-list " +
324 proofread_file: "ds-dokka-proofread.txt",
335 ":ds-docs-java{.docs.zip}",
336 ":ds-docs-kt{.docs.zip}",
338 out: ["ds-docs.zip"],
342 cmd: "$(location zip2zip) -i $(location :ds-docs-kt{.docs.zip}) -o $(genDir)/ds-docs-kt-moved.zip **/*:en/reference/kotlin && " +
343 "$(location merge_zips) $(out) $(location :ds-docs-java{.docs.zip}) $(genDir)/ds-docs-kt-moved.zip",
347 name: "ds-docs-switched",
353 ":ds-docs-java{.docs.zip}",
354 ":ds-docs-kt{.docs.zip}",
356 out: ["ds-docs-switched.zip"],
360 cmd: "unzip $(location :ds-docs-java{.docs.zip}) -d $(genDir) && " +
361 "unzip $(location :ds-docs-kt{.docs.zip}) -d $(genDir)/en/reference/kotlin && " +
362 "SWITCHER=$$(cd $$(dirname $(location switcher4)) && pwd)/$$(basename $(location switcher4)) && " +
363 "(cd $(genDir)/en/reference && $$SWITCHER --work platform) && " +
364 "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
368 name: "ds-static-docs",
369 defaults: ["framework-docs-default"],
371 ":framework-doc-stubs",
374 "android.whichdoc online",
376 proofread_file: "ds-static-docs-proofrerad.txt",
377 args: framework_docs_only_args +
385 name: "ds-ref-navtree-docs",
386 defaults: ["framework-docs-default"],
388 ":framework-doc-stubs",
391 "android.whichdoc online",
393 proofread_file: "ds-ref-navtree-docs-proofrerad.txt",
394 args: framework_docs_only_args +
396 " -atLinksNavtree " +
401 name: "online-sdk-dev-docs",
402 defaults: ["framework-docs-default"],
404 ":framework-doc-stubs",
407 "android.whichdoc online",
408 "android.hasSamples true",
410 proofread_file: "online-sdk-dev-docs-proofrerad.txt",
411 args: framework_docs_only_args +
412 " -toroot / -samplegroup Admin " +
413 " -samplegroup Background " +
414 " -samplegroup Connectivity " +
415 " -samplegroup Content " +
416 " -samplegroup Input " +
417 " -samplegroup Media " +
418 " -samplegroup Notification " +
419 " -samplegroup RenderScript " +
420 " -samplegroup Security " +
421 " -samplegroup Sensors " +
422 " -samplegroup System " +
423 " -samplegroup Testing " +
424 " -samplegroup UI " +
425 " -samplegroup Views " +
426 " -samplegroup Wearable -samplesdir development/samples/browseable ",
431 defaults: ["framework-docs-default"],
433 ":framework-doc-stubs",
435 proofread_file: "hidden-docs-proofrerad.txt",
436 args: framework_docs_only_args +
438 " -title \"Android SDK - Including hidden APIs.\"",