Android.mk 26.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)

# We have a special case here where we build the library's resources
# independently from its code, so we need to find where the resource
# class source got placed in the course of building the resources.
# Thus, the magic here.
# Also, this module cannot depend directly on the R.java file; if it
# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
# Instead, it depends on the R.stamp file, which lists the corresponding
# R.java file as a prerequisite.
# TODO: find a more appropriate way to do this.
27
framework_res_source_path := APPS/framework-res_intermediates/src
28 29 30 31 32 33 34 35

# the library
# ============================================================
include $(CLEAR_VARS)

# FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
LOCAL_SRC_FILES := $(call find-other-java-files,$(FRAMEWORKS_BASE_SUBDIRS))

36
# EventLogTags files.
37 38 39 40
LOCAL_SRC_FILES += \
       core/java/android/content/EventLogTags.logtags \
       core/java/android/webkit/EventLogTags.logtags \
       telephony/java/com/android/internal/telephony/EventLogTags.logtags \
41

42 43 44 45 46 47 48 49
# The following filters out code we are temporarily not including at all.
# TODO: Move AWT and beans (and associated harmony code) back into libcore.
# TODO: Maybe remove javax.microedition entirely?
# TODO: Move SyncML (org.mobilecontrol.*) into its own library.
LOCAL_SRC_FILES := $(filter-out \
			org/mobilecontrol/% \
			,$(LOCAL_SRC_FILES))

50 51 52 53 54 55 56 57 58 59 60 61
# Include a different set of source files when building a debug build.
# TODO: Maybe build these into a separate .jar and put it on the classpath
#       in front of framework.jar.
# NOTE: Do not use this as an example; this is a very special situation.
#       Do not modify LOCAL_SRC_FILES based on any variable other
#       than TARGET_BUILD_TYPE, otherwise builds can become inconsistent.
ifeq ($(TARGET_BUILD_TYPE),debug)
  LOCAL_SRC_FILES += $(call find-other-java-files,core/config/debug)
else
  LOCAL_SRC_FILES += $(call find-other-java-files,core/config/ndebug)
endif

62 63
## READ ME: ########################################################
##
64
## When updating this list of aidl files, consider if that aidl is
65 66 67 68 69 70 71 72
## part of the SDK API.  If it is, also add it to the list below that
## is preprocessed and distributed with the SDK.  This list should
## not contain any aidl files for parcelables, but the one below should
## if you intend for 3rd parties to be able to send those objects
## across process boundaries.
##
## READ ME: ########################################################
LOCAL_SRC_FILES += \
73
	core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl \
74
	core/java/android/accessibilityservice/IEventListener.aidl \
75 76 77 78
	core/java/android/accounts/IAccountManager.aidl \
	core/java/android/accounts/IAccountManagerResponse.aidl \
	core/java/android/accounts/IAccountAuthenticator.aidl \
	core/java/android/accounts/IAccountAuthenticatorResponse.aidl \
79
	core/java/android/app/IActivityController.aidl \
80 81 82
	core/java/android/app/IActivityPendingResult.aidl \
	core/java/android/app/IActivityWatcher.aidl \
	core/java/android/app/IAlarmManager.aidl \
83
	core/java/android/app/IBackupAgent.aidl \
84 85 86
	core/java/android/app/IInstrumentationWatcher.aidl \
	core/java/android/app/INotificationManager.aidl \
	core/java/android/app/ISearchManager.aidl \
87
	core/java/android/app/ISearchManagerCallback.aidl \
88 89 90
	core/java/android/app/IServiceConnection.aidl \
	core/java/android/app/IThumbnailReceiver.aidl \
	core/java/android/app/ITransientNotification.aidl \
91
	core/java/android/app/IUiModeManager.aidl \
Dianne Hackborn's avatar
Dianne Hackborn committed
92 93
	core/java/android/app/IWallpaperManager.aidl \
	core/java/android/app/IWallpaperManagerCallback.aidl \
94
	core/java/android/app/admin/IDevicePolicyManager.aidl \
95 96 97
	core/java/android/app/backup/IBackupManager.aidl \
	core/java/android/app/backup/IRestoreObserver.aidl \
	core/java/android/app/backup/IRestoreSession.aidl \
Nick Pelly's avatar
Nick Pelly committed
98
	core/java/android/bluetooth/IBluetooth.aidl \
99
	core/java/android/bluetooth/IBluetoothA2dp.aidl \
100
	core/java/android/bluetooth/IBluetoothCallback.aidl \
101
	core/java/android/bluetooth/IBluetoothHeadset.aidl \
Jiafa Liu's avatar
Jiafa Liu committed
102
	core/java/android/bluetooth/IBluetoothPbap.aidl \
103
	core/java/android/content/IClipboard.aidl \
104
	core/java/android/content/IContentService.aidl \
105 106
	core/java/android/content/IIntentReceiver.aidl \
	core/java/android/content/IIntentSender.aidl \
107
	core/java/android/content/IOnPrimaryClipChangedListener.aidl \
108 109
	core/java/android/content/ISyncAdapter.aidl \
	core/java/android/content/ISyncContext.aidl \
110
	core/java/android/content/ISyncStatusObserver.aidl \
111 112 113 114
	core/java/android/content/pm/IPackageDataObserver.aidl \
	core/java/android/content/pm/IPackageDeleteObserver.aidl \
	core/java/android/content/pm/IPackageInstallObserver.aidl \
	core/java/android/content/pm/IPackageManager.aidl \
115
	core/java/android/content/pm/IPackageMoveObserver.aidl \
116 117 118
	core/java/android/content/pm/IPackageStatsObserver.aidl \
	core/java/android/database/IContentObserver.aidl \
	core/java/android/net/IConnectivityManager.aidl \
119
	core/java/android/net/INetworkManagementEventObserver.aidl \
120 121
	core/java/android/net/IThrottleManager.aidl \
	core/java/android/os/IHardwareService.aidl \
122
	core/java/android/os/IMessenger.aidl \
123
	core/java/android/os/INetworkManagementService.aidl \
124 125 126
	core/java/android/os/INetStatService.aidl \
	core/java/android/os/IPermissionController.aidl \
	core/java/android/os/IPowerManager.aidl \
Dianne Hackborn's avatar
Dianne Hackborn committed
127
    core/java/android/os/IRemoteCallback.aidl \
128
	core/java/android/os/IVibratorService.aidl \
129 130
    core/java/android/service/wallpaper/IWallpaperConnection.aidl \
    core/java/android/service/wallpaper/IWallpaperEngine.aidl \
Dianne Hackborn's avatar
Dianne Hackborn committed
131
    core/java/android/service/wallpaper/IWallpaperService.aidl \
132 133
	core/java/android/view/accessibility/IAccessibilityManager.aidl \
	core/java/android/view/accessibility/IAccessibilityManagerClient.aidl \
134 135 136 137 138 139
	core/java/android/view/IApplicationToken.aidl \
	core/java/android/view/IOnKeyguardExitResult.aidl \
	core/java/android/view/IRotationWatcher.aidl \
	core/java/android/view/IWindow.aidl \
	core/java/android/view/IWindowManager.aidl \
	core/java/android/view/IWindowSession.aidl \
140 141
	core/java/android/speech/IRecognitionListener.aidl \
	core/java/android/speech/IRecognitionService.aidl \
142 143
	core/java/android/speech/tts/ITts.aidl \
	core/java/android/speech/tts/ITtsCallback.aidl \
144 145
	core/java/com/android/internal/app/IBatteryStats.aidl \
	core/java/com/android/internal/app/IUsageStats.aidl \
146
	core/java/com/android/internal/app/IMediaContainerService.aidl \
147 148
	core/java/com/android/internal/appwidget/IAppWidgetService.aidl \
	core/java/com/android/internal/appwidget/IAppWidgetHost.aidl \
149
	core/java/com/android/internal/backup/IBackupTransport.aidl \
150
	core/java/com/android/internal/os/IDropBoxManagerService.aidl \
151
	core/java/com/android/internal/os/IResultReceiver.aidl \
152 153
	core/java/com/android/internal/statusbar/IStatusBar.aidl \
	core/java/com/android/internal/statusbar/IStatusBarService.aidl \
154 155 156 157 158 159 160
	core/java/com/android/internal/view/IInputContext.aidl \
	core/java/com/android/internal/view/IInputContextCallback.aidl \
	core/java/com/android/internal/view/IInputMethod.aidl \
	core/java/com/android/internal/view/IInputMethodCallback.aidl \
	core/java/com/android/internal/view/IInputMethodClient.aidl \
	core/java/com/android/internal/view/IInputMethodManager.aidl \
	core/java/com/android/internal/view/IInputMethodSession.aidl \
161
	core/java/com/android/internal/widget/IRemoteViewsFactory.aidl \
Nick Pelly's avatar
Nick Pelly committed
162 163 164 165 166 167 168 169
	core/java/com/trustedlogic/trustednfc/android/ILlcpConnectionlessSocket.aidl \
	core/java/com/trustedlogic/trustednfc/android/ILlcpServiceSocket.aidl \
	core/java/com/trustedlogic/trustednfc/android/ILlcpSocket.aidl \
	core/java/com/trustedlogic/trustednfc/android/INdefTag.aidl \
	core/java/com/trustedlogic/trustednfc/android/INfcManager.aidl \
	core/java/com/trustedlogic/trustednfc/android/INfcTag.aidl \
	core/java/com/trustedlogic/trustednfc/android/IP2pInitiator.aidl \
	core/java/com/trustedlogic/trustednfc/android/IP2pTarget.aidl \
170 171
	location/java/android/location/ICountryDetector.aidl \
	location/java/android/location/ICountryListener.aidl \
172
	location/java/android/location/IGeocodeProvider.aidl \
173
	location/java/android/location/IGpsStatusListener.aidl \
174
	location/java/android/location/IGpsStatusProvider.aidl \
175 176
	location/java/android/location/ILocationListener.aidl \
	location/java/android/location/ILocationManager.aidl \
177
	location/java/android/location/ILocationProvider.aidl \
Danke Xie's avatar
Danke Xie committed
178
	location/java/android/location/INetInitiatedListener.aidl \
179
	media/java/android/media/IAudioService.aidl \
180
	media/java/android/media/IAudioFocusDispatcher.aidl \
181 182 183 184 185 186
	media/java/android/media/IMediaScannerListener.aidl \
	media/java/android/media/IMediaScannerService.aidl \
	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
	telephony/java/com/android/internal/telephony/ITelephony.aidl \
	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
187 188
	telephony/java/com/android/internal/telephony/IIccPhoneBook.aidl \
	telephony/java/com/android/internal/telephony/ISms.aidl \
189
	wifi/java/android/net/wifi/IWifiManager.aidl \
Raphael's avatar
Raphael committed
190
	telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl \
191
	vpn/java/android/net/vpn/IVpnService.aidl \
192 193 194 195
	voip/java/android/net/sip/ISipSession.aidl \
	voip/java/android/net/sip/ISipSessionListener.aidl \
	voip/java/android/net/sip/ISipService.aidl
#
196

197

198 199 200 201
# FRAMEWORKS_BASE_JAVA_SRC_DIRS comes from build/core/pathmap.mk
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)

LOCAL_INTERMEDIATE_SOURCES := \
202 203 204
			$(framework_res_source_path)/android/R.java \
			$(framework_res_source_path)/android/Manifest.java \
			$(framework_res_source_path)/com/android/internal/R.java
205 206

LOCAL_NO_STANDARD_LIBRARIES := true
207
LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit ext
208 209 210 211

LOCAL_MODULE := framework
LOCAL_MODULE_CLASS := JAVA_LIBRARIES

212 213 214
LOCAL_NO_EMMA_INSTRUMENT := true
LOCAL_NO_EMMA_COMPILE := true

215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
# List of classes and interfaces which should be loaded by the Zygote.
LOCAL_JAVA_RESOURCE_FILES += $(LOCAL_PATH)/preloaded-classes

#LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt

LOCAL_DX_FLAGS := --core-library

include $(BUILD_JAVA_LIBRARY)

# Make sure that R.java and Manifest.java are built before we build
# the source for this library.
framework_res_R_stamp := \
	$(call intermediates-dir-for,APPS,framework-res,,COMMON)/src/R.stamp
$(full_classes_compiled_jar): $(framework_res_R_stamp)

# Make sure that framework-res is installed when framework is.
$(LOCAL_INSTALLED_MODULE): | $(dir $(LOCAL_INSTALLED_MODULE))framework-res.apk

framework_built := $(LOCAL_BUILT_MODULE)

# AIDL files to be preprocessed and included in the SDK,
# relative to the root of the build tree.
# ============================================================
aidl_files := \
239 240 241 242
	frameworks/base/core/java/android/accounts/IAccountManager.aidl \
	frameworks/base/core/java/android/accounts/IAccountManagerResponse.aidl \
	frameworks/base/core/java/android/accounts/IAccountAuthenticator.aidl \
	frameworks/base/core/java/android/accounts/IAccountAuthenticatorResponse.aidl \
243 244
	frameworks/base/core/java/android/app/Notification.aidl \
	frameworks/base/core/java/android/app/PendingIntent.aidl \
245
	frameworks/base/core/java/android/bluetooth/BluetoothDevice.aidl \
246 247
	frameworks/base/core/java/android/content/ComponentName.aidl \
	frameworks/base/core/java/android/content/Intent.aidl \
248
	frameworks/base/core/java/android/content/IntentSender.aidl \
Fred Quintana's avatar
Fred Quintana committed
249
	frameworks/base/core/java/android/content/PeriodicSync.aidl \
250 251
	frameworks/base/core/java/android/content/SyncStats.aidl \
	frameworks/base/core/java/android/content/res/Configuration.aidl \
252
	frameworks/base/core/java/android/appwidget/AppWidgetProviderInfo.aidl \
253 254
	frameworks/base/core/java/android/net/Uri.aidl \
	frameworks/base/core/java/android/os/Bundle.aidl \
255
	frameworks/base/core/java/android/os/DropBoxManager.aidl \
256
	frameworks/base/core/java/android/os/ParcelFileDescriptor.aidl \
257
	frameworks/base/core/java/android/os/ParcelUuid.aidl \
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
	frameworks/base/core/java/android/view/KeyEvent.aidl \
	frameworks/base/core/java/android/view/MotionEvent.aidl \
	frameworks/base/core/java/android/view/Surface.aidl \
	frameworks/base/core/java/android/view/WindowManager.aidl \
	frameworks/base/core/java/android/widget/RemoteViews.aidl \
	frameworks/base/core/java/com/android/internal/view/IInputContext.aidl \
	frameworks/base/core/java/com/android/internal/view/IInputMethod.aidl \
	frameworks/base/core/java/com/android/internal/view/IInputMethodCallback.aidl \
	frameworks/base/core/java/com/android/internal/view/IInputMethodClient.aidl \
	frameworks/base/core/java/com/android/internal/view/IInputMethodManager.aidl \
	frameworks/base/core/java/com/android/internal/view/IInputMethodSession.aidl \
	frameworks/base/graphics/java/android/graphics/Bitmap.aidl \
	frameworks/base/graphics/java/android/graphics/Rect.aidl \
	frameworks/base/graphics/java/android/graphics/Region.aidl \
	frameworks/base/location/java/android/location/Criteria.aidl \
	frameworks/base/location/java/android/location/Location.aidl \
	frameworks/base/telephony/java/android/telephony/ServiceState.aidl \
	frameworks/base/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
276
	frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl \
277
	frameworks/base/vpn/java/android/net/vpn/IVpnService.aidl \
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296

gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
$(gen): PRIVATE_SRC_FILES := $(aidl_files)
ALL_SDK_FILES += $(gen)
$(gen): $(aidl_files) | $(AIDL)
		@echo Aidl Preprocess: $@
		$(hide) $(AIDL) --preprocess $@ $(PRIVATE_SRC_FILES)

# the documentation
# ============================================================

# TODO: deal with com/google/android/googleapps
packages_to_document := \
	android \
	javax/microedition/khronos

# Search through the base framework dirs for these packages.
# The result will be relative to frameworks/base.
fwbase_dirs_to_document := \
Brett Chabot's avatar
Brett Chabot committed
297
	test-runner/src \
298 299 300 301 302 303 304 305
	$(patsubst $(LOCAL_PATH)/%,%, \
	  $(wildcard \
	    $(foreach dir, $(FRAMEWORKS_BASE_JAVA_SRC_DIRS), \
	      $(addprefix $(dir)/, $(packages_to_document)) \
	     ) \
	   ) \
	 )

306 307 308 309 310
# Pass a special "fake-out" version of some classes to the doc/API tools.
# ConfigBuildFlags uses this trick to prevent certain fields from appearing
# as "final" in the official SDK APIs.
fwbase_dirs_to_document += core/config/sdk

311
# These are relative to libcore
312 313 314 315 316 317 318
# Intentionally not included from libcore:
#     icu openssl suncompat support
libcore_to_document := \
	dalvik/src/main/java/dalvik \
	json/src/main/java \
	junit/src/main/java \
	luni/src/main/java/java \
319 320 321
	luni/src/main/java/javax \
	luni/src/main/java/org/xml/sax \
	luni/src/main/java/org/w3c \
322 323 324
	xml/src/main/java/org/xmlpull/v1 \

non_base_dirs := \
Dirk Balfanz's avatar
Dirk Balfanz committed
325
	../../external/apache-http/src/org/apache/http
326 327 328 329 330

# These are relative to frameworks/base
dirs_to_document := \
	$(fwbase_dirs_to_document) \
	$(non_base_dirs) \
331
	$(addprefix ../../libcore/, $(libcore_to_document))
332 333 334 335 336 337 338 339 340 341

html_dirs := \
	$(FRAMEWORKS_BASE_SUBDIRS) \
	$(non_base_dirs)

# These are relative to frameworks/base
framework_docs_LOCAL_SRC_FILES := \
	$(call find-other-java-files, $(dirs_to_document)) \
	$(call find-other-html-files, $(html_dirs))

342 343 344 345
# This is used by ide.mk as the list of source files that are
# always included.
INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))

346 347 348 349
framework_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
	$(FRAMEWORKS_BASE_JAVA_SRC_DIRS)

framework_docs_LOCAL_INTERMEDIATE_SOURCES := \
350 351 352
			$(framework_res_source_path)/android/R.java \
			$(framework_res_source_path)/android/Manifest.java \
			$(framework_res_source_path)/com/android/internal/R.java
353 354

framework_docs_LOCAL_JAVA_LIBRARIES := \
355
			bouncycastle \
356 357
			core \
			ext \
358
			framework \
359 360

framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
Joe Onorato's avatar
Joe Onorato committed
361
framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html
362 363
# The since flag (-since N.xml API_LEVEL) is used to add API Level information
# to the reference documentation. Must be in order of oldest to newest.
364
framework_docs_LOCAL_DROIDDOC_OPTIONS := \
365
    -knowntags ./frameworks/base/docs/knowntags.txt \
366 367 368
    -since ./frameworks/base/api/1.xml 1 \
    -since ./frameworks/base/api/2.xml 2 \
    -since ./frameworks/base/api/3.xml 3 \
369
    -since ./frameworks/base/api/4.xml 4 \
370
    -since ./frameworks/base/api/5.xml 5 \
371
    -since ./frameworks/base/api/6.xml 6 \
372
    -since ./frameworks/base/api/7.xml 7 \
373
    -since ./frameworks/base/api/8.xml 8 \
374
    -since ./frameworks/base/api/current.xml HC \
375
		-werror -hide 113 \
376 377
		-overview $(LOCAL_PATH)/core/java/overview.html

378 379 380 381
framework_docs_LOCAL_ADDITIONAL_JAVA_DIR:= $(call intermediates-dir-for,JAVA_LIBRARIES,framework)

framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
    frameworks/base/docs/knowntags.txt
382 383 384

sample_dir := development/samples

385 386
# the list here should match the list of samples included in the sdk samples package
# (see development/build/sdk.atree)
387 388 389
web_docs_sample_code_flags := \
		-hdf android.hasSamples 1 \
		-samplecode $(sample_dir)/ApiDemos \
390
		            resources/samples/ApiDemos "API Demos" \
391 392
		-samplecode $(sample_dir)/BackupRestore \
		            resources/samples/BackupRestore "Backup and Restore" \
393 394
		-samplecode $(sample_dir)/BluetoothChat \
		            resources/samples/BluetoothChat "Bluetooth Chat" \
395 396
		-samplecode $(sample_dir)/BusinessCard \
		            resources/samples/BusinessCard "Business Card" \
397 398
		-samplecode $(sample_dir)/ContactManager \
		            resources/samples/ContactManager "Contact Manager" \
399 400
                -samplecode $(sample_dir)/CubeLiveWallpaper \
                            resources/samples/CubeLiveWallpaper "Live Wallpaper" \
401
		-samplecode $(sample_dir)/Home \
402
		            resources/samples/Home "Home" \
Dianne Hackborn's avatar
Dianne Hackborn committed
403 404
		-samplecode $(sample_dir)/HeavyWeight \
		            resources/samples/HeavyWeight "Heavy Weight App" \
405
		-samplecode $(sample_dir)/JetBoy \
406
		            resources/samples/JetBoy "JetBoy" \
407
		-samplecode $(sample_dir)/LunarLander \
408 409 410
		            resources/samples/LunarLander "Lunar Lander" \
		-samplecode $(sample_dir)/MultiResolution \
		            resources/samples/MultiResolution "Multiple Resolutions" \
411
		-samplecode $(sample_dir)/NotePad \
412
		            resources/samples/NotePad "Note Pad" \
Dianne Hackborn's avatar
Dianne Hackborn committed
413 414
		-samplecode $(sample_dir)/SampleSyncAdapter \
		            resources/samples/SampleSyncAdapter "Sample Sync Adapter" \
415
		-samplecode $(sample_dir)/SearchableDictionary \
416
		            resources/samples/SearchableDictionary "Searchable Dictionary v2" \
417
		-samplecode $(sample_dir)/Snake \
418
		            resources/samples/Snake "Snake" \
419
		-samplecode $(sample_dir)/SoftKeyboard \
420
		            resources/samples/SoftKeyboard "Soft Keyboard" \
421 422 423 424
		-samplecode $(sample_dir)/Spinner  \
		            resources/samples/Spinner "Spinner" \
		-samplecode $(sample_dir)/SpinnerTest \
		            resources/samples/SpinnerTest "SpinnerTest" \
425 426 427 428
		-samplecode $(sample_dir)/TicTacToeLib  \
		            resources/samples/TicTacToeLib "TicTacToeLib" \
		-samplecode $(sample_dir)/TicTacToeMain \
		            resources/samples/TicTacToeMain "TicTacToeMain" \
429 430 431
		-samplecode $(sample_dir)/Wiktionary \
		            resources/samples/Wiktionary "Wiktionary" \
		-samplecode $(sample_dir)/WiktionarySimple \
432 433
		            resources/samples/WiktionarySimple "Wiktionary (Simplified)" \
		-samplecode $(sample_dir)/VoiceRecognitionService \
Gilles Debunne's avatar
Gilles Debunne committed
434 435 436
		            resources/samples/VoiceRecognitionService "Voice Recognition Service" \
		-samplecode $(sample_dir)/XmlAdapters \
		            resources/samples/XmlAdapters "XML Adapters"
437

438 439
## SDK version identifiers used in the published docs
  # major[.minor] version for current SDK. (full releases only)
440
framework_docs_SDK_VERSION:=2.2
441
  # release version (ie "Release x")  (full releases only)
Dirk Dougherty's avatar
Dirk Dougherty committed
442
framework_docs_SDK_REL_ID:=1
443
  # flag to build offline docs for a preview release
Dirk Dougherty's avatar
Dirk Dougherty committed
444
framework_docs_SDK_PREVIEW:=0
445 446 447

framework_docs_LOCAL_DROIDDOC_OPTIONS += \
		-hdf sdk.version $(framework_docs_SDK_VERSION) \
448
		-hdf sdk.rel.id $(framework_docs_SDK_REL_ID)
449

450 451 452 453 454 455 456 457 458 459
# ====  the api stubs and current.xml ===========================
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
460
LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
461 462 463 464 465 466 467 468 469 470 471

LOCAL_MODULE := api-stubs

LOCAL_DROIDDOC_OPTIONS:=\
		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
		-stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_stubs_current_intermediates/src \
		-apixml $(INTERNAL_PLATFORM_API_FILE) \
		-nodocs

LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk

472 473
LOCAL_UNINSTALLABLE_MODULE := true

474 475
include $(BUILD_DROIDDOC)

476 477
# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
$(full_target): $(framework_built) $(gen)
478 479 480
$(INTERNAL_PLATFORM_API_FILE): $(full_target)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))

481 482 483 484 485 486 487 488 489 490
# ====  check javadoc comments but don't generate docs ========
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
491
LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
492 493 494 495 496 497 498 499 500

LOCAL_MODULE := doc-comment-check

LOCAL_DROIDDOC_OPTIONS:=\
		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
		-parsecomments

LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk

501 502
LOCAL_UNINSTALLABLE_MODULE := true

503 504 505 506 507 508 509
include $(BUILD_DROIDDOC)

# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
$(full_target): $(framework_built) $(gen)

droidcore: doc-comment-check-docs

510 511 512 513 514 515 516 517 518 519
# ====  static html in the sdk ==================================
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
520
LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
521 522 523 524 525

LOCAL_MODULE := offline-sdk

LOCAL_DROIDDOC_OPTIONS:=\
		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
526
                $(web_docs_sample_code_flags) \
527
                -offlinemode \
528 529 530 531
		-title "Android SDK" \
		-proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
		-todo $(OUT_DOCS)/$(LOCAL_MODULE)-docs-todo.html \
		-sdkvalues $(OUT_DOCS) \
532
		-hdf android.whichdoc offline
533 534

ifeq ($(framework_docs_SDK_PREVIEW),true)
535
  LOCAL_DROIDDOC_OPTIONS += -hdf sdk.preview true
536
endif
537 538 539 540 541 542 543

LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk

include $(BUILD_DROIDDOC)

static_doc_index_redirect := $(out_dir)/index.html
$(static_doc_index_redirect): \
544
	$(LOCAL_PATH)/docs/docs-documentation-redirect.html | $(ACP)
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
	$(hide) mkdir -p $(dir $@)
	$(hide) $(ACP) $< $@

$(full_target): $(static_doc_index_redirect)
$(full_target): $(framework_built)

# ==== docs for the web (on the google app engine server) =======================
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
LOCAL_STATIC_JAVA_LIBRARIES:=$(framework_docs_LOCAL_STATIC_JAVA_LIBRARIES)
LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES)
LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
562
LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
563 564 565 566

LOCAL_MODULE := online-sdk

LOCAL_DROIDDOC_OPTIONS:= \
567 568 569
		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
		$(web_docs_sample_code_flags) \
		-toroot / \
570 571
		-hdf android.whichdoc online \
		-hdf template.showLanguageMenu true
572 573 574 575 576

LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk

include $(BUILD_DROIDDOC)

577
# explicitly specify that online-sdk depends on framework-res and any generated docs
578
$(full_target): framework-res-package-target
579 580 581 582 583 584 585 586 587 588 589

# ==== docs that have all of the stuff that's @hidden =======================
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES) framework
LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
LOCAL_ADDITIONAL_JAVA_DIR:=$(call intermediates-dir-for,JAVA_LIBRARIES,framework)
590
LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
591 592 593 594

LOCAL_MODULE := hidden
LOCAL_DROIDDOC_OPTIONS:=\
		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
595 596
		-title "Android SDK - Including hidden APIs."
#		-hidden
597 598 599 600 601 602 603 604 605

LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk

include $(BUILD_DROIDDOC)

# Build ext.jar
# ============================================================

ext_dirs := \
606
	../../external/nist-sip/java \
607
	../../external/apache-http/src \
608 609
	../../external/tagsoup/src \
	../../external/libphonenumber/java/src
610 611 612

ext_src_files := $(call all-java-files-under,$(ext_dirs))

613 614 615
ext_res_dirs := \
	../../external/libphonenumber/java/src

616 617 618 619 620 621 622
# ====  the library  =========================================
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(ext_src_files)

LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVA_LIBRARIES := core
623
LOCAL_JAVA_RESOURCE_DIRS := $(ext_res_dirs)
624
LOCAL_MODULE_TAGS := optional
625 626
LOCAL_MODULE := ext

627 628 629
LOCAL_NO_EMMA_INSTRUMENT := true
LOCAL_NO_EMMA_COMPILE := true

630 631 632 633 634 635 636 637 638 639 640
include $(BUILD_JAVA_LIBRARY)


# Include subdirectory makefiles
# ============================================================

# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
# team really wants is to build the stuff defined by this makefile.
ifeq (,$(ONE_SHOT_MAKEFILE))
include $(call first-makefiles-under,$(LOCAL_PATH))
endif