Android.mk revision 16e8c1ed1b5cd98cefd128b9088dec803e67295f
1#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16LOCAL_PATH := $(call my-dir)
17
18# We have a special case here where we build the library's resources
19# independently from its code, so we need to find where the resource
20# class source got placed in the course of building the resources.
21# Thus, the magic here.
22# Also, this module cannot depend directly on the R.java file; if it
23# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
24# Instead, it depends on the R.stamp file, which lists the corresponding
25# R.java file as a prerequisite.
26# TODO: find a more appropriate way to do this.
27framework_res_source_path := APPS/framework-res_intermediates/src
28
29# the library
30# ============================================================
31include $(CLEAR_VARS)
32
33# FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
34LOCAL_SRC_FILES := $(call find-other-java-files,$(FRAMEWORKS_BASE_SUBDIRS))
35
36# EventLogTags files.
37LOCAL_SRC_FILES += \
38       core/java/android/content/EventLogTags.logtags \
39       core/java/android/speech/tts/EventLogTags.logtags \
40       core/java/android/webkit/EventLogTags.logtags \
41
42# The following filters out code we are temporarily not including at all.
43# TODO: Move AWT and beans (and associated harmony code) back into libcore.
44# TODO: Maybe remove javax.microedition entirely?
45# TODO: Move SyncML (org.mobilecontrol.*) into its own library.
46LOCAL_SRC_FILES := $(filter-out \
47			org/mobilecontrol/% \
48			,$(LOCAL_SRC_FILES))
49
50## READ ME: ########################################################
51##
52## When updating this list of aidl files, consider if that aidl is
53## part of the SDK API.  If it is, also add it to the list below that
54## is preprocessed and distributed with the SDK.  This list should
55## not contain any aidl files for parcelables, but the one below should
56## if you intend for 3rd parties to be able to send those objects
57## across process boundaries.
58##
59## READ ME: ########################################################
60LOCAL_SRC_FILES += \
61	core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl \
62	core/java/android/accessibilityservice/IAccessibilityServiceClient.aidl \
63	core/java/android/accounts/IAccountManager.aidl \
64	core/java/android/accounts/IAccountManagerResponse.aidl \
65	core/java/android/accounts/IAccountAuthenticator.aidl \
66	core/java/android/accounts/IAccountAuthenticatorResponse.aidl \
67	core/java/android/app/IActivityController.aidl \
68	core/java/android/app/IActivityPendingResult.aidl \
69	core/java/android/app/IAlarmManager.aidl \
70	core/java/android/app/IBackupAgent.aidl \
71	core/java/android/app/IInstrumentationWatcher.aidl \
72	core/java/android/app/INotificationManager.aidl \
73	core/java/android/app/IProcessObserver.aidl \
74	core/java/android/app/ISearchManager.aidl \
75	core/java/android/app/ISearchManagerCallback.aidl \
76	core/java/android/app/IServiceConnection.aidl \
77	core/java/android/app/IStopUserCallback.aidl \
78	core/java/android/app/IThumbnailReceiver.aidl \
79	core/java/android/app/IThumbnailRetriever.aidl \
80	core/java/android/app/ITransientNotification.aidl \
81	core/java/android/app/IUiModeManager.aidl \
82    core/java/android/app/IUserSwitchObserver.aidl \
83	core/java/android/app/IWallpaperManager.aidl \
84	core/java/android/app/IWallpaperManagerCallback.aidl \
85	core/java/android/app/admin/IDevicePolicyManager.aidl \
86	core/java/android/app/backup/IBackupManager.aidl \
87	core/java/android/app/backup/IFullBackupRestoreObserver.aidl \
88	core/java/android/app/backup/IRestoreObserver.aidl \
89	core/java/android/app/backup/IRestoreSession.aidl \
90	core/java/android/bluetooth/IBluetooth.aidl \
91	core/java/android/bluetooth/IBluetoothA2dp.aidl \
92	core/java/android/bluetooth/IBluetoothCallback.aidl \
93	core/java/android/bluetooth/IBluetoothHeadset.aidl \
94	core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl \
95	core/java/android/bluetooth/IBluetoothHealth.aidl \
96	core/java/android/bluetooth/IBluetoothHealthCallback.aidl \
97	core/java/android/bluetooth/IBluetoothInputDevice.aidl \
98	core/java/android/bluetooth/IBluetoothPan.aidl \
99	core/java/android/bluetooth/IBluetoothManager.aidl \
100	core/java/android/bluetooth/IBluetoothManagerCallback.aidl \
101	core/java/android/bluetooth/IBluetoothPbap.aidl \
102	core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \
103	core/java/android/content/IClipboard.aidl \
104	core/java/android/content/IContentService.aidl \
105	core/java/android/content/IIntentReceiver.aidl \
106	core/java/android/content/IIntentSender.aidl \
107	core/java/android/content/IOnPrimaryClipChangedListener.aidl \
108	core/java/android/content/ISyncAdapter.aidl \
109	core/java/android/content/ISyncContext.aidl \
110	core/java/android/content/ISyncStatusObserver.aidl \
111	core/java/android/content/pm/IPackageDataObserver.aidl \
112	core/java/android/content/pm/IPackageDeleteObserver.aidl \
113	core/java/android/content/pm/IPackageInstallObserver.aidl \
114	core/java/android/content/pm/IPackageManager.aidl \
115	core/java/android/content/pm/IPackageMoveObserver.aidl \
116	core/java/android/content/pm/IPackageStatsObserver.aidl \
117	core/java/android/database/IContentObserver.aidl \
118	core/java/android/hardware/ISerialManager.aidl \
119	core/java/android/hardware/display/IDisplayManager.aidl \
120	core/java/android/hardware/display/IDisplayManagerCallback.aidl \
121	core/java/android/hardware/input/IInputManager.aidl \
122	core/java/android/hardware/input/IInputDevicesChangedListener.aidl \
123	core/java/android/hardware/usb/IUsbManager.aidl \
124	core/java/android/net/IConnectivityManager.aidl \
125	core/java/android/net/INetworkManagementEventObserver.aidl \
126	core/java/android/net/IThrottleManager.aidl \
127	core/java/android/net/INetworkPolicyListener.aidl \
128	core/java/android/net/INetworkPolicyManager.aidl \
129	core/java/android/net/INetworkStatsService.aidl \
130	core/java/android/net/INetworkStatsSession.aidl \
131	core/java/android/net/nsd/INsdManager.aidl \
132	core/java/android/nfc/INdefPushCallback.aidl \
133	core/java/android/nfc/INfcAdapter.aidl \
134	core/java/android/nfc/INfcAdapterExtras.aidl \
135	core/java/android/nfc/INfcTag.aidl \
136	core/java/android/os/ICancellationSignal.aidl \
137	core/java/android/os/IHardwareService.aidl \
138	core/java/android/os/IMessenger.aidl \
139	core/java/android/os/INetworkManagementService.aidl \
140	core/java/android/os/IPermissionController.aidl \
141	core/java/android/os/IPowerManager.aidl \
142	core/java/android/os/IRemoteCallback.aidl \
143	core/java/android/os/ISchedulingPolicyService.aidl \
144	core/java/android/os/IUpdateLock.aidl \
145        core/java/android/os/IUserManager.aidl \
146	core/java/android/os/IVibratorService.aidl \
147	core/java/android/service/dreams/IDreamManager.aidl \
148	core/java/android/service/dreams/IDreamService.aidl \
149	core/java/android/service/wallpaper/IWallpaperConnection.aidl \
150	core/java/android/service/wallpaper/IWallpaperEngine.aidl \
151	core/java/android/service/wallpaper/IWallpaperService.aidl \
152	core/java/android/view/accessibility/IAccessibilityInteractionConnection.aidl\
153	core/java/android/view/accessibility/IAccessibilityInteractionConnectionCallback.aidl\
154	core/java/android/view/accessibility/IAccessibilityManager.aidl \
155	core/java/android/view/accessibility/IAccessibilityManagerClient.aidl \
156	core/java/android/view/IApplicationToken.aidl \
157	core/java/android/view/IDisplayContentChangeListener.aidl \
158	core/java/android/view/IInputFilter.aidl \
159	core/java/android/view/IInputFilterHost.aidl \
160	core/java/android/view/IOnKeyguardExitResult.aidl \
161	core/java/android/view/IRotationWatcher.aidl \
162	core/java/android/view/IWindow.aidl \
163	core/java/android/view/IWindowManager.aidl \
164	core/java/android/view/IWindowSession.aidl \
165	core/java/android/speech/IRecognitionListener.aidl \
166	core/java/android/speech/IRecognitionService.aidl \
167	core/java/android/speech/tts/ITextToSpeechCallback.aidl \
168	core/java/android/speech/tts/ITextToSpeechService.aidl \
169	core/java/com/android/internal/app/IBatteryStats.aidl \
170	core/java/com/android/internal/app/IUsageStats.aidl \
171	core/java/com/android/internal/app/IMediaContainerService.aidl \
172	core/java/com/android/internal/appwidget/IAppWidgetService.aidl \
173	core/java/com/android/internal/appwidget/IAppWidgetHost.aidl \
174	core/java/com/android/internal/backup/IBackupTransport.aidl \
175	core/java/com/android/internal/policy/IFaceLockCallback.aidl \
176	core/java/com/android/internal/policy/IFaceLockInterface.aidl \
177	core/java/com/android/internal/os/IDropBoxManagerService.aidl \
178	core/java/com/android/internal/os/IResultReceiver.aidl \
179	core/java/com/android/internal/statusbar/IStatusBar.aidl \
180	core/java/com/android/internal/statusbar/IStatusBarService.aidl \
181	core/java/com/android/internal/textservice/ISpellCheckerService.aidl \
182	core/java/com/android/internal/textservice/ISpellCheckerSession.aidl \
183	core/java/com/android/internal/textservice/ISpellCheckerSessionListener.aidl \
184	core/java/com/android/internal/textservice/ITextServicesManager.aidl \
185	core/java/com/android/internal/textservice/ITextServicesSessionListener.aidl \
186	core/java/com/android/internal/view/IInputContext.aidl \
187	core/java/com/android/internal/view/IInputContextCallback.aidl \
188	core/java/com/android/internal/view/IInputMethod.aidl \
189	core/java/com/android/internal/view/IInputMethodCallback.aidl \
190	core/java/com/android/internal/view/IInputMethodClient.aidl \
191	core/java/com/android/internal/view/IInputMethodManager.aidl \
192	core/java/com/android/internal/view/IInputMethodSession.aidl \
193	core/java/com/android/internal/widget/ILockSettings.aidl \
194	core/java/com/android/internal/widget/IRemoteViewsFactory.aidl \
195	core/java/com/android/internal/widget/IRemoteViewsAdapterConnection.aidl \
196	keystore/java/android/security/IKeyChainAliasCallback.aidl \
197	keystore/java/android/security/IKeyChainService.aidl \
198	location/java/android/location/ICountryDetector.aidl \
199	location/java/android/location/ICountryListener.aidl \
200	location/java/android/location/IGeocodeProvider.aidl \
201	location/java/android/location/IGpsStatusListener.aidl \
202	location/java/android/location/IGpsStatusProvider.aidl \
203	location/java/android/location/ILocationListener.aidl \
204	location/java/android/location/ILocationManager.aidl \
205	location/java/android/location/INetInitiatedListener.aidl \
206	location/java/com/android/internal/location/ILocationProvider.aidl \
207	media/java/android/media/IAudioService.aidl \
208	media/java/android/media/IAudioFocusDispatcher.aidl \
209	media/java/android/media/IAudioRoutesObserver.aidl \
210	media/java/android/media/IMediaScannerListener.aidl \
211	media/java/android/media/IMediaScannerService.aidl \
212	media/java/android/media/IRemoteControlClient.aidl \
213	media/java/android/media/IRemoteControlDisplay.aidl \
214	media/java/android/media/IRemoteVolumeObserver.aidl \
215	media/java/android/media/IRingtonePlayer.aidl \
216	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
217	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
218	telephony/java/com/android/internal/telephony/ITelephony.aidl \
219	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
220	telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
221	wifi/java/android/net/wifi/IWifiManager.aidl \
222	wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \
223	voip/java/android/net/sip/ISipSession.aidl \
224	voip/java/android/net/sip/ISipSessionListener.aidl \
225	voip/java/android/net/sip/ISipService.aidl
226#
227
228
229# FRAMEWORKS_BASE_JAVA_SRC_DIRS comes from build/core/pathmap.mk
230LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
231
232LOCAL_INTERMEDIATE_SOURCES := \
233			$(framework_res_source_path)/android/R.java \
234			$(framework_res_source_path)/android/Manifest.java \
235			$(framework_res_source_path)/com/android/internal/R.java
236
237LOCAL_NO_STANDARD_LIBRARIES := true
238LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit ext
239
240LOCAL_MODULE := framework
241LOCAL_MODULE_CLASS := JAVA_LIBRARIES
242
243# List of classes and interfaces which should be loaded by the Zygote.
244LOCAL_JAVA_RESOURCE_FILES += $(LOCAL_PATH)/preloaded-classes
245
246#LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
247
248LOCAL_DX_FLAGS := --core-library
249
250include $(BUILD_JAVA_LIBRARY)
251
252# Make sure that R.java and Manifest.java are built before we build
253# the source for this library.
254framework_res_R_stamp := \
255	$(call intermediates-dir-for,APPS,framework-res,,COMMON)/src/R.stamp
256$(full_classes_compiled_jar): $(framework_res_R_stamp)
257
258# Make sure that framework-res is installed when framework is.
259$(LOCAL_INSTALLED_MODULE): | $(dir $(LOCAL_INSTALLED_MODULE))framework-res.apk
260
261framework_built := $(call java-lib-deps,framework)
262
263# AIDL files to be preprocessed and included in the SDK,
264# relative to the root of the build tree.
265# ============================================================
266aidl_files := \
267	frameworks/base/core/java/android/accounts/IAccountManager.aidl \
268	frameworks/base/core/java/android/accounts/IAccountManagerResponse.aidl \
269	frameworks/base/core/java/android/accounts/IAccountAuthenticator.aidl \
270	frameworks/base/core/java/android/accounts/IAccountAuthenticatorResponse.aidl \
271	frameworks/base/core/java/android/app/Notification.aidl \
272	frameworks/base/core/java/android/app/PendingIntent.aidl \
273	frameworks/base/core/java/android/bluetooth/BluetoothDevice.aidl \
274	frameworks/base/core/java/android/bluetooth/BluetoothHealthAppConfiguration.aidl \
275	frameworks/base/core/java/android/content/ComponentName.aidl \
276	frameworks/base/core/java/android/content/Intent.aidl \
277	frameworks/base/core/java/android/content/IntentSender.aidl \
278	frameworks/base/core/java/android/content/PeriodicSync.aidl \
279	frameworks/base/core/java/android/content/SyncStats.aidl \
280	frameworks/base/core/java/android/content/res/Configuration.aidl \
281	frameworks/base/core/java/android/appwidget/AppWidgetProviderInfo.aidl \
282	frameworks/base/core/java/android/net/Uri.aidl \
283	frameworks/base/core/java/android/nfc/NdefMessage.aidl \
284	frameworks/base/core/java/android/nfc/NdefRecord.aidl \
285	frameworks/base/core/java/android/nfc/Tag.aidl \
286	frameworks/base/core/java/android/os/Bundle.aidl \
287	frameworks/base/core/java/android/os/DropBoxManager.aidl \
288	frameworks/base/core/java/android/os/ParcelFileDescriptor.aidl \
289	frameworks/base/core/java/android/os/ParcelUuid.aidl \
290	frameworks/base/core/java/android/view/KeyEvent.aidl \
291	frameworks/base/core/java/android/view/MotionEvent.aidl \
292	frameworks/base/core/java/android/view/Surface.aidl \
293	frameworks/base/core/java/android/view/WindowManager.aidl \
294	frameworks/base/core/java/android/widget/RemoteViews.aidl \
295	frameworks/base/core/java/com/android/internal/textservice/ISpellCheckerService.aidl \
296	frameworks/base/core/java/com/android/internal/textservice/ISpellCheckerSession.aidl \
297	frameworks/base/core/java/com/android/internal/textservice/ISpellCheckerSessionListener.aidl \
298	frameworks/base/core/java/com/android/internal/textservice/ITextServicesManager.aidl \
299	frameworks/base/core/java/com/android/internal/textservice/ITextServicesSessionListener.aidl \
300	frameworks/base/core/java/com/android/internal/view/IInputContext.aidl \
301	frameworks/base/core/java/com/android/internal/view/IInputMethod.aidl \
302	frameworks/base/core/java/com/android/internal/view/IInputMethodCallback.aidl \
303	frameworks/base/core/java/com/android/internal/view/IInputMethodClient.aidl \
304	frameworks/base/core/java/com/android/internal/view/IInputMethodManager.aidl \
305	frameworks/base/core/java/com/android/internal/view/IInputMethodSession.aidl \
306	frameworks/base/graphics/java/android/graphics/Bitmap.aidl \
307	frameworks/base/graphics/java/android/graphics/Rect.aidl \
308	frameworks/base/graphics/java/android/graphics/Region.aidl \
309	frameworks/base/location/java/android/location/Criteria.aidl \
310	frameworks/base/location/java/android/location/Geofence.aidl \
311	frameworks/base/location/java/android/location/Location.aidl \
312	frameworks/base/location/java/android/location/LocationRequest.aidl \
313	frameworks/base/location/java/com/android/internal/location/ProviderProperties.aidl \
314	frameworks/base/location/java/com/android/internal/location/ProviderRequest.aidl \
315	frameworks/base/telephony/java/android/telephony/ServiceState.aidl \
316	frameworks/base/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
317	frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl \
318
319gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
320$(gen): PRIVATE_SRC_FILES := $(aidl_files)
321ALL_SDK_FILES += $(gen)
322$(gen): $(aidl_files) | $(AIDL)
323		@echo Aidl Preprocess: $@
324		$(hide) $(AIDL) --preprocess $@ $(PRIVATE_SRC_FILES)
325
326# the documentation
327# ============================================================
328
329# TODO: deal with com/google/android/googleapps
330packages_to_document := \
331	android \
332	javax/microedition/khronos
333
334# Search through the base framework dirs for these packages.
335# The result will be relative to frameworks/base.
336fwbase_dirs_to_document := \
337	test-runner/src \
338	$(patsubst $(LOCAL_PATH)/%,%, \
339	  $(wildcard \
340	    $(foreach dir, $(FRAMEWORKS_BASE_JAVA_SRC_DIRS), \
341	      $(addprefix $(dir)/, $(packages_to_document)) \
342	     ) \
343	   ) \
344	 )
345
346# include definition of libcore_to_document
347include libcore/Docs.mk
348
349# include definition of junit_to_document
350include external/junit/Common.mk
351
352non_base_dirs := \
353	../../external/apache-http/src/org/apache/http \
354	../opt/telephony/src/java/android/telephony \
355	../opt/telephony/src/java/android/telephony/gsm \
356
357# These are relative to frameworks/base
358dirs_to_check_apis := \
359  $(fwbase_dirs_to_document) \
360	$(non_base_dirs)
361
362# These are relative to frameworks/base
363# FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
364dirs_to_document := \
365	$(dirs_to_check_apis) \
366  $(addprefix ../../, $(FRAMEWORKS_SUPPORT_JAVA_SRC_DIRS))
367
368# These are relative to frameworks/base
369html_dirs := \
370	$(FRAMEWORKS_BASE_SUBDIRS) \
371	$(non_base_dirs)
372
373# Common sources for doc check and api check
374common_src_files := \
375	$(call find-other-html-files, $(html_dirs)) \
376	$(addprefix ../../libcore/, $(call libcore_to_document, $(LOCAL_PATH)/../../libcore)) \
377	$(addprefix ../../external/junit/, $(call junit_to_document, $(LOCAL_PATH)/../../external/junit))
378
379# These are relative to frameworks/base
380framework_docs_LOCAL_SRC_FILES := \
381	$(call find-other-java-files, $(dirs_to_document)) \
382	$(common_src_files)
383
384# These are relative to frameworks/base
385framework_docs_LOCAL_API_CHECK_SRC_FILES := \
386	$(call find-other-java-files, $(dirs_to_check_apis)) \
387	$(common_src_files)
388
389# This is used by ide.mk as the list of source files that are
390# always included.
391INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
392
393framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
394	$(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
395
396framework_docs_LOCAL_INTERMEDIATE_SOURCES := \
397			$(framework_res_source_path)/android/R.java \
398			$(framework_res_source_path)/android/Manifest.java \
399			$(framework_res_source_path)/com/android/internal/R.java
400
401framework_docs_LOCAL_JAVA_LIBRARIES := \
402			bouncycastle \
403			core \
404			ext \
405			framework \
406			mms-common \
407			telephony-common \
408
409framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
410framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html
411# The since flag (-since N.xml API_LEVEL) is used to add API Level information
412# to the reference documentation. Must be in order of oldest to newest.
413framework_docs_LOCAL_DROIDDOC_OPTIONS := \
414    -knowntags ./frameworks/base/docs/knowntags.txt \
415    -since ./frameworks/base/api/1.xml 1 \
416    -since ./frameworks/base/api/2.xml 2 \
417    -since ./frameworks/base/api/3.xml 3 \
418    -since ./frameworks/base/api/4.xml 4 \
419    -since ./frameworks/base/api/5.xml 5 \
420    -since ./frameworks/base/api/6.xml 6 \
421    -since ./frameworks/base/api/7.xml 7 \
422    -since ./frameworks/base/api/8.xml 8 \
423    -since ./frameworks/base/api/9.xml 9 \
424    -since ./frameworks/base/api/10.xml 10 \
425    -since ./frameworks/base/api/11.xml 11 \
426    -since ./frameworks/base/api/12.xml 12 \
427    -since ./frameworks/base/api/13.xml 13 \
428    -since ./frameworks/base/api/14.txt 14 \
429    -since ./frameworks/base/api/15.txt 15 \
430    -since ./frameworks/base/api/16.txt 16 \
431    -since ./frameworks/base/api/17.txt 17 \
432		-werror -hide 113 \
433		-overview $(LOCAL_PATH)/core/java/overview.html
434
435framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)
436
437framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
438    frameworks/base/docs/knowntags.txt
439
440sample_dir := development/samples
441
442# the list here should match the list of samples included in the sdk samples package
443# (see development/build/sdk.atree)
444# remove htmlified samples for now -- samples are still available through the SDK
445# web_docs_sample_code_flags := \
446		-hdf android.hasSamples 1 \
447		-samplecode $(sample_dir)/AccelerometerPlay \
448		            resources/samples/AccelerometerPlay "Accelerometer Play" \
449		-samplecode $(sample_dir)/ActionBarCompat \
450		            resources/samples/ActionBarCompat "Action Bar Compatibility" \
451                -samplecode $(sample_dir)/AndroidBeamDemo \
452		            resources/samples/AndroidBeamDemo "Android Beam Demo" \
453		-samplecode $(sample_dir)/ApiDemos \
454		            resources/samples/ApiDemos "API Demos" \
455		-samplecode $(sample_dir)/Support4Demos \
456		            resources/samples/Support4Demos "API 4+ Support Demos" \
457		-samplecode $(sample_dir)/Support13Demos \
458		            resources/samples/Support13Demos "API 13+ Support Demos" \
459		-samplecode $(sample_dir)/BackupRestore \
460		            resources/samples/BackupRestore "Backup and Restore" \
461		-samplecode $(sample_dir)/BluetoothChat \
462		            resources/samples/BluetoothChat "Bluetooth Chat" \
463		-samplecode $(sample_dir)/BluetoothHDP \
464		            resources/samples/BluetoothHDP "Bluetooth HDP Demo" \
465		-samplecode $(sample_dir)/BusinessCard \
466		            resources/samples/BusinessCard "Business Card" \
467		-samplecode $(sample_dir)/ContactManager \
468		            resources/samples/ContactManager "Contact Manager" \
469		-samplecode $(sample_dir)/CubeLiveWallpaper \
470		            resources/samples/CubeLiveWallpaper "Cube Live Wallpaper" \
471		-samplecode $(sample_dir)/Home \
472		            resources/samples/Home "Home" \
473		-samplecode $(sample_dir)/HoneycombGallery \
474		            resources/samples/HoneycombGallery "Honeycomb Gallery" \
475		-samplecode $(sample_dir)/JetBoy \
476		            resources/samples/JetBoy "JetBoy" \
477		-samplecode $(sample_dir)/KeyChainDemo \
478		            resources/samples/KeyChainDemo "KeyChain Demo" \
479		-samplecode $(sample_dir)/LunarLander \
480		            resources/samples/LunarLander "Lunar Lander" \
481		-samplecode $(sample_dir)/training/ads-and-ux \
482		            resources/samples/training/ads-and-ux "Mobile Advertisement Integration" \
483		-samplecode $(sample_dir)/MultiResolution \
484		            resources/samples/MultiResolution "Multiple Resolutions" \
485		-samplecode $(sample_dir)/training/multiscreen/newsreader \
486		            resources/samples/newsreader "News Reader" \
487		-samplecode $(sample_dir)/NotePad \
488		            resources/samples/NotePad "Note Pad" \
489		-samplecode $(sample_dir)/SpellChecker/SampleSpellCheckerService \
490		            resources/samples/SpellChecker/SampleSpellCheckerService "Spell Checker Service" \
491		-samplecode $(sample_dir)/SpellChecker/HelloSpellChecker \
492		            resources/samples/SpellChecker/HelloSpellChecker "Spell Checker Client" \
493		-samplecode $(sample_dir)/SampleSyncAdapter \
494		            resources/samples/SampleSyncAdapter "Sample Sync Adapter" \
495		-samplecode $(sample_dir)/RandomMusicPlayer \
496		            resources/samples/RandomMusicPlayer "Random Music Player" \
497		-samplecode $(sample_dir)/RenderScript \
498		            resources/samples/RenderScript "RenderScript" \
499		-samplecode $(sample_dir)/SearchableDictionary \
500		            resources/samples/SearchableDictionary "Searchable Dictionary v2" \
501		-samplecode $(sample_dir)/SipDemo \
502		            resources/samples/SipDemo "SIP Demo" \
503		-samplecode $(sample_dir)/Snake \
504		            resources/samples/Snake "Snake" \
505		-samplecode $(sample_dir)/SoftKeyboard \
506		            resources/samples/SoftKeyboard "Soft Keyboard" \
507		-samplecode $(sample_dir)/Spinner  \
508		            resources/samples/Spinner "Spinner" \
509		-samplecode $(sample_dir)/SpinnerTest \
510		            resources/samples/SpinnerTest "SpinnerTest" \
511		-samplecode $(sample_dir)/StackWidget \
512		            resources/samples/StackWidget "StackView Widget" \
513		-samplecode $(sample_dir)/TicTacToeLib  \
514		            resources/samples/TicTacToeLib "TicTacToeLib" \
515		-samplecode $(sample_dir)/TicTacToeMain \
516		            resources/samples/TicTacToeMain "TicTacToeMain" \
517		-samplecode $(sample_dir)/ToyVpn \
518		            resources/samples/ToyVpn "Toy VPN Client" \
519		-samplecode $(sample_dir)/USB \
520		            resources/samples/USB "USB" \
521		-samplecode $(sample_dir)/WeatherListWidget \
522		            resources/samples/WeatherListWidget "Weather List Widget" \
523		-samplecode $(sample_dir)/WiFiDirectDemo \
524                            resources/samples/WiFiDirectDemo "Wi-Fi Direct Demo" \
525		-samplecode $(sample_dir)/Wiktionary \
526		            resources/samples/Wiktionary "Wiktionary" \
527		-samplecode $(sample_dir)/WiktionarySimple \
528		            resources/samples/WiktionarySimple "Wiktionary (Simplified)" \
529		-samplecode $(sample_dir)/VoiceRecognitionService \
530		            resources/samples/VoiceRecognitionService "Voice Recognition Service" \
531		-samplecode $(sample_dir)/VoicemailProviderDemo \
532		            resources/samples/VoicemailProviderDemo "Voicemail Provider Demo" \
533		-samplecode $(sample_dir)/XmlAdapters \
534		            resources/samples/XmlAdapters "XML Adapters" \
535		-samplecode $(sample_dir)/TtsEngine \
536		            resources/samples/TtsEngine "Text To Speech Engine" \
537		-samplecode $(sample_dir)/training/device-management-policy \
538		            resources/samples/training/device-management-policy "Device Management Policy"
539
540
541## SDK version identifiers used in the published docs
542  # major[.minor] version for current SDK. (full releases only)
543framework_docs_SDK_VERSION:=4.2
544  # release version (ie "Release x")  (full releases only)
545framework_docs_SDK_REL_ID:=1
546
547framework_docs_LOCAL_DROIDDOC_OPTIONS += \
548		-hdf sdk.version $(framework_docs_SDK_VERSION) \
549		-hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \
550		-hdf sdk.preview 0 \
551
552# ====  the api stubs and current.xml ===========================
553include $(CLEAR_VARS)
554
555LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
556LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
557LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
558LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
559LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
560LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
561LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
562LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
563
564LOCAL_MODULE := api-stubs
565
566LOCAL_DROIDDOC_OPTIONS:=\
567		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
568		-stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_stubs_current_intermediates/src \
569		-api $(INTERNAL_PLATFORM_API_FILE) \
570		-nodocs
571
572LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
573
574LOCAL_UNINSTALLABLE_MODULE := true
575
576include $(BUILD_DROIDDOC)
577
578# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
579$(full_target): $(framework_built) $(gen)
580$(INTERNAL_PLATFORM_API_FILE): $(full_target)
581$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
582
583# ====  check javadoc comments but don't generate docs ========
584include $(CLEAR_VARS)
585
586LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
587LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
588LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
589LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
590LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
591LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
592LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
593LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
594
595LOCAL_MODULE := doc-comment-check
596
597LOCAL_DROIDDOC_OPTIONS:=\
598		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
599		-parsecomments
600
601LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
602
603LOCAL_UNINSTALLABLE_MODULE := true
604
605include $(BUILD_DROIDDOC)
606
607# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
608$(full_target): $(framework_built) $(gen)
609
610droidcore: doc-comment-check-docs
611
612# ====  static html in the sdk ==================================
613include $(CLEAR_VARS)
614
615LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
616LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
617LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
618LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
619LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
620LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
621LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
622LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
623
624LOCAL_MODULE := offline-sdk
625
626LOCAL_DROIDDOC_OPTIONS:=\
627		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
628                $(web_docs_sample_code_flags) \
629                -offlinemode \
630		-title "Android SDK" \
631		-proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
632		-todo $(OUT_DOCS)/$(LOCAL_MODULE)-docs-todo.html \
633		-sdkvalues $(OUT_DOCS) \
634		-hdf android.whichdoc offline
635
636
637LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
638
639include $(BUILD_DROIDDOC)
640
641static_doc_index_redirect := $(out_dir)/index.html
642$(static_doc_index_redirect): \
643	$(LOCAL_PATH)/docs/docs-documentation-redirect.html | $(ACP)
644	$(hide) mkdir -p $(dir $@)
645	$(hide) $(ACP) $< $@
646
647$(full_target): $(static_doc_index_redirect)
648$(full_target): $(framework_built)
649
650# ==== docs for the web (on the androiddevdocs app engine server) =======================
651include $(CLEAR_VARS)
652
653LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
654LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
655LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
656LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
657LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
658LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
659LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
660LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
661LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
662
663LOCAL_MODULE := online-sdk
664
665LOCAL_DROIDDOC_OPTIONS:= \
666		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
667		$(web_docs_sample_code_flags) \
668		-toroot / \
669		-hdf android.whichdoc online \
670		-hdf template.showLanguageMenu true
671
672LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
673
674include $(BUILD_DROIDDOC)
675
676# explicitly specify that online-sdk depends on framework-res and any generated docs
677$(full_target): framework-res-package-target
678
679# ==== docs for the web (on the devsite app engine server) =======================
680include $(CLEAR_VARS)
681LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
682LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
683LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
684LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
685LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
686LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
687LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
688LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
689LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
690# specify a second html input dir and an output path relative to OUT_DIR)
691LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
692
693LOCAL_MODULE := ds
694
695LOCAL_DROIDDOC_OPTIONS:= \
696		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
697		$(web_docs_sample_code_flags) \
698		-devsite \
699		-toroot / \
700		-hdf android.whichdoc online \
701		-hdf devsite true
702
703LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
704
705include $(BUILD_DROIDDOC)
706
707# explicitly specify that ds depends on framework-res and any generated docs
708$(full_target): framework-res-package-target
709
710# ==== docs that have all of the stuff that's @hidden =======================
711include $(CLEAR_VARS)
712
713LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
714LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
715LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES) framework
716LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
717LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
718LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
719LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
720LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
721
722LOCAL_MODULE := hidden
723LOCAL_DROIDDOC_OPTIONS:=\
724		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
725		-title "Android SDK - Including hidden APIs."
726#		-hidden
727
728LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
729
730include $(BUILD_DROIDDOC)
731
732# Build ext.jar
733# ============================================================
734
735# NOTICE notes for non-obvious sections
736# apache-http - covered by the Apache Commons section.
737
738
739ext_dirs := \
740	../../external/nist-sip/java \
741	../../external/apache-http/src \
742	../../external/tagsoup/src \
743	../../external/libphonenumber/java/src
744
745ext_src_files := $(call all-java-files-under,$(ext_dirs))
746
747ext_res_dirs := \
748	../../external/libphonenumber/java/src
749
750# ====  the library  =========================================
751include $(CLEAR_VARS)
752
753LOCAL_SRC_FILES := $(ext_src_files)
754
755LOCAL_NO_STANDARD_LIBRARIES := true
756LOCAL_JAVA_LIBRARIES := core
757LOCAL_JAVA_RESOURCE_DIRS := $(ext_res_dirs)
758LOCAL_MODULE_TAGS := optional
759LOCAL_MODULE := ext
760
761LOCAL_DX_FLAGS := --core-library
762
763include $(BUILD_JAVA_LIBRARY)
764
765
766# Include subdirectory makefiles
767# ============================================================
768
769# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
770# team really wants is to build the stuff defined by this makefile.
771ifeq (,$(ONE_SHOT_MAKEFILE))
772include $(call first-makefiles-under,$(LOCAL_PATH))
773endif
774