Merge commit 'remotes/korg/cupcake'

Conflicts:
	core/api/1.xml
	core/api/current.xml
	core/main.mk
This commit is contained in:
Jean-Baptiste Queru
2008-12-19 07:58:19 -08:00
110 changed files with 3275 additions and 610649 deletions

View File

@@ -53,7 +53,7 @@ endif
# Choose a product to build for. Look in the products directory for ones # Choose a product to build for. Look in the products directory for ones
# that work. # that work.
ifndef TARGET_PRODUCT ifndef TARGET_PRODUCT
#TARGET_PRODUCT:=sooner #TARGET_PRODUCT:=generic
endif endif
# Choose additional targets to always install, even when building # Choose additional targets to always install, even when building
@@ -74,8 +74,14 @@ endif
# This mechanism does not currently support values containing spaces. # This mechanism does not currently support values containing spaces.
#ADDITIONAL_BUILD_PROPERTIES += #ADDITIONAL_BUILD_PROPERTIES +=
# If you want to reduce the system.img size by several meg, and are willing to
# lose access to CJK (and other) character sets, define NO_FALLBACK_FONT:=true
ifndef NO_FALLBACK_FONT
#NO_FALLBACK_FONT:=true
endif
# when the build system changes such that this file must be updated, this # when the build system changes such that this file must be updated, this
# variable will be changed. After you have modified this file with the new # variable will be changed. After you have modified this file with the new
# changes (see buildspec.mk.default), update this to the new value from # changes (see buildspec.mk.default), update this to the new value from
# buildspec.mk.default. # buildspec.mk.default.
BUILD_ENV_SEQUENCE_NUMBER := 8 BUILD_ENV_SEQUENCE_NUMBER := 9

View File

@@ -18,7 +18,7 @@
# WHEN DOING SO, DELETE ANY "add-clean-step" ENTRIES THAT HAVE PILED UP. # WHEN DOING SO, DELETE ANY "add-clean-step" ENTRIES THAT HAVE PILED UP.
# ********************************************************************** # **********************************************************************
# #
INTERNAL_CLEAN_BUILD_VERSION := 1 INTERNAL_CLEAN_BUILD_VERSION := 2
# #
# *********************************************************************** # ***********************************************************************
# Do not touch INTERNAL_CLEAN_BUILD_VERSION if you've added a clean step! # Do not touch INTERNAL_CLEAN_BUILD_VERSION if you've added a clean step!

View File

@@ -1,9 +1,5 @@
# Put some miscellaneous rules here # Put some miscellaneous rules here
ifeq (,$(REQUESTED_PRODUCT))
REQUESTED_PRODUCT := $(TARGET_PRODUCT)
endif
# Pick a reasonable string to use to identify files. # Pick a reasonable string to use to identify files.
ifneq "" "$(filter eng.%,$(BUILD_NUMBER))" ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
# BUILD_NUMBER has a timestamp in it, which means that # BUILD_NUMBER has a timestamp in it, which means that
@@ -57,14 +53,6 @@ ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
ADDITIONAL_BUILD_PROPERTIES := \ ADDITIONAL_BUILD_PROPERTIES := \
$(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES)) $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))
build_target := $(strip $(firstword \
$(filter user userdebug sdk tests all, $(MAKECMDGOALS))))
ifeq ($(build_target),)
# eng, droid, or nothing
build_target := eng
endif
$(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_TARGET := $(build_target)
# A list of arbitrary tags describing the build configuration. # A list of arbitrary tags describing the build configuration.
# Force ":=" so we can use += # Force ":=" so we can use +=
BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS) BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
@@ -80,12 +68,12 @@ endif
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS))) BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
# A human-readable string that descibes this build in detail. # A human-readable string that descibes this build in detail.
build_desc := $(REQUESTED_PRODUCT)-$(build_target) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER) $(BUILD_VERSION_TAGS) build_desc := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER) $(BUILD_VERSION_TAGS)
$(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_DESC := $(build_desc) $(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_DESC := $(build_desc)
# The string used to uniquely identify this build; used by the OTA server. # The string used to uniquely identify this build; used by the OTA server.
ifeq (,$(strip $(BUILD_FINGERPRINT))) ifeq (,$(strip $(BUILD_FINGERPRINT)))
BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(REQUESTED_PRODUCT)/$(TARGET_PRODUCT)/$(TARGET_BOOTLOADER_BOARD_NAME):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(build_target)/$(BUILD_VERSION_TAGS) BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE)/$(TARGET_BOOTLOADER_BOARD_NAME):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
endif endif
# Selects the first locale in the list given as the argument, # Selects the first locale in the list given as the argument,
@@ -108,9 +96,9 @@ BUILDINFO_SH := build/tools/buildinfo.sh
$(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE)
@echo Target buildinfo: $@ @echo Target buildinfo: $@
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) TARGET_BUILD_TYPE="$(PRIVATE_BUILD_TARGET)" \ $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
TARGET_PRODUCT="$(TARGET_PRODUCT)" \ TARGET_DEVICE="$(TARGET_DEVICE)" \
PRODUCT_NAME="$(REQUESTED_PRODUCT)" \ PRODUCT_NAME="$(TARGET_PRODUCT)" \
PRODUCT_BRAND="$(PRODUCT_BRAND)" \ PRODUCT_BRAND="$(PRODUCT_BRAND)" \
PRODUCT_DEFAULT_LANGUAGE="$(call default-locale-language,$(PRODUCT_LOCALES))" \ PRODUCT_DEFAULT_LANGUAGE="$(call default-locale-language,$(PRODUCT_LOCALES))" \
PRODUCT_DEFAULT_REGION="$(call default-locale-region,$(PRODUCT_LOCALES))" \ PRODUCT_DEFAULT_REGION="$(call default-locale-region,$(PRODUCT_LOCALES))" \
@@ -125,8 +113,8 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE)
TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \ TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \
BUILD_FINGERPRINT="$(BUILD_FINGERPRINT)" \ BUILD_FINGERPRINT="$(BUILD_FINGERPRINT)" \
bash $(BUILDINFO_SH) > $@ bash $(BUILDINFO_SH) > $@
$(hide) if [ -f $(TARGET_PRODUCT_DIR)/system.prop ]; then \ $(hide) if [ -f $(TARGET_DEVICE_DIR)/system.prop ]; then \
cat $(TARGET_PRODUCT_DIR)/system.prop >> $@; \ cat $(TARGET_DEVICE_DIR)/system.prop >> $@; \
fi fi
$(if $(ADDITIONAL_BUILD_PROPERTIES), \ $(if $(ADDITIONAL_BUILD_PROPERTIES), \
$(hide) echo >> $@; \ $(hide) echo >> $@; \
@@ -137,7 +125,6 @@ $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE)
echo "$(line)" >> $@;) echo "$(line)" >> $@;)
build_desc := build_desc :=
build_target :=
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# sdk-build.prop # sdk-build.prop
@@ -175,14 +162,14 @@ $(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT)
@echo Package stats: $@ @echo Package stats: $@
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) rm -f $@ $(hide) rm -f $@
$(hide) tools/dump-package-stats $^ > $@ $(hide) build/tools/dump-package-stats $^ > $@
.PHONY: package-stats .PHONY: package-stats
package-stats: $(PACKAGE_STATS_FILE) package-stats: $(PACKAGE_STATS_FILE)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Cert-to-package mapping. Used by the post-build signing tools. # Cert-to-package mapping. Used by the post-build signing tools.
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -275,10 +262,22 @@ ifdef BOARD_KERNEL_CMDLINE
endif endif
INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true)
tmp_dir_for_image := $(call intermediates-dir-for,EXECUTABLES,boot_img)/bootimg
INTERNAL_BOOTIMAGE_ARGS += --tmpdir $(tmp_dir_for_image)
INTERNAL_BOOTIMAGE_ARGS += --genext2fs $(MKEXT2IMG)
$(INSTALLED_BOOTIMAGE_TARGET): $(MKEXT2IMG) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,"Target boot image: $@")
$(hide) $(MKEXT2BOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
else # TARGET_BOOTIMAGE_USE_EXT2 != true
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,"Target boot image: $@") $(call pretty,"Target boot image: $@")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@ $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
$(hide) $(call assert-max-file-size,$@,$(BOARD_BOOTIMAGE_MAX_SIZE)) $(hide) $(call assert-max-file-size,$@,$(BOARD_BOOTIMAGE_MAX_SIZE))
endif # TARGET_BOOTIMAGE_USE_EXT2
else # TARGET_NO_KERNEL else # TARGET_NO_KERNEL
# HACK: The top-level targets depend on the bootimage. Not all targets # HACK: The top-level targets depend on the bootimage. Not all targets
@@ -315,7 +314,7 @@ endif
# it changes, they'll run again. # it changes, they'll run again.
# #
# TODO: We could clean this up so that we just record the locations of the # TODO: We could clean this up so that we just record the locations of the
# original notice files instead of making rules to copy them somwehere. # original notice files instead of making rules to copy them somwehere.
# Then we could traverse that without quite as much bash drama. # Then we could traverse that without quite as much bash drama.
define combine-notice-files define combine-notice-files
$(1) $(2): PRIVATE_MESSAGE := $(3) $(1) $(2): PRIVATE_MESSAGE := $(3)
@@ -403,7 +402,7 @@ target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html
tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt
tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html
kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt
$(eval $(call combine-notice-files, \ $(eval $(call combine-notice-files, \
$(target_notice_file_txt), \ $(target_notice_file_txt), \
@@ -444,6 +443,13 @@ $(kernel_notice_file): \
# Targets for user images # Targets for user images
# ################################################################# # #################################################################
ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
include external/genext2fs/Config.mk
INTERNAL_MKUSERFS := $(MKEXT2IMG)
else
INTERNAL_MKUSERFS := $(MKYAFFS2)
endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system yaffs image # system yaffs image
# #
@@ -460,14 +466,26 @@ INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \
$(ALL_GENERATED_SOURCES) \ $(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES)) $(ALL_DEFAULT_INSTALLED_MODULES))
ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
## generate an ext2 image
# $(1): output file
define build-systemimage-target
@echo "Target system fs image: $(1)"
$(call build-userimage-ext2-target,$(TARGET_OUT),$(1),system,)
endef
else # TARGET_USERIMAGES_USE_EXT2 != true
## generate a yaffs2 image
# $(1): output file # $(1): output file
define build-systemimage-target define build-systemimage-target
@echo "Target system fs image: $(1)" @echo "Target system fs image: $(1)"
@mkdir -p $(dir $(1)) @mkdir -p $(dir $(1))
$(hide) $(MKYAFFS2) -f $(TARGET_OUT) $(1) $(hide) $(MKYAFFS2) -f $(TARGET_OUT) $(1)
endef endef
endif # TARGET_USERIMAGES_USE_EXT2
$(BUILT_SYSTEMIMAGE_UNOPT): $(INTERNAL_SYSTEMIMAGE_FILES) | $(MKYAFFS2) $(BUILT_SYSTEMIMAGE_UNOPT): $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_MKUSERFS)
$(call build-systemimage-target,$@) $(call build-systemimage-target,$@)
# The installed image, which may be optimized or unoptimized. # The installed image, which may be optimized or unoptimized.
@@ -492,34 +510,91 @@ $(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) | $(ACP)
$(copy-file-to-target) $(copy-file-to-target)
$(hide) $(call assert-max-file-size,$@,$(BOARD_SYSTEMIMAGE_MAX_SIZE)) $(hide) $(call assert-max-file-size,$@,$(BOARD_SYSTEMIMAGE_MAX_SIZE))
systemimage: $(INSTALLED_SYSTEMIMAGE) report_config systemimage: $(INSTALLED_SYSTEMIMAGE)
.PHONY: systemimage-nodeps snod .PHONY: systemimage-nodeps snod
systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \ systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
report_config | $(MKYAFFS2) | $(INTERNAL_MKUSERFS)
@echo "make $@: ignoring dependencies" @echo "make $@: ignoring dependencies"
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE)) $(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
$(hide) $(call assert-max-file-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_MAX_SIZE)) $(hide) $(call assert-max-file-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_MAX_SIZE))
#######
## system tarball
define build-systemtarball-target
$(call pretty,"Target system fs tarball: $(INSTALLED_SYSTEMTARBALL_TARGET)")
$(MKTARBALL) $(FS_GET_STATS) \
$(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) \
$(INSTALLED_SYSTEMTARBALL_TARGET)
endef
system_tar := $(PRODUCT_OUT)/system.tar
INSTALLED_SYSTEMTARBALL_TARGET := $(system_tar).bz2
$(INSTALLED_SYSTEMTARBALL_TARGET): PRIVATE_SYSTEM_TAR := $(system_tar)
$(INSTALLED_SYSTEMTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_SYSTEMIMAGE_FILES)
$(build-systemtarball-target)
.PHONY: systemtarball-nodeps
systemtarball-nodeps: $(FS_GET_STATS) \
$(filter-out systemtarball-nodeps stnod,$(MAKECMDGOALS))
$(build-systemtarball-target)
.PHONY: stnod
stnod: systemtarball-nodeps
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# data partition image # data partition image
INTERNAL_USERDATAIMAGE_FILES := \ INTERNAL_USERDATAIMAGE_FILES := \
$(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
## Generate an ext2 image
define build-userdataimage-target
$(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
$(call build-userimage-ext2-target,$(TARGET_OUT_DATA),$(INSTALLED_USERDATAIMAGE_TARGET),userdata,)
$(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE))
endef
else # TARGET_USERIMAGES_USE_EXT2 != true
## Generate a yaffs2 image
define build-userdataimage-target define build-userdataimage-target
$(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)") $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
$(hide) $(MKYAFFS2) -f $(TARGET_OUT_DATA) $(INSTALLED_USERDATAIMAGE_TARGET) $(hide) $(MKYAFFS2) -f $(TARGET_OUT_DATA) $(INSTALLED_USERDATAIMAGE_TARGET)
$(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE)) $(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE))
endef endef
endif # TARGET_USERIMAGES_USE_EXT2
INSTALLED_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img INSTALLED_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
$(INSTALLED_USERDATAIMAGE_TARGET): $(MKYAFFS2) $(INTERNAL_USERDATAIMAGE_FILES) $(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_MKUSERFS) \
$(INTERNAL_USERDATAIMAGE_FILES)
$(build-userdataimage-target) $(build-userdataimage-target)
.PHONY: userdataimage-nodeps .PHONY: userdataimage-nodeps
userdataimage-nodeps: $(MKYAFFS2) userdataimage-nodeps: $(INTERNAL_MKUSERFS)
$(build-userdataimage-target) $(build-userdataimage-target)
#######
## data partition tarball
define build-userdatatarball-target
$(call pretty,"Target userdata fs tarball: " \
"$(INSTALLED_USERDATATARBALL_TARGET)")
$(MKTARBALL) $(FS_GET_STATS) \
$(PRODUCT_OUT) data $(PRIVATE_USERDATA_TAR) \
$(INSTALLED_USERDATATARBALL_TARGET)
endef
userdata_tar := $(PRODUCT_OUT)/userdata.tar
INSTALLED_USERDATATARBALL_TARGET := $(userdata_tar).bz2
$(INSTALLED_USERDATATARBALL_TARGET): PRIVATE_USERDATA_TAR := $(userdata_tar)
$(INSTALLED_USERDATATARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_USERDATAIMAGE_FILES)
$(build-userdatatarball-target)
.PHONY: userdatatarball-nodeps
userdatatarball-nodeps: $(FS_GET_STATS)
$(build-userdatatarball-target)
# If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true # If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true
ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY))) ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)))
@@ -578,9 +653,15 @@ endif
.PHONY: recoveryimage .PHONY: recoveryimage
recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET)
# -----------------------------------------------------------------
# bring in the installer image generation defines if necessary
ifeq ($(TARGET_USE_DISKINSTALLER),true)
include bootable/diskinstaller/config.mk
endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# OTA update package # OTA update package
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -588,7 +669,13 @@ name := $(name)-ota-$(FILE_NAME_TAG)
INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
INTERNAL_OTA_INTERMEDIATES_DIR := $(call intermediates-dir-for,PACKAGING,ota) INTERNAL_OTA_INTERMEDIATES_DIR := $(call intermediates-dir-for,PACKAGING,ota)
# If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true
ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)))
INTERNAL_OTA_RECOVERYIMAGE_TARGET := $(INTERNAL_OTA_INTERMEDIATES_DIR)/system/recovery.img INTERNAL_OTA_RECOVERYIMAGE_TARGET := $(INTERNAL_OTA_INTERMEDIATES_DIR)/system/recovery.img
else
INTERNAL_OTA_RECOVERYIMAGE_TARGET :=
endif
INTERNAL_OTA_SCRIPT_TARGET := $(INTERNAL_OTA_INTERMEDIATES_DIR)/META-INF/com/google/android/update-script INTERNAL_OTA_SCRIPT_TARGET := $(INTERNAL_OTA_INTERMEDIATES_DIR)/META-INF/com/google/android/update-script
# Sign OTA packages with the test key by default. # Sign OTA packages with the test key by default.
@@ -635,16 +722,18 @@ $(INTERNAL_OTA_SCRIPT_TARGET): \
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
@rm -rf $@ @rm -rf $@
@echo "Update script: $@" @echo "Update script: $@"
$(hide) TARGET_PRODUCT=$(TARGET_PRODUCT) \ $(hide) TARGET_DEVICE=$(TARGET_DEVICE) \
$< $(SYSTEMIMAGE_SOURCE_DIR) \ $< $(SYSTEMIMAGE_SOURCE_DIR) \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
> $@ > $@
ifneq (,$(INTERNAL_OTA_RECOVERYIMAGE_TARGET))
# This copy is so recovery.img can be in /system within the OTA package. # This copy is so recovery.img can be in /system within the OTA package.
# That way it gets installed into the system image, which in turn installs it. # That way it gets installed into the system image, which in turn installs it.
$(INTERNAL_OTA_RECOVERYIMAGE_TARGET): $(INSTALLED_RECOVERYIMAGE_TARGET) $(INTERNAL_OTA_RECOVERYIMAGE_TARGET): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ACP)
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) $(ACP) $< $@ $(hide) $(ACP) $< $@
endif
.PHONY: otapackage .PHONY: otapackage
otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) otapackage: $(INTERNAL_OTA_PACKAGE_TARGET)
@@ -667,12 +756,12 @@ $(TARGET_OUT_ETC)/security/otacerts.zip: $(OTA_PUBLIC_KEYS)
$(hide) mkdir -p $(dir $@) $(hide) mkdir -p $(dir $@)
zip -qj $@ $(OTA_PUBLIC_KEYS) zip -qj $@ $(OTA_PUBLIC_KEYS)
# The device does not support JKS, see bug 857840. # The device does not support JKS.
# $(hide) for f in $(OTA_PUBLIC_KEYS); do \ # $(hide) for f in $(OTA_PUBLIC_KEYS); do \
# echo "keytool: $@ <= $$f" && \ # echo "keytool: $@ <= $$f" && \
# keytool -keystore $@ -storepass $(notdir $@) -noprompt \ # keytool -keystore $@ -storepass $(notdir $@) -noprompt \
# -import -file $$f -alias $(notdir $$f) || exit 1; \ # -import -file $$f -alias $(notdir $$f) || exit 1; \
# done # done
ifdef RECOVERY_INSTALL_OTA_KEYS_INC ifdef RECOVERY_INSTALL_OTA_KEYS_INC
# Generate a C-includable file containing the keys. # Generate a C-includable file containing the keys.
@@ -694,7 +783,7 @@ endif
# This zip can be used to create an OTA package or filesystem image # This zip can be used to create an OTA package or filesystem image
# as a post-build step. # as a post-build step.
# #
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -736,7 +825,9 @@ $(BUILT_TARGET_FILES_PACKAGE): \
$(hide) mkdir -p $(zip_root)/RECOVERY $(hide) mkdir -p $(zip_root)/RECOVERY
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root, \
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/RECOVERY/RAMDISK) $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/RECOVERY/RAMDISK)
ifdef INSTALLED_KERNEL_TARGET
$(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel
endif
ifdef INSTALLED_2NDBOOTLOADER_TARGET ifdef INSTALLED_2NDBOOTLOADER_TARGET
$(hide) $(ACP) \ $(hide) $(ACP) \
$(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second
@@ -748,7 +839,9 @@ endif
$(hide) mkdir -p $(zip_root)/BOOT $(hide) mkdir -p $(zip_root)/BOOT
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root, \
$(TARGET_ROOT_OUT),$(zip_root)/BOOT/RAMDISK) $(TARGET_ROOT_OUT),$(zip_root)/BOOT/RAMDISK)
ifdef INSTALLED_KERNEL_TARGET
$(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel
endif
ifdef INSTALLED_2NDBOOTLOADER_TARGET ifdef INSTALLED_2NDBOOTLOADER_TARGET
$(hide) $(ACP) \ $(hide) $(ACP) \
$(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second
@@ -786,7 +879,7 @@ target-files-package: $(BUILT_TARGET_FILES_PACKAGE)
# This is very similar to BUILT_TARGET_FILES_PACKAGE, but we # This is very similar to BUILT_TARGET_FILES_PACKAGE, but we
# only grab SYSTEM and DATA, and it's called "*-tests-*.zip". # only grab SYSTEM and DATA, and it's called "*-tests-*.zip".
# #
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -826,7 +919,7 @@ tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE)
# A zip of the symbols directory. Keep the full paths to make it # A zip of the symbols directory. Keep the full paths to make it
# more obvious where these files came from. # more obvious where these files came from.
# #
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -843,7 +936,7 @@ $(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE) $(INSTALLED_BOOTIMAGE_TARGET)
# A zip of the Android Apps. Not keeping full path so that we don't # A zip of the Android Apps. Not keeping full path so that we don't
# include product names when distributing # include product names when distributing
# #
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -875,7 +968,7 @@ INTERNAL_UPDATE_PACKAGE_FILES += \
ifneq ($(strip $(INTERNAL_UPDATE_PACKAGE_FILES)),) ifneq ($(strip $(INTERNAL_UPDATE_PACKAGE_FILES)),)
name := $(REQUESTED_PRODUCT) name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug) ifeq ($(TARGET_BUILD_TYPE),debug)
name := $(name)_debug name := $(name)_debug
endif endif
@@ -898,12 +991,12 @@ ifneq ($(TARGET_SIMULATOR),true)
INTERNAL_EMULATOR_PACKAGE_FILES += \ INTERNAL_EMULATOR_PACKAGE_FILES += \
$(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \ $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \
prebuilt/android-arm/kernel-qemu \ prebuilt/android-arm/kernel/kernel-qemu \
$(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_SYSTEMIMAGE) \ $(INSTALLED_SYSTEMIMAGE) \
$(INSTALLED_USERDATAIMAGE_TARGET) $(INSTALLED_USERDATAIMAGE_TARGET)
name := $(REQUESTED_PRODUCT)-emulator-$(FILE_NAME_TAG) name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG)
INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
@@ -917,7 +1010,7 @@ endif
# The pdk package (Platform Development Kit) # The pdk package (Platform Development Kit)
ifneq (,$(filter pdk,$(MAKECMDGOALS))) ifneq (,$(filter pdk,$(MAKECMDGOALS)))
include pdk/Pdk.mk include development/pdk/Pdk.mk
endif endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@@ -972,7 +1065,7 @@ sdk_atree_files := \
deps := \ deps := \
$(target_notice_file_txt) \ $(target_notice_file_txt) \
$(tools_notice_file_txt) \ $(tools_notice_file_txt) \
$(OUT_DOCS)/framework-timestamp \ $(OUT_DOCS)/offline-sdk-timestamp \
$(INTERNAL_UPDATE_PACKAGE_TARGET) \ $(INTERNAL_UPDATE_PACKAGE_TARGET) \
$(INSTALLED_SDK_BUILD_PROP_TARGET) \ $(INSTALLED_SDK_BUILD_PROP_TARGET) \
$(ATREE_FILES) \ $(ATREE_FILES) \
@@ -1009,10 +1102,10 @@ $(INTERNAL_SDK_TARGET): $(deps)
-I $(PRODUCT_OUT) \ -I $(PRODUCT_OUT) \
-I $(HOST_OUT) \ -I $(HOST_OUT) \
-I $(TARGET_COMMON_OUT_ROOT) \ -I $(TARGET_COMMON_OUT_ROOT) \
-v "PLATFORM_NAME=android-$(PLATFORM_VERSION)" \
-o $(PRIVATE_DIR) && \ -o $(PRIVATE_DIR) && \
mkdir -p $(PRIVATE_DIR)/tools/lib/images/ && \
cp -f $(target_notice_file_txt) \ cp -f $(target_notice_file_txt) \
$(PRIVATE_DIR)/tools/lib/images/NOTICE.txt && \ $(PRIVATE_DIR)/platforms/android-$(PLATFORM_VERSION)/images/NOTICE.txt && \
cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/tools/NOTICE.txt && \ cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/tools/NOTICE.txt && \
HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \
development/tools/scripts/sdk_clean.sh $(PRIVATE_DIR) && \ development/tools/scripts/sdk_clean.sh $(PRIVATE_DIR) && \
@@ -1041,5 +1134,3 @@ $(INTERNAL_FINDBUGS_HTML_TARGET): $(INTERNAL_FINDBUGS_XML_TARGET)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# These are some additional build tasks that need to be run. # These are some additional build tasks that need to be run.
include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk)) include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,10 +8,11 @@ To make these errors go away, you have two choices:
2) You can update current.xml by executing the following commands: 2) You can update current.xml by executing the following commands:
p4 edit config/api/current.xml p4 edit frameworks/base/api/current.xml
make update-api make update-api
To check in the revised current.xml, you will need OWNERS approval. To check in the revised current.xml, you will need OWNERS approval.
****************************** ******************************

View File

@@ -124,10 +124,15 @@ intermediates.COMMON := $(call local-intermediates-dir,COMMON)
########################################################### ###########################################################
# Pick a name for the intermediate and final targets # Pick a name for the intermediate and final targets
########################################################### ###########################################################
LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX) LOCAL_MODULE_STEM := $(strip $(LOCAL_MODULE_STEM))
LOCAL_BUILT_MODULE_STEM:= $(strip $(LOCAL_BUILT_MODULE_STEM)) ifeq ($(LOCAL_MODULE_STEM),)
LOCAL_MODULE_STEM := $(LOCAL_MODULE)
endif
LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE_STEM)$(LOCAL_MODULE_SUFFIX)
LOCAL_BUILT_MODULE_STEM := $(strip $(LOCAL_BUILT_MODULE_STEM))
ifeq ($(LOCAL_BUILT_MODULE_STEM),) ifeq ($(LOCAL_BUILT_MODULE_STEM),)
LOCAL_BUILT_MODULE_STEM:= $(LOCAL_INSTALLED_MODULE_STEM) LOCAL_BUILT_MODULE_STEM := $(LOCAL_INSTALLED_MODULE_STEM)
endif endif
# OVERRIDE_BUILT_MODULE_PATH is only allowed to be used by the # OVERRIDE_BUILT_MODULE_PATH is only allowed to be used by the

View File

@@ -34,9 +34,11 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPP_EXTENSION := $(LOCAL_CPP_EXTENSION)
# Certain modules like libdl have to have symbols resolved at runtime and blow # Certain modules like libdl have to have symbols resolved at runtime and blow
# up if --no-undefined is passed to the linker. # up if --no-undefined is passed to the linker.
ifeq ($(strip $(LOCAL_NO_DEFAULT_COMPILER_FLAGS)),)
ifeq ($(strip $(LOCAL_ALLOW_UNDEFINED_SYMBOLS)),) ifeq ($(strip $(LOCAL_ALLOW_UNDEFINED_SYMBOLS)),)
LOCAL_LDFLAGS := $(LOCAL_LDFLAGS) $($(my_prefix)NO_UNDEFINED_LDFLAGS) LOCAL_LDFLAGS := $(LOCAL_LDFLAGS) $($(my_prefix)NO_UNDEFINED_LDFLAGS)
endif endif
endif
########################################################### ###########################################################
## Define arm-vs-thumb-mode flags. ## Define arm-vs-thumb-mode flags.

View File

@@ -23,4 +23,4 @@
# (like "TC1-RC5"). It must be a single word, and is # (like "TC1-RC5"). It must be a single word, and is
# capitalized by convention. # capitalized by convention.
# #
BUILD_ID := TC3 BUILD_ID := MAIN

View File

@@ -4,6 +4,7 @@
LOCAL_MODULE:= LOCAL_MODULE:=
LOCAL_MODULE_PATH:= LOCAL_MODULE_PATH:=
LOCAL_MODULE_STEM:=
LOCAL_BUILT_MODULE:= LOCAL_BUILT_MODULE:=
LOCAL_BUILT_MODULE_STEM:= LOCAL_BUILT_MODULE_STEM:=
OVERRIDE_BUILT_MODULE_PATH:= OVERRIDE_BUILT_MODULE_PATH:=
@@ -74,6 +75,7 @@ LOCAL_JAR_MANIFEST:=
LOCAL_INSTRUMENTATION_FOR:= LOCAL_INSTRUMENTATION_FOR:=
LOCAL_INSTRUMENTATION_FOR_PACKAGE_NAME:= LOCAL_INSTRUMENTATION_FOR_PACKAGE_NAME:=
LOCAL_AIDL_INCLUDES:= LOCAL_AIDL_INCLUDES:=
LOCAL_JARJAR_RULES:=
LOCAL_ADDITIONAL_JAVA_DIR:= LOCAL_ADDITIONAL_JAVA_DIR:=
LOCAL_ALLOW_UNDEFINED_SYMBOLS:= LOCAL_ALLOW_UNDEFINED_SYMBOLS:=
LOCAL_DX_FLAGS:= LOCAL_DX_FLAGS:=

View File

@@ -9,7 +9,7 @@
# Whatever compiler is on this system. # Whatever compiler is on this system.
ifeq ($(HOST_OS), windows) ifeq ($(HOST_OS), windows)
COMMON_JAVAC := prebuilt/windows/host/bin/javawrap.exe -J-Xmx256m \ COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
-target 1.5 -Xmaxerrs 9999999 -target 1.5 -Xmaxerrs 9999999
else else
COMMON_JAVAC := javac -J-Xmx256m -target 1.5 -Xmaxerrs 9999999 COMMON_JAVAC := javac -J-Xmx256m -target 1.5 -Xmaxerrs 9999999

View File

@@ -7,13 +7,6 @@ $(combo_target)CC := $(CC)
$(combo_target)CXX := $(CXX) $(combo_target)CXX := $(CXX)
$(combo_target)AR := $(AR) $(combo_target)AR := $(AR)
$(combo_target)GLOBAL_CFLAGS += -fPIC -m32
$(combo_target)GLOBAL_CFLAGS += \
-include $(call select-android-config-h,linux-x86)
$(combo_target)GLOBAL_LDFLAGS += -m32
$(combo_target)NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
ifeq ($(combo_target),HOST_) ifeq ($(combo_target),HOST_)
# $(1): The file to check # $(1): The file to check
define get-file-size define get-file-size
@@ -23,5 +16,23 @@ endef
# Which gcc to use to build qemu, which doesn't work right when # Which gcc to use to build qemu, which doesn't work right when
# built with 4.2.1 or later. # built with 4.2.1 or later.
GCCQEMU := prebuilt/linux-x86/toolchain/i686-linux-gnu-3.4.6/bin/gcc GCCQEMU := prebuilt/linux-x86/toolchain/i686-linux-gnu-3.4.6/bin/gcc
endif # _HOST
# On the sim, we build the "host" tools in 64 bit iff the compiler
# does it for us automatically. In other words, that means on 64 bit
# system, they're 64 bit and on 32 bit systems, they're 32 bits. In
# all other cases, we build 32 bit, since this is what we release.
ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true)
$(combo_target)GLOBAL_CFLAGS := $($(combo_target)GLOBAL_CFLAGS) -m32
$(combo_target)GLOBAL_LDFLAGS := $($(combo_target)GLOBAL_LDFLAGS) -m32
endif
$(combo_target)GLOBAL_CFLAGS += -fPIC
$(combo_target)GLOBAL_CFLAGS += \
-include $(call select-android-config-h,linux-x86)
$(combo_target)NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
endif # HOST

View File

@@ -50,8 +50,28 @@ $(combo_target)STATIC_LIB_SUFFIX := .a
$(combo_target)PRELINKER_MAP := $(BUILD_SYSTEM)/prelink-$(combo_os_arch).map $(combo_target)PRELINKER_MAP := $(BUILD_SYSTEM)/prelink-$(combo_os_arch).map
# We try to find a target or host specific file for the os/arch specified, and
# default to just looking for the os/arch one. This will allow us to define
# things separately for targets and hosts that have the same architecture
# but need different defines. e.g. target_linux-x86 and host_linux-x86
ifneq ($(TARGET_SIMULATOR),true)
# Convert the combo_target string to lowercase
combo_target_lc := $(shell echo $(combo_target) | tr '[A-Z]' '[a-z]')
# form combo makefile name like "<path>/target_linux-x86.make",
# "<path>/host_darwin-x86.make", etc.
combo_target_os_arch := $(BUILD_COMBOS)/$(combo_target_lc)$(combo_os_arch).mk
else
combo_target_os_arch :=
endif
# Now include the combo for this specific target. # Now include the combo for this specific target.
ifneq ($(wildcard $(combo_target_os_arch)),)
include $(combo_target_os_arch)
else
include $(BUILD_COMBOS)/$(combo_os_arch).mk include $(BUILD_COMBOS)/$(combo_os_arch).mk
endif
ifneq ($(USE_CCACHE),) ifneq ($(USE_CCACHE),)
ccache := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache ccache := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache

View File

@@ -0,0 +1,129 @@
# Configuration for Linux on x86 as a target.
# Included by combo/select.make
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $($(combo_target)TOOLS_PREFIX)),)
$(combo_target)TOOLS_PREFIX := \
prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu-
endif
$(combo_target)CC := $($(combo_target)TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)
$(combo_target)CXX := $($(combo_target)TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX)
$(combo_target)AR := $($(combo_target)TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX)
$(combo_target)OBJCOPY := $($(combo_target)TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX)
$(combo_target)LD := $($(combo_target)TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX)
ifneq ($(wildcard $($(combo_target)CC)),)
$(combo_target)LIBGCC := \
$(shell $($(combo_target)CC) -m32 -print-file-name=libgcc.a) \
$(shell $($(combo_target)CC) -m32 -print-file-name=libgcc_eh.a)
endif
$(combo_target)NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
libc_root := bionic/libc
libm_root := bionic/libm
libstdc++_root := bionic/libstdc++
libthread_db_root := bionic/libthread_db
# unless CUSTOM_KERNEL_HEADERS is defined, we're going to use
# symlinks located in out/ to point to the appropriate kernel
# headers. see 'config/kernel_headers.make' for more details
#
ifneq ($(CUSTOM_KERNEL_HEADERS),)
KERNEL_HEADERS_COMMON := $(CUSTOM_KERNEL_HEADERS)
KERNEL_HEADERS_ARCH := $(CUSTOM_KERNEL_HEADERS)
else
KERNEL_HEADERS_COMMON := $(libc_root)/kernel/common
KERNEL_HEADERS_ARCH := $(libc_root)/kernel/arch-$(TARGET_ARCH)
endif
KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH)
$(combo_target)GLOBAL_CFLAGS += \
-march=i686 \
-m32 \
-fPIC \
-include $(call select-android-config-h,target_linux-x86)
$(combo_target)GLOBAL_CPPFLAGS += \
-fno-use-cxa-atexit
$(combo_target)C_INCLUDES := \
$(libc_root)/arch-x86/include \
$(libc_root)/include \
$(libstdc++_root)/include \
$(KERNEL_HEADERS) \
$(libm_root)/include \
$(libm_root)/include/i387 \
$(libthread_db_root)/include
TARGET_CRTBEGIN_STATIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o
TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
# TARGET_STRIP_MODULE:=true
$(combo_target)DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm
$(combo_target)CUSTOM_LD_COMMAND := true
define transform-o-to-shared-lib-inner
$(TARGET_CXX) \
$(TARGET_GLOBAL_LDFLAGS) \
-nostdlib -Wl,-soname,$(notdir $@) \
-shared -Bsymbolic \
-fPIC -march=i686 \
$(TARGET_GLOBAL_LD_DIRS) \
$(TARGET_CRTBEGIN_SO_O) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_LDFLAGS) \
$(TARGET_LIBGCC) \
$(TARGET_CRTEND_SO_O)
endef
define transform-o-to-executable-inner
$(TARGET_CXX) \
$(TARGET_GLOBAL_LDFLAGS) \
-nostdlib -Bdynamic \
-Wl,-dynamic-linker,/system/bin/linker \
-Wl,-z,nocopyreloc \
-o $@ \
$(TARGET_GLOBAL_LD_DIRS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
$(TARGET_CRTBEGIN_DYNAMIC_O) \
$(PRIVATE_ALL_OBJECTS) \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(PRIVATE_LDFLAGS) \
$(TARGET_LIBGCC) \
$(TARGET_CRTEND_O)
endef
define transform-o-to-static-executable-inner
$(TARGET_CXX) \
$(TARGET_GLOBAL_LDFLAGS) \
-nostdlib -Bstatic \
-o $@ \
$(TARGET_GLOBAL_LD_DIRS) \
$(TARGET_CRTBEGIN_STATIC_O) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--start-group \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(TARGET_LIBGCC) \
-Wl,--end-group \
$(TARGET_CRTEND_O)
endef
$(combo_target)GLOBAL_CFLAGS += -m32
$(combo_target)GLOBAL_LDFLAGS += -m32

View File

@@ -18,8 +18,8 @@ SRC_HEADERS := \
SRC_HOST_HEADERS:=$(TOPDIR)tools/include SRC_HOST_HEADERS:=$(TOPDIR)tools/include
SRC_LIBRARIES:= $(TOPDIR)libs SRC_LIBRARIES:= $(TOPDIR)libs
SRC_SERVERS:= $(TOPDIR)servers SRC_SERVERS:= $(TOPDIR)servers
SRC_TOOLS:= $(TOPDIR)tools
SRC_TARGET_DIR := $(TOPDIR)build/target SRC_TARGET_DIR := $(TOPDIR)build/target
SRC_API_DIR := $(TOPDIR)frameworks/base/api
# Some specific paths to tools # Some specific paths to tools
SRC_DROIDDOC_DIR := $(TOPDIR)build/tools/droiddoc SRC_DROIDDOC_DIR := $(TOPDIR)build/tools/droiddoc
@@ -94,11 +94,8 @@ COMMON_ANDROID_PACKAGE_SUFFIX := .apk
-include $(TOPDIR)buildspec.mk -include $(TOPDIR)buildspec.mk
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Handle the setup of TARGET_PRODUCT and related variables. # Define most of the global variables. These are the ones that
include $(BUILD_SYSTEM)/product_config.mk # are specific to the user's build configuration.
# ---------------------------------------------------------------
# Define most of the global variables.
include $(BUILD_SYSTEM)/envsetup.mk include $(BUILD_SYSTEM)/envsetup.mk
# $(1): os/arch # $(1): os/arch
@@ -121,7 +118,10 @@ include $(BUILD_SYSTEM)/combo/javac.mk
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Check that the configuration is current. We check that # Check that the configuration is current. We check that
# BUILD_ENV_SEQUENCE_NUMBER is current against this value. # BUILD_ENV_SEQUENCE_NUMBER is current against this value.
# Don't fail if we're called from envsetup, so they have a
# chance to update their environment.
ifeq (,$(strip $(CALLED_FROM_SETUP)))
ifneq (,$(strip $(BUILD_ENV_SEQUENCE_NUMBER))) ifneq (,$(strip $(BUILD_ENV_SEQUENCE_NUMBER)))
ifneq ($(BUILD_ENV_SEQUENCE_NUMBER),$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)) ifneq ($(BUILD_ENV_SEQUENCE_NUMBER),$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER))
$(warning BUILD_ENV_SEQUENCE_NUMBER is set incorrectly.) $(warning BUILD_ENV_SEQUENCE_NUMBER is set incorrectly.)
@@ -134,6 +134,7 @@ $(info *** - Update BUILD_ENV_SEQUENCE_NUMBER to "$(CORRECT_BUILD_ENV_SEQUENCE
$(error bailing..) $(error bailing..)
endif endif
endif endif
endif
# --------------------------------------------------------------- # ---------------------------------------------------------------
@@ -151,6 +152,13 @@ MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX)
MKBOOTIMG := $(HOST_OUT_EXECUTABLES)/mkbootimg$(HOST_EXECUTABLE_SUFFIX) MKBOOTIMG := $(HOST_OUT_EXECUTABLES)/mkbootimg$(HOST_EXECUTABLE_SUFFIX)
MKYAFFS2 := $(HOST_OUT_EXECUTABLES)/mkyaffs2image$(HOST_EXECUTABLE_SUFFIX) MKYAFFS2 := $(HOST_OUT_EXECUTABLES)/mkyaffs2image$(HOST_EXECUTABLE_SUFFIX)
APICHECK := $(HOST_OUT_EXECUTABLES)/apicheck$(HOST_EXECUTABLE_SUFFIX) APICHECK := $(HOST_OUT_EXECUTABLES)/apicheck$(HOST_EXECUTABLE_SUFFIX)
FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX)
MKEXT2IMG := $(HOST_OUT_EXECUTABLES)/genext2fs$(HOST_EXECUTABLE_SUFFIX)
MKEXT2BOOTIMG := external/genext2fs/mkbootimg_ext2.sh
MKTARBALL := build/tools/mktarball.sh
TUNE2FS := tune2fs
E2FSCK := e2fsck
JARJAR := java -jar $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
# dx is java behind a shell script; no .exe necessary. # dx is java behind a shell script; no .exe necessary.
DX := $(HOST_OUT_EXECUTABLES)/dx DX := $(HOST_OUT_EXECUTABLES)/dx
@@ -271,9 +279,9 @@ TARGET_AVAILABLE_SDK_VERSIONS := current \
$(shell function sgrax() { \ $(shell function sgrax() { \
while [ -n "$$1" ] ; do echo $$1 ; shift ; done \ while [ -n "$$1" ] ; do echo $$1 ; shift ; done \
} ; \ } ; \
( sgrax $(patsubst $(BUILD_SYSTEM)/api/%.xml,%, \ ( sgrax $(patsubst $(SRC_API_DIR)/%.xml,%, \
$(filter-out $(BUILD_SYSTEM)/api/current.xml, \ $(filter-out $(SRC_API_DIR)/current.xml, \
$(shell find $(BUILD_SYSTEM)/api -name "*.xml"))) | sort -g ) ) $(shell find $(SRC_API_DIR) -name "*.xml"))) | sort -g ) )
INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.xml INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.xml

View File

@@ -20,23 +20,6 @@
## are used by others to construct the final targets. ## are used by others to construct the final targets.
## ##
# You can be dependent on this target to print to the
# user the current configuration being used.
.PHONY: report_config
report_config:
@echo -e "============================================"\
"\nTARGET_PRODUCT="$(TARGET_PRODUCT)\
"\nTARGET_SIMULATOR="$(TARGET_SIMULATOR)\
"\nTARGET_BUILD_TYPE="$(TARGET_BUILD_TYPE)\
"\nTARGET_ARCH="$(TARGET_ARCH)\
"\nTARGET_OS="$(TARGET_OS)\
"\nHOST_ARCH="$(HOST_ARCH)\
"\nHOST_OS="$(HOST_OS)\
"\nHOST_BUILD_TYPE="$(HOST_BUILD_TYPE)\
"\nBUILD_ID="$(BUILD_ID)\
"\n============================================"
# These are variables we use to collect overall lists # These are variables we use to collect overall lists
# of things being processed. # of things being processed.
@@ -180,6 +163,28 @@ define all-subdir-java-files
$(call all-java-files-under,.) $(call all-java-files-under,.)
endef endef
###########################################################
## Find all of the c files under the named directories.
## Meant to be used like:
## SRC_FILES := $(call all-c-files-under,src tests)
###########################################################
define all-c-files-under
$(patsubst ./%,%, \
$(shell cd $(LOCAL_PATH) ; \
find $(1) -name "*.c" -and -not -name ".*") \
)
endef
###########################################################
## Find all of the c files from here. Meant to be used like:
## SRC_FILES := $(call all-subdir-c-files)
###########################################################
define all-subdir-c-files
$(call all-c-files-under,.)
endef
########################################################### ###########################################################
## Find all files named "I*.aidl" under the named directories, ## Find all files named "I*.aidl" under the named directories,
## which must be relative to $(LOCAL_PATH). The returned list ## which must be relative to $(LOCAL_PATH). The returned list
@@ -669,10 +674,10 @@ $(hide) $(PRIVATE_CXX) \
$(TARGET_GLOBAL_CPPFLAGS) \ $(TARGET_GLOBAL_CPPFLAGS) \
$(PRIVATE_ARM_CFLAGS) \ $(PRIVATE_ARM_CFLAGS) \
) \ ) \
-fno-rtti \
$(PRIVATE_CFLAGS) \ $(PRIVATE_CFLAGS) \
$(PRIVATE_CPPFLAGS) \ $(PRIVATE_CPPFLAGS) \
$(PRIVATE_DEBUG_CFLAGS) \ $(PRIVATE_DEBUG_CFLAGS) \
-fno-rtti \
-MD -o $@ $< -MD -o $@ $<
$(hide) $(transform-d-to-p) $(hide) $(transform-d-to-p)
endef endef
@@ -889,6 +894,7 @@ endef
ifneq ($(TARGET_CUSTOM_LD_COMMAND),true) ifneq ($(TARGET_CUSTOM_LD_COMMAND),true)
define transform-o-to-shared-lib-inner define transform-o-to-shared-lib-inner
$(TARGET_CXX) \ $(TARGET_CXX) \
$(TARGET_GLOBAL_LDFLAGS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \ -Wl,-rpath,\$$ORIGIN/../lib \
-shared -Wl,-soname,$(notdir $@) \ -shared -Wl,-soname,$(notdir $@) \
@@ -949,7 +955,9 @@ endef
ifneq ($(TARGET_CUSTOM_LD_COMMAND),true) ifneq ($(TARGET_CUSTOM_LD_COMMAND),true)
define transform-o-to-executable-inner define transform-o-to-executable-inner
$(TARGET_CXX) -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ $(TARGET_CXX) \
$(TARGET_GLOBAL_LDFLAGS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
$(TARGET_GLOBAL_LD_DIRS) \ $(TARGET_GLOBAL_LD_DIRS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \ -Wl,-rpath,\$$ORIGIN/../lib \
@@ -1002,7 +1010,10 @@ $(HOST_CXX) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \ -Wl,-rpath,\$$ORIGIN/../lib \
$(HOST_GLOBAL_LD_DIRS) \ $(HOST_GLOBAL_LD_DIRS) \
$(PRIVATE_LDFLAGS) $(HOST_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
$(HOST_GLOBAL_LDFLAGS) \
) \
$(PRIVATE_ALL_OBJECTS) \ $(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \ -Wl,--whole-archive \
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \

View File

@@ -14,15 +14,6 @@
# limitations under the License. # limitations under the License.
# #
# HACK HACK HACK
# *** Do not use any of the following as an example for anything else ***
# TODO: remove this hack once the build machine no longer needs "user-dist"
user-dist: user
ifneq (,$(filter user-dist,$(MAKECMDGOALS)))
MAKECMDGOALS := $(patsubst user-dist,user dist,$(MAKECMDGOALS))
endif
# When specifying "dist", the user has asked that we copy the important # When specifying "dist", the user has asked that we copy the important
# files from this build into DIST_DIR. # files from this build into DIST_DIR.
@@ -34,7 +25,7 @@ MAKECMDGOALS := $(strip $(filter-out dist,$(MAKECMDGOALS)))
ifeq (,$(strip $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)))) ifeq (,$(strip $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))))
# The commandline was something like "make dist" or "make dist showcommands". # The commandline was something like "make dist" or "make dist showcommands".
# Add a dependency on a real target. # Add a dependency on a real target.
dist: $(DEFAULT_TARGET) dist: $(DEFAULT_GOAL)
endif endif
ifdef dist_goal ifdef dist_goal
@@ -54,7 +45,7 @@ endef
# certain files with certain goals. When those goals are built # certain files with certain goals. When those goals are built
# and "dist" is specified, the marked files will be copied to DIST_DIR. # and "dist" is specified, the marked files will be copied to DIST_DIR.
# #
# $(1): a list of goals (e.g., "user all") # $(1): a list of goals (e.g. droid, sdk, pdk, ndk)
# $(2): the dist files to add to those goals # $(2): the dist files to add to those goals
define dist-for-goals define dist-for-goals
$(foreach file,$(2), \ $(foreach file,$(2), \

View File

@@ -13,7 +13,36 @@
# people who haven't re-run those will have to do so before they # people who haven't re-run those will have to do so before they
# can build. Make sure to also update the corresponding value in # can build. Make sure to also update the corresponding value in
# buildspec.mk.default and envsetup.sh. # buildspec.mk.default and envsetup.sh.
CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 8 CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 9
# ---------------------------------------------------------------
# The product defaults to generic on hardware and sim on sim
# NOTE: This will be overridden in product_config.mk if make
# was invoked with a PRODUCT-xxx-yyy goal.
ifeq ($(TARGET_PRODUCT),)
ifeq ($(TARGET_SIMULATOR),true)
TARGET_PRODUCT := sim
else
TARGET_PRODUCT := generic
endif
endif
# the variant -- the set of files that are included for a build
ifeq ($(strip $(TARGET_BUILD_VARIANT)),)
TARGET_BUILD_VARIANT := eng
endif
# Read the product specs so we an get TARGET_DEVICE and other
# variables that we need in order to locate the output files.
include $(BUILD_SYSTEM)/product_config.mk
build_variant := $(filter-out eng user userdebug tests,$(TARGET_BUILD_VARIANT))
ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
$(error must be empty or one of: eng user userdebug tests)
endif
# --------------------------------------------------------------- # ---------------------------------------------------------------
@@ -83,11 +112,10 @@ endif
# The following must be set: # The following must be set:
# TARGET_OS = { linux } # TARGET_OS = { linux }
# TARGET_ARCH = { arm | x86 } # TARGET_ARCH = { arm | x86 }
# TARGET_ARCH==arm means that it's not the simulator, and the others
# mean it is the simulator.
# if we're build the simulator, HOST_* is TARGET_* (except for BUILD_TYPE) # if we're build the simulator, HOST_* is TARGET_* (except for BUILD_TYPE)
# otherwise it's arm-linux # otherwise it's <arch>-linux
ifeq ($(TARGET_SIMULATOR),true) ifeq ($(TARGET_SIMULATOR),true)
ifneq ($(HOST_OS),linux) ifneq ($(HOST_OS),linux)
$(error TARGET_SIMULATOR=true is only supported under Linux) $(error TARGET_SIMULATOR=true is only supported under Linux)
@@ -95,7 +123,9 @@ endif
TARGET_ARCH := $(HOST_ARCH) TARGET_ARCH := $(HOST_ARCH)
TARGET_OS := $(HOST_OS) TARGET_OS := $(HOST_OS)
else else
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := arm TARGET_ARCH := arm
endif
TARGET_OS := linux TARGET_OS := linux
endif endif
@@ -112,15 +142,6 @@ else
TARGET_PREBUILT_TAG := android-$(TARGET_ARCH) TARGET_PREBUILT_TAG := android-$(TARGET_ARCH)
endif endif
# the product defaults to sooner on ARM and nothing on sim
ifeq ($(TARGET_PRODUCT),)
ifeq ($(TARGET_SIMULATOR),true)
TARGET_PRODUCT := sim
else
TARGET_PRODUCT := sooner
endif
endif
# --------------------------------------------------------------- # ---------------------------------------------------------------
# figure out the output directories # figure out the output directories
@@ -157,7 +178,7 @@ endif
TARGET_COMMON_OUT_ROOT := $(TARGET_OUT_ROOT)/common TARGET_COMMON_OUT_ROOT := $(TARGET_OUT_ROOT)/common
HOST_COMMON_OUT_ROOT := $(HOST_OUT_ROOT)/common HOST_COMMON_OUT_ROOT := $(HOST_OUT_ROOT)/common
PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_PRODUCT) PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_DEVICE)
OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
@@ -215,12 +236,25 @@ TARGET_ROOT_OUT_USR := $(TARGET_ROOT_OUT)/usr
TARGET_RECOVERY_OUT := $(PRODUCT_OUT)/recovery TARGET_RECOVERY_OUT := $(PRODUCT_OUT)/recovery
TARGET_RECOVERY_ROOT_OUT := $(TARGET_RECOVERY_OUT)/root TARGET_RECOVERY_ROOT_OUT := $(TARGET_RECOVERY_OUT)/root
TARGET_SYSLOADER_OUT := $(PRODUCT_OUT)/sysloader
TARGET_SYSLOADER_ROOT_OUT := $(TARGET_SYSLOADER_OUT)/root
TARGET_SYSLOADER_SYSTEM_OUT := $(TARGET_SYSLOADER_OUT)/root/system
TARGET_INSTALLER_OUT := $(PRODUCT_OUT)/installer
TARGET_INSTALLER_DATA_OUT := $(TARGET_INSTALLER_OUT)/data
TARGET_INSTALLER_ROOT_OUT := $(TARGET_INSTALLER_OUT)/root
TARGET_INSTALLER_SYSTEM_OUT := $(TARGET_INSTALLER_OUT)/root/system
COMMON_MODULE_CLASSES := JAVA_LIBRARIES NOTICE_FILES COMMON_MODULE_CLASSES := JAVA_LIBRARIES NOTICE_FILES
ifeq (,$(strip $(DIST_DIR))) ifeq (,$(strip $(DIST_DIR)))
DIST_DIR := $(OUT_DIR)/dist DIST_DIR := $(OUT_DIR)/dist
endif endif
ifeq ($(PRINT_BUILD_CONFIG),)
PRINT_BUILD_CONFIG := true
endif
# --------------------------------------------------------------- # ---------------------------------------------------------------
# the setpath shell function in envsetup.sh uses this to figure out # the setpath shell function in envsetup.sh uses this to figure out
# what to add to the path given the config we have chosen. # what to add to the path given the config we have chosen.
@@ -275,4 +309,25 @@ $(dumpvar_target):
endif # dumpvar_goals endif # dumpvar_goals
ifneq ($(dumpvar_goals),report_config)
PRINT_BUILD_CONFIG:=
endif
endif # CALLED_FROM_SETUP endif # CALLED_FROM_SETUP
ifneq ($(PRINT_BUILD_CONFIG),)
$(info ============================================)
$(info TARGET_PRODUCT=$(TARGET_PRODUCT))
$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR))
$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
$(info TARGET_ARCH=$(TARGET_ARCH))
$(info HOST_ARCH=$(HOST_ARCH))
$(info HOST_OS=$(HOST_OS))
$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
$(info BUILD_ID=$(BUILD_ID))
$(info ============================================)
endif

View File

@@ -33,8 +33,8 @@ LOCAL_BUILT_MODULE_STEM := $(strip $(LOCAL_BUILT_MODULE_STEM))
ifeq ($(LOCAL_BUILT_MODULE_STEM),) ifeq ($(LOCAL_BUILT_MODULE_STEM),)
$(error $(LOCAL_PATH): Target java template must define LOCAL_BUILT_MODULE_STEM) $(error $(LOCAL_PATH): Target java template must define LOCAL_BUILT_MODULE_STEM)
endif endif
ifeq ($(LOCAL_BUILT_MODULE_STEM),classes.jar) ifneq ($(filter classes-compiled.jar classes.jar,$(LOCAL_BUILT_MODULE_STEM)),)
$(error LOCAL_BUILT_MODULE_STEM may not be "classes.jar") $(error LOCAL_BUILT_MODULE_STEM may not be "$(LOCAL_BUILT_MODULE_STEM)")
endif endif
####################################### #######################################
@@ -64,14 +64,31 @@ ifneq (,$(strip $(all_java_sources)))
# Otherwise, the caller will define it as a prerequisite of # Otherwise, the caller will define it as a prerequisite of
# LOCAL_BUILT_MODULE, so it will inherit the necessary PRIVATE_* # LOCAL_BUILT_MODULE, so it will inherit the necessary PRIVATE_*
# variable definitions. # variable definitions.
# full_classes_jar := $(intermediates.COMMON)/classes.jar
# Compile the java files to a .jar file.
# This intentionally depends on java_sources, not all_java_sources. # This intentionally depends on java_sources, not all_java_sources.
# Deps for generated source files must be handled separately, # Deps for generated source files must be handled separately,
# via deps on the target that generates the sources. # via deps on the target that generates the sources.
full_classes_jar := $(intermediates.COMMON)/classes.jar full_classes_compiled_jar := $(intermediates.COMMON)/classes-compiled.jar
$(full_classes_jar): $(java_sources) $(full_java_lib_deps) $(full_classes_compiled_jar): $(java_sources) $(full_java_lib_deps)
$(transform-java-to-classes.jar) $(transform-java-to-classes.jar)
# Run jarjar if necessary, otherwise just copy the file. This is the last
# part of this step, so the output of this command is full_classes_jar.
full_classes_jarjar_jar := $(full_classes_jar)
ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
$(full_classes_jarjar_jar): $(full_classes_compiled_jar) | jarjar
@echo JarJar: $@
$(hide) $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
else
$(full_classes_jarjar_jar): $(full_classes_compiled_jar) | $(ACP)
@echo Copying: $@
$(hide) $(ACP) $< $@
endif
built_dex := $(intermediates.COMMON)/classes.dex built_dex := $(intermediates.COMMON)/classes.dex
# Override PRIVATE_INTERMEDIATES_DIR so that install-dex-debug # Override PRIVATE_INTERMEDIATES_DIR so that install-dex-debug

View File

@@ -38,6 +38,10 @@ TOPDIR :=
BUILD_SYSTEM := $(TOPDIR)build/core BUILD_SYSTEM := $(TOPDIR)build/core
# This is the default target. It must be the first declared target.
DEFAULT_GOAL := droid
$(DEFAULT_GOAL):
# Set up various standard variables based on configuration # Set up various standard variables based on configuration
# and host information. # and host information.
include $(BUILD_SYSTEM)/config.mk include $(BUILD_SYSTEM)/config.mk
@@ -87,37 +91,37 @@ include $(BUILD_SYSTEM)/version_defaults.mk
# (must be defined before including definitions.make) # (must be defined before including definitions.make)
INTERNAL_MODIFIER_TARGETS := showcommands INTERNAL_MODIFIER_TARGETS := showcommands
# This is the default target. It must be the first declared target
DEFAULT_TARGET := droid
.PHONY: $(DEFAULT_TARGET)
$(DEFAULT_TARGET):
# Bring in standard build system definitions. # Bring in standard build system definitions.
include $(BUILD_SYSTEM)/definitions.mk include $(BUILD_SYSTEM)/definitions.mk
ifneq ($(filter eng user userdebug tests,$(MAKECMDGOALS)),)
$(info ***************************************************************)
$(info ***************************************************************)
$(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \
the make command line.)
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
$(info choosecombo.)
$(info ***************************************************************)
$(info ***************************************************************)
$(error stopping)
endif
### ###
### DO NOT USE THIS AS AN EXAMPLE FOR ANYTHING ELSE; ### In this section we set up the things that are different
### ONLY 'user'/'userdebug'/'tests'/'sdk' GOALS ### between the build variants
### SHOULD REFER TO MAKECMDGOALS.
### ###
## user/userdebug ## ## user/userdebug ##
user_goal := $(filter userdebug user,$(MAKECMDGOALS)) user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT))
enable_target_debugging := true enable_target_debugging := true
ifneq (,$(user_goal)) ifneq (,$(user_variant))
# Make sure that exactly one of {userdebug,user} has been specified,
# and that no non-INTERNAL_MODIFIER_TARGETS goals have been specified.
non_user_goals := \
$(filter-out $(INTERNAL_MODIFIER_TARGETS) $(user_goal),$(MAKECMDGOALS))
ifneq ($(words $(non_user_goals) $(user_goal)),1)
$(error The '$(word 1,$(user_goal))' target may not be specified with any other targets)
endif
# Target is secure in user builds. # Target is secure in user builds.
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
override_build_tags := user override_build_tags := user
ifeq ($(user_goal),userdebug) ifeq ($(user_variant),userdebug)
# Pick up some extra useful tools # Pick up some extra useful tools
override_build_tags += debug override_build_tags += debug
else else
@@ -130,12 +134,12 @@ ifneq (,$(user_goal))
ifeq ($(HOST_OS)-$(WITH_DEXPREOPT_buildbot),linux-true) ifeq ($(HOST_OS)-$(WITH_DEXPREOPT_buildbot),linux-true)
WITH_DEXPREOPT := true WITH_DEXPREOPT := true
endif endif
else # !user_goal else # !user_variant
# Turn on checkjni for non-user builds. # Turn on checkjni for non-user builds.
ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1 ADDITIONAL_BUILD_PROPERTIES += ro.kernel.android.checkjni=1
# Set device insecure for non-user builds. # Set device insecure for non-user builds.
ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0 ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
endif # !user_goal endif # !user_variant
ifeq (true,$(strip $(enable_target_debugging))) ifeq (true,$(strip $(enable_target_debugging)))
# Target is more debuggable and adbd is on by default # Target is more debuggable and adbd is on by default
@@ -149,10 +153,7 @@ endif # !enable_target_debugging
## tests ## ## tests ##
ifneq ($(filter tests,$(MAKECMDGOALS)),) ifeq ($(TARGET_BUILD_VARIANT),tests)
ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1)
$(error The 'tests' target may not be specified with any other targets)
endif
override_build_tags := eng debug user development tests override_build_tags := eng debug user development tests
endif endif
@@ -203,8 +204,8 @@ $(if $(filter samples,$(1)),,$(filter eng debug user development,$(1)))
endef endef
endif endif
ifneq (,$(filter user,$(MAKECMDGOALS))) ifeq ($(TARGET_BUILD_VARIANT),)
# For the user goal, everything should be installed in /system. # For the default goal, everything should be installed in /system.
define should-install-to-system define should-install-to-system
true true
endef endef
@@ -215,7 +216,7 @@ endif
# the default target. # the default target.
ifeq ($(MAKECMDGOALS),showcommands) ifeq ($(MAKECMDGOALS),showcommands)
.PHONY: showcommands .PHONY: showcommands
showcommands: $(DEFAULT_TARGET) showcommands: $(DEFAULT_GOAL)
endif endif
# These targets are going to delete stuff, don't bother including # These targets are going to delete stuff, don't bother including
@@ -248,6 +249,7 @@ endif
ifeq ($(SDK_ONLY),true) ifeq ($(SDK_ONLY),true)
subdirs := \ subdirs := \
prebuilt \
build/libs/host \ build/libs/host \
dalvik/dexdump \ dalvik/dexdump \
dalvik/libdex \ dalvik/libdex \
@@ -255,6 +257,7 @@ subdirs := \
development/emulator/mksdcard \ development/emulator/mksdcard \
development/tools/activitycreator \ development/tools/activitycreator \
development/tools/line_endings \ development/tools/line_endings \
development/host \
external/expat \ external/expat \
external/libpng \ external/libpng \
external/qemu \ external/qemu \
@@ -285,8 +288,10 @@ subdirs += \
development/tools/layoutlib_utils \ development/tools/layoutlib_utils \
development/tools/ninepatch \ development/tools/ninepatch \
development/tools/sdkstats \ development/tools/sdkstats \
development/tools/sdkmanager \
frameworks/base \ frameworks/base \
frameworks/base/tools/layoutlib \ frameworks/base/tools/layoutlib \
external/googleclient \
packages packages
else else
$(warning sdk-only: javac not available.) $(warning sdk-only: javac not available.)
@@ -323,8 +328,12 @@ else # !BUILD_TINY_ANDROID
# #
# Typical build; include any Android.mk files we can find. # Typical build; include any Android.mk files we can find.
# #
INTERNAL_DEFAULT_DOCS_TARGETS := framework-docs INTERNAL_DEFAULT_DOCS_TARGETS := offline-sdk-docs
subdirs := $(TOP) subdirs := $(TOP)
# Only include Android.mk files directly under vendor/*, not
# *all* Android.mk files under vendor (which is what would happen
# if we didn't prune vendor in the findleaves call).
subdir_makefiles += $(wildcard vendor/*/Android.mk)
FULL_BUILD := true FULL_BUILD := true
@@ -338,38 +347,40 @@ subdir_makefiles += \
$(shell build/tools/findleaves.sh \ $(shell build/tools/findleaves.sh \
--prune="./vendor" --prune="./out" $(subdirs) Android.mk) --prune="./vendor" --prune="./out" $(subdirs) Android.mk)
# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_PRODUCT) # Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
# or under vendor/*/$(TARGET_PRODUCT). Search in both places, but # or under vendor/*/$(TARGET_DEVICE). Search in both places, but
# make sure only one exists. # make sure only one exists.
# Real boards should always be associated with an OEM vendor. # Real boards should always be associated with an OEM vendor.
board_config_mk := \ board_config_mk := \
$(strip $(wildcard \ $(strip $(wildcard \
$(SRC_TARGET_DIR)/board/$(TARGET_PRODUCT)/BoardConfig.mk \ $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
vendor/*/$(TARGET_PRODUCT)/BoardConfig.mk \ vendor/*/$(TARGET_DEVICE)/BoardConfig.mk \
)) ))
ifeq ($(board_config_mk),) ifeq ($(board_config_mk),)
$(error No config file found for TARGET_PRODUCT $(TARGET_PRODUCT)) $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
endif endif
ifneq ($(words $(board_config_mk)),1) ifneq ($(words $(board_config_mk)),1)
$(error Multiple board config files for TARGET_PRODUCT $(TARGET_PRODUCT): $(board_config_mk)) $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
endif endif
include $(board_config_mk) include $(board_config_mk)
TARGET_PRODUCT_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
board_config_mk := board_config_mk :=
ifdef CUSTOM_PKG ifdef CUSTOM_PKG
$(info ***************************************************************) $(info ***************************************************************)
$(info ***************************************************************) $(info ***************************************************************)
$(error CUSTOM_PKG is obsolete; use CUSTOM_MODULES) $(info CUSTOM_PKG is obsolete; use CUSTOM_MODULES)
$(info ***************************************************************) $(info ***************************************************************)
$(info ***************************************************************) $(info ***************************************************************)
$(error stopping)
endif endif
ifdef CUSTOM_TARGETS ifdef CUSTOM_TARGETS
$(info ***************************************************************) $(info ***************************************************************)
$(info ***************************************************************) $(info ***************************************************************)
$(error CUSTOM_TARGETS is obsolete; use CUSTOM_MODULES) $(info CUSTOM_TARGETS is obsolete; use CUSTOM_MODULES)
$(info ***************************************************************) $(info ***************************************************************)
$(info ***************************************************************) $(info ***************************************************************)
$(error stopping)
endif endif
# #
@@ -399,6 +410,17 @@ endif
# All module makefiles have been included at this point. # All module makefiles have been included at this point.
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# -------------------------------------------------------------------
# Include any makefiles that must happen after the module makefiles
# have been included.
# TODO: have these files register themselves via a global var rather
# than hard-coding the list here.
ifdef FULL_BUILD
# Only include this during a full build, otherwise we can't be
# guaranteed that any policies were included.
-include frameworks/policies/base/PolicyConfig.mk
endif
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Fix up CUSTOM_MODULES to refer to installed files rather than # Fix up CUSTOM_MODULES to refer to installed files rather than
# just bare module names. Leave unknown modules alone in case # just bare module names. Leave unknown modules alone in case
@@ -451,7 +473,7 @@ ifdef FULL_BUILD
user_PACKAGES := $(call module-installed-files, \ user_PACKAGES := $(call module-installed-files, \
$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)) $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES))
ifeq (0,1) ifeq (0,1)
$(info user packages for $(TARGET_PRODUCT) ($(INTERNAL_PRODUCT)):) $(info user packages for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
$(foreach p,$(user_PACKAGES),$(info : $(p))) $(foreach p,$(user_PACKAGES),$(info : $(p)))
$(error done) $(error done)
endif endif
@@ -535,7 +557,7 @@ endif # dont_bother
# but they're considered undocumented, so don't complain if their # but they're considered undocumented, so don't complain if their
# behavior changes. # behavior changes.
.PHONY: prebuilt .PHONY: prebuilt
prebuilt: $(ALL_PREBUILT) report_config prebuilt: $(ALL_PREBUILT)
# An internal target that depends on all copied headers # An internal target that depends on all copied headers
# (see copy_headers.make). Other targets that need the # (see copy_headers.make). Other targets that need the
@@ -547,18 +569,24 @@ $(ALL_C_CPP_ETC_OBJECTS): | all_copied_headers
# All the droid stuff, in directories # All the droid stuff, in directories
.PHONY: files .PHONY: files
files: report_config prebuilt $(modules_to_build) $(INSTALLED_ANDROID_INFO_TXT_TARGET) files: prebuilt $(modules_to_build) $(INSTALLED_ANDROID_INFO_TXT_TARGET)
# ------------------------------------------------------------------- # -------------------------------------------------------------------
.PHONY: ramdisk .PHONY: ramdisk
ramdisk: $(INSTALLED_RAMDISK_TARGET) report_config ramdisk: $(INSTALLED_RAMDISK_TARGET)
.PHONY: systemtarball
systemtarball: $(INSTALLED_SYSTEMTARBALL_TARGET)
.PHONY: userdataimage .PHONY: userdataimage
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET) report_config userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
.PHONY: userdatatarball
userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)
.PHONY: bootimage .PHONY: bootimage
bootimage: $(INSTALLED_BOOTIMAGE_TARGET) report_config bootimage: $(INSTALLED_BOOTIMAGE_TARGET)
ifeq ($(BUILD_TINY_ANDROID), true) ifeq ($(BUILD_TINY_ANDROID), true)
INSTALLED_RECOVERYIMAGE_TARGET := INSTALLED_RECOVERYIMAGE_TARGET :=
@@ -566,7 +594,7 @@ endif
# Build files and then package it into the rom formats # Build files and then package it into the rom formats
.PHONY: droidcore .PHONY: droidcore
droidcore: report_config files \ droidcore: files \
systemimage \ systemimage \
$(INSTALLED_BOOTIMAGE_TARGET) \ $(INSTALLED_BOOTIMAGE_TARGET) \
$(INSTALLED_RECOVERYIMAGE_TARGET) \ $(INSTALLED_RECOVERYIMAGE_TARGET) \
@@ -574,46 +602,45 @@ droidcore: report_config files \
$(INTERNAL_DEFAULT_DOCS_TARGETS) $(INTERNAL_DEFAULT_DOCS_TARGETS)
# The actual files built by the droidcore target changes depending # The actual files built by the droidcore target changes depending
# on MAKECMDGOALS. THIS IS A TOTAL HACK AND SHOULD NOT BE USED AS AN EXAMPLE # on the build variant.
.PHONY: droid user userdebug tests .PHONY: droid tests
droid user userdebug tests: droidcore droid tests: droidcore
#TODO: restore support for building OTA packages #TODO: restore support for building OTA packages
# $(INTERNAL_OTA_PACKAGE_TARGET) \ # $(INTERNAL_OTA_PACKAGE_TARGET) \
$(call dist-for-goals,user userdebug droid, \ $(call dist-for-goals, droid, \
$(INTERNAL_UPDATE_PACKAGE_TARGET) \ $(INTERNAL_UPDATE_PACKAGE_TARGET) \
$(SYMBOLS_ZIP) \ $(SYMBOLS_ZIP) \
$(APPS_ZIP) \ $(APPS_ZIP) \
$(HOST_OUT_EXECUTABLES)/adb$(HOST_EXECUTABLE_SUFFIX) \
$(INTERNAL_EMULATOR_PACKAGE_TARGET) \ $(INTERNAL_EMULATOR_PACKAGE_TARGET) \
$(PACKAGE_STATS_FILE) \ $(PACKAGE_STATS_FILE) \
$(INSTALLED_FILES_FILE) \ $(INSTALLED_FILES_FILE) \
$(INSTALLED_BUILD_PROP_TARGET) \ $(INSTALLED_BUILD_PROP_TARGET) \
$(BUILT_TARGET_FILES_PACKAGE) \ $(BUILT_TARGET_FILES_PACKAGE) \
) )
# Tests are installed in userdata.img; copy it for "make tests dist".
# Also copy a zip of the contents of userdata.img, so that people can # Tests are installed in userdata.img. If we're building the tests
# easily extract a single .apk. # variant, copy it for "make tests dist". Also copy a zip of the
$(call dist-for-goals,tests, \ # contents of userdata.img, so that people can easily extract a
# single .apk.
ifeq ($(TARGET_BUILD_VARIANT),tests)
$(call dist-for-goals, droid, \
$(INSTALLED_USERDATAIMAGE_TARGET) \ $(INSTALLED_USERDATAIMAGE_TARGET) \
$(BUILT_TESTS_ZIP_PACKAGE) \ $(BUILT_TESTS_ZIP_PACKAGE) \
) )
endif
.PHONY: docs .PHONY: docs
docs: $(ALL_DOCS) docs: $(ALL_DOCS)
.PHONY: sdk .PHONY: sdk
ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET) ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
sdk: report_config $(ALL_SDK_TARGETS) sdk: $(ALL_SDK_TARGETS)
$(call dist-for-goals,sdk,$(ALL_SDK_TARGETS)) $(call dist-for-goals,sdk,$(ALL_SDK_TARGETS))
.PHONY: findbugs .PHONY: findbugs
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET) findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
# Also do the targets not built by "make droid".
.PHONY: all
all: droid $(nonDroid_MODULES) docs sdk
.PHONY: clean .PHONY: clean
dirs_to_clean := \ dirs_to_clean := \
$(PRODUCT_OUT) \ $(PRODUCT_OUT) \
@@ -678,4 +705,3 @@ modules:
showcommands: showcommands:
@echo >/dev/null @echo >/dev/null

View File

@@ -174,7 +174,11 @@ endif
$(LOCAL_BUILT_MODULE): $(R_file_stamp) $(LOCAL_BUILT_MODULE): $(R_file_stamp)
ifneq ($(full_classes_jar),) ifneq ($(full_classes_jar),)
$(full_classes_jar): $(R_file_stamp) # If full_classes_jar is non-empty, we're building sources.
# If we're building sources, the initial javac step (which
# produces full_classes_compiled_jar) needs to ensure the
# R.java and Manifest.java files have been generated first.
$(full_classes_compiled_jar): $(R_file_stamp)
endif endif
endif # all_resources endif # all_resources

View File

@@ -27,9 +27,10 @@
# A mapping from shorthand names to include directories. # A mapping from shorthand names to include directories.
# #
pathmap_INCL := \ pathmap_INCL := \
bluedroid:system/bluetooth/bluedroid/include \
bluez-libs:external/bluez/libs/include \ bluez-libs:external/bluez/libs/include \
bluez-utils:external/bluez/utils \ bluez-utils:external/bluez/utils \
bootloader:bootloader/legacy/include \ bootloader:bootable/bootloader/legacy/include \
corecg:external/skia/include/corecg \ corecg:external/skia/include/corecg \
dbus:external/dbus \ dbus:external/dbus \
frameworks-base:frameworks/base/include \ frameworks-base:frameworks/base/include \
@@ -46,7 +47,7 @@ pathmap_INCL := \
libstdc++:bionic/libstdc++/include \ libstdc++:bionic/libstdc++/include \
libthread_db:bionic/libthread_db/include \ libthread_db:bionic/libthread_db/include \
mkbootimg:system/core/mkbootimg \ mkbootimg:system/core/mkbootimg \
recovery:recovery \ recovery:bootable/recovery \
system-core:system/core/include system-core:system/core/include
# #
@@ -66,16 +67,28 @@ endef
# #
JNI_H_INCLUDE := $(call include-path-for,libnativehelper)/nativehelper JNI_H_INCLUDE := $(call include-path-for,libnativehelper)/nativehelper
#
# A list of all source roots under frameworks/base, which will be
# built into the android.jar.
#
FRAMEWORKS_BASE_SUBDIRS := \ FRAMEWORKS_BASE_SUBDIRS := \
core \ $(addsuffix /java, \
graphics \ core \
location \ graphics \
media \ im \
opengl \ location \
sax \ media \
services \ opengl \
telephony \ sax \
wifi telephony \
wifi \
)
#
# A version of FRAMEWORKS_BASE_SUBDIRS that is expanded to full paths from
# the root of the tree. This currently needs to be here so that other libraries
# and apps can find the .aidl files in the framework, though we should really
# figure out a better way to do this.
#
FRAMEWORKS_BASE_JAVA_SRC_DIRS := \ FRAMEWORKS_BASE_JAVA_SRC_DIRS := \
$(patsubst %,frameworks/base/%/java,$(FRAMEWORKS_BASE_SUBDIRS)) $(addprefix frameworks/base/,$(FRAMEWORKS_BASE_SUBDIRS))

View File

@@ -22,10 +22,16 @@ libevent.so 0xAF800000
libssl.so 0xAF700000 libssl.so 0xAF700000
libcrypto.so 0xAF500000 libcrypto.so 0xAF500000
# extended system libraries # bluetooth
libbluedroid.so 0xAED00000 liba2dp.so 0xAEE00000
libbluetooth.so 0xAEC00000 audio.so 0xAED00000
input.so 0xAEC00000
libhcid.so 0xAEB00000
libbluedroid.so 0xAEA00000
libbluetooth.so 0xAE900000
libdbus.so 0xAE800000 libdbus.so 0xAE800000
# extended system libraries
libril.so 0xAE400000 libril.so 0xAE400000
libreference-ril.so 0xAE000000 libreference-ril.so 0xAE000000
libwpa_client.so 0xADC00000 libwpa_client.so 0xADC00000
@@ -52,6 +58,7 @@ libui.so 0xAC400000
libsgl.so 0xAC000000 libsgl.so 0xAC000000
# audio # audio
libspeech.so 0xAB800000
libaudio.so 0xAB700000 libaudio.so 0xAB700000
libsonivox.so 0xAB600000 libsonivox.so 0xAB600000
libsoundpool.so 0xAB500000 libsoundpool.so 0xAB500000
@@ -64,7 +71,7 @@ libaudioflinger.so 0xAB000000
# assorted system libraries # assorted system libraries
libsqlite.so 0xAAC00000 libsqlite.so 0xAAC00000
libexpat.so 0xAA800000 libexpat.so 0xAAB00000
libwebcore.so 0xAA000000 libwebcore.so 0xAA000000
libutils.so 0xA9D00000 libutils.so 0xA9D00000
libcameraservice.so 0xA9C80000 libcameraservice.so 0xA9C80000
@@ -111,5 +118,6 @@ libjni_lib_test.so 0x9AC00000
librunperf.so 0x9A800000 librunperf.so 0x9A800000
libctest.so 0x9A700000 libctest.so 0x9A700000
libUAPI_jni.so 0x9A500000 libUAPI_jni.so 0x9A500000
librpc.so 0x9A400000 librpc.so 0x9A400000
libtrace_test.so 0x9A300000 libtrace_test.so 0x9A300000
libsrec_jni.so 0x9A200000

View File

@@ -65,7 +65,8 @@ _product_var_list := \
PRODUCT_BRAND \ PRODUCT_BRAND \
PRODUCT_PROPERTY_OVERRIDES \ PRODUCT_PROPERTY_OVERRIDES \
PRODUCT_COPY_FILES \ PRODUCT_COPY_FILES \
PRODUCT_OTA_PUBLIC_KEYS PRODUCT_OTA_PUBLIC_KEYS \
PRODUCT_POLICY
define dump-product define dump-product
$(info ==== $(1) ====)\ $(info ==== $(1) ====)\

View File

@@ -50,15 +50,6 @@ $(strip \
endef endef
# ---------------------------------------------------------------
# if TARGET_PRODUCT isn't set, fall back to the hardware- and
# vendor-agnostic "generic" product.
#
ifeq ($(strip $(TARGET_PRODUCT)),)
TARGET_PRODUCT := generic
endif
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build # Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
# a particular configuration without needing to set up the environment. # a particular configuration without needing to set up the environment.
@@ -77,19 +68,32 @@ ifdef product_goals
ifneq ($(words $(product_goals)),2) ifneq ($(words $(product_goals)),2)
$(error Bad PRODUCT-* goal "$(goal_name)") $(error Bad PRODUCT-* goal "$(goal_name)")
endif endif
product_name := $(word 1,$(product_goals))
product_build := $(word 2,$(product_goals)) # The product they want
ifeq ($(product_build),eng) TARGET_PRODUCT := $(word 1,$(product_goals))
product_build := droid
# The variant they want
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
# HACK HACK HACK
# The build server wants to do make PRODUCT-dream-installclean
# which really means TARGET_PRODUCT=dream make installclean.
ifneq ($(filter-out eng user userdebug tests,$(TARGET_BUILD_VARIANT)),)
MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
TARGET_BUILD_VARIANT := eng
default_goal_substitution :=
else
default_goal_substitution := $(DEFAULT_GOAL)
endif endif
# HACK HACK HACK
# Hack to make the linux build servers use dexpreopt. # Hack to make the linux build servers use dexpreopt.
# OSX is still a little flaky. Most engineers don't use this # OSX is still a little flaky. Most engineers don't use this
# type of target ("make PRODUCT-blah-user"), so this should # type of target ("make PRODUCT-blah-user"), so this should
# only tend to happen when using buildbot. # only tend to happen when using buildbot.
# TODO: remove this and fix the matching lines in //device/Makefile # TODO: remove this and fix the matching lines in build/core/main.mk
# once dexpreopt works better on OSX. # once dexpreopt works better on OSX.
ifeq ($(product_build),user) ifeq ($(TARGET_BUILD_VARIANT),user)
WITH_DEXPREOPT_buildbot := true WITH_DEXPREOPT_buildbot := true
endif endif
@@ -99,12 +103,9 @@ ifdef product_goals
# #
# Note that modifying this will not affect the goals that make will # Note that modifying this will not affect the goals that make will
# attempt to build, but it's important because we inspect this value # attempt to build, but it's important because we inspect this value
# in certain situations (like for "make user"). # in certain situations (like for "make sdk").
# #
MAKECMDGOALS := $(patsubst $(goal_name),$(product_build),$(MAKECMDGOALS)) MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
# Keep track of the requested product.
REQUESTED_PRODUCT := $(product_name)
# Define a rule for the PRODUCT-* goal, and make it depend on the # Define a rule for the PRODUCT-* goal, and make it depend on the
# patched-up command-line goals as well as any other goals that we # patched-up command-line goals as well as any other goals that we
@@ -112,29 +113,8 @@ ifdef product_goals
# #
.PHONY: $(goal_name) .PHONY: $(goal_name)
$(goal_name): $(MAKECMDGOALS) $(goal_name): $(MAKECMDGOALS)
else
# Use the value set in the environment or buildspec.mk.
#
REQUESTED_PRODUCT := $(TARGET_PRODUCT)
endif endif
# else: Use the value set in the environment or buildspec.mk.
# ---------------------------------------------------------------
# Make the SDK build against generic by default.
ifneq (,$(filter sdk,$(MAKECMDGOALS)))
ifeq (,$(strip $(REQUESTED_PRODUCT)))
REQUESTED_PRODUCT := generic
endif
endif
# ---------------------------------------------------------------
# Make the PDK build against generic by default.
ifneq (,$(filter pdk,$(MAKECMDGOALS)))
ifeq (,$(strip $(REQUESTED_PRODUCT)))
REQUESTED_PRODUCT := generic
endif
endif
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Include the product definitions. # Include the product definitions.
@@ -158,17 +138,11 @@ $(check-all-products)
# Convert a short name like "sooner" into the path to the product # Convert a short name like "sooner" into the path to the product
# file defining that product. # file defining that product.
# #
INTERNAL_PRODUCT := $(call resolve-short-product-name, $(REQUESTED_PRODUCT)) INTERNAL_PRODUCT := $(call resolve-short-product-name, $(TARGET_PRODUCT))
#$(error REQUESTED_PRODUCT $(REQUESTED_PRODUCT) --> $(INTERNAL_PRODUCT)) #$(error TARGET_PRODUCT $(TARGET_PRODUCT) --> $(INTERNAL_PRODUCT))
# Convert from the real product (which represents everything about a # Find the device that this product maps to.
# build) to the old product (which represents a board/device/sku). TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)
#
# Use "override" in case make was invoked like "make TARGET_PRODUCT=xyz"
# TODO: get rid of the old meaning of "product" in favor of
# device/board.
#
override TARGET_PRODUCT := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)
# Figure out which resoure configuration options to use for this # Figure out which resoure configuration options to use for this
# product. # product.
@@ -196,6 +170,9 @@ ifndef PRODUCT_MANUFACTURER
PRODUCT_MANUFACTURER := unknown PRODUCT_MANUFACTURER := unknown
endif endif
# Which policy should this product use
PRODUCT_POLICY := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_POLICY))
# A list of words like <source path>:<destination path>. The file at # A list of words like <source path>:<destination path>. The file at
# the source path should be copied to the destination path when building # the source path should be copied to the destination path when building
# this product. <destination path> is relative to $(PRODUCT_OUT), so # this product. <destination path> is relative to $(PRODUCT_OUT), so
@@ -226,7 +203,9 @@ OTA_PUBLIC_KEYS := \
# TODO: Let a product opt out of needing OTA keys, and stop defaulting to # TODO: Let a product opt out of needing OTA keys, and stop defaulting to
# the test key as soon as possible. # the test key as soon as possible.
ifeq (,$(strip $(OTA_PUBLIC_KEYS))) ifeq (,$(strip $(OTA_PUBLIC_KEYS)))
$(warning WARNING: adding test OTA key) ifeq (,$(CALLED_FROM_SETUP))
$(warning WARNING: adding test OTA key)
endif
OTA_PUBLIC_KEYS := $(SRC_TARGET_DIR)/product/security/testkey.x509.pem OTA_PUBLIC_KEYS := $(SRC_TARGET_DIR)/product/security/testkey.x509.pem
endif endif

View File

@@ -16,7 +16,8 @@ $(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries)
@$(mkdir -p $(dir $@) @$(mkdir -p $(dir $@)
@echo "target Linking: $(PRIVATE_MODULE)" @echo "target Linking: $(PRIVATE_MODULE)"
$(hide) $(TARGET_LD) \ $(hide) $(TARGET_LD) \
--script $(PRIVATE_LINK_SCRIPT) \ $(addprefix --script ,$(PRIVATE_LINK_SCRIPT)) \
$(PRIVATE_RAW_EXECUTABLE_LDFLAGS) \
-o $(PRIVATE_ELF_FILE) \ -o $(PRIVATE_ELF_FILE) \
$(PRIVATE_ALL_OBJECTS) \ $(PRIVATE_ALL_OBJECTS) \
--start-group $(PRIVATE_ALL_STATIC_LIBRARIES) --end-group \ --start-group $(PRIVATE_ALL_STATIC_LIBRARIES) --end-group \

View File

@@ -26,5 +26,7 @@ OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
include $(BUILD_SYSTEM)/dynamic_binary.mk include $(BUILD_SYSTEM)/dynamic_binary.mk
$(linked_module): $(all_objects) $(all_libraries) $(LOCAL_ADDITIONAL_DEPENDENCIES) $(linked_module): $(all_objects) $(all_libraries) \
$(LOCAL_ADDITIONAL_DEPENDENCIES) \
$(TARGET_CRTBEGIN_SO_O) $(TARGET_CRTEND_SO_O)
$(transform-o-to-shared-lib) $(transform-o-to-shared-lib)

View File

@@ -47,9 +47,9 @@ droidcore: checkapi
# SDK version. # SDK version.
$(eval $(call check-api, \ $(eval $(call check-api, \
checkapi-last, \ checkapi-last, \
$(BUILD_SYSTEM)/api/$(lastword $(TARGET_AVAILABLE_SDK_VERSIONS)).xml, \ $(SRC_API_DIR)/$(lastword $(TARGET_AVAILABLE_SDK_VERSIONS)).xml, \
$(INTERNAL_PLATFORM_API_FILE), \ $(INTERNAL_PLATFORM_API_FILE), \
-hide 2 -hide 3 -hide 4 -hide 5 -hide 6 \ -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 \
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
-error 16 -error 17 -error 18 , \ -error 16 -error 17 -error 18 , \
cat $(BUILD_SYSTEM)/apicheck_msg_last.txt \ cat $(BUILD_SYSTEM)/apicheck_msg_last.txt \
@@ -59,17 +59,17 @@ $(eval $(call check-api, \
# SDK version. # SDK version.
$(eval $(call check-api, \ $(eval $(call check-api, \
checkapi-current, \ checkapi-current, \
$(BUILD_SYSTEM)/api/current.xml, \ $(SRC_API_DIR)/current.xml, \
$(INTERNAL_PLATFORM_API_FILE), \ $(INTERNAL_PLATFORM_API_FILE), \
-error 2 -error 3 -error 4 -error 5 -error 6 \ -error 2 -error 3 -error 4 -error 5 -error 6 \
-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \ -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
-error 16 -error 17 -error 18 -error 19 -error 20 -error 21 , \ -error 16 -error 17 -error 18 -error 19 -error 20 -error 21 -error 23 -error 24 , \
cat $(BUILD_SYSTEM)/apicheck_msg_current.txt \ cat $(BUILD_SYSTEM)/apicheck_msg_current.txt \
)) ))
.PHONY: update-api .PHONY: update-api
update-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP) update-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP)
@echo Copying current.xml @echo Copying current.xml
$(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) $(BUILD_SYSTEM)/api/current.xml $(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) $(SRC_API_DIR)/current.xml
endif endif

96
core/tasks/cts.mk Normal file
View File

@@ -0,0 +1,96 @@
# 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.
cts_dir := $(HOST_OUT)/cts
cts_tools_src_dir := cts/tools
# Build a name that looks like:
#
# linux-x86 --> android-cts_12345_linux-x86
# darwin-x86 --> android-cts_12345_mac-x86
# windows-x86 --> android-cts_12345_windows
#
cts_name := android-cts_$(FILE_NAME_TAG)
ifeq ($(HOST_OS),darwin)
cts_host_os := mac
else
cts_host_os := $(HOST_OS)
endif
ifneq ($(HOST_OS),windows)
cts_host_os := $(cts_host_os)-$(HOST_ARCH)
endif
cts_name := $(cts_name)_$(cts_host_os)
CTS_EXECUTABLE := cts
ifeq ($(HOST_OS),windows)
CTS_EXECUTABLE_PATH := $(cts_tools_src_dir)/host/etc/cts.bat
else
CTS_EXECUTABLE_PATH := $(HOST_OUT_EXECUTABLES)/$(CTS_EXECUTABLE)
endif
CTS_HOST_JAR := $(HOST_OUT_JAVA_LIBRARIES)/cts.jar
CTS_CASE_LIST := \
DeviceInfoCollector \
CtsTestStubs \
CtsTextTestCases \
CtsViewTestCases \
CtsGraphicsTestCases \
SignatureTest
DEFAULT_TEST_PLAN := $(PRIVATE_DIR)/resource/plans
$(cts_dir)/all_cts_files_stamp: $(CTS_CASE_LIST) | $(ACP)
# Make necessary directory for CTS
@rm -rf $(PRIVATE_CTS_DIR)
@mkdir -p $(TMP_DIR)
@mkdir -p $(PRIVATE_DIR)/docs
@mkdir -p $(PRIVATE_DIR)/tools
@mkdir -p $(PRIVATE_DIR)/repository/testcases
@mkdir -p $(PRIVATE_DIR)/repository/plans
# Copy executable to CTS directory
$(hide) $(ACP) -fp $(CTS_HOST_JAR) $(PRIVATE_DIR)/tools
$(hide) $(ACP) -fp $(CTS_EXECUTABLE_PATH) $(PRIVATE_DIR)/tools
# Change mode of the executables
$(hide) chmod ug+rwX $(PRIVATE_DIR)/tools/$(notdir $(CTS_EXECUTABLE_PATH))
$(foreach apk,$(CTS_CASE_LIST), \
$(call copy-testcase-apk,$(apk)))
# Copy CTS host config to CTS directory
$(hide) $(ACP) -fp $(cts_tools_src_dir)/utils/host_config.xml $(PRIVATE_DIR)/repository/
$(hide) touch $@
# Generate the default test plan for User.
$(DEFAULT_TEST_PLAN): $(cts_dir)/all_cts_files_stamp $(cts_tools_src_dir)/utils/genDefaultTestPlan.sh
$(hide) bash $(cts_tools_src_dir)/utils/genDefaultTestPlan.sh cts/tests/tests/ \
$(PRIVATE_DIR) $(TMP_DIR) $(TOP) $(TARGET_COMMON_OUT_ROOT) $(OUT_DIR)
# Package CTS and clean up.
INTERNAL_CTS_TARGET := $(cts_dir)/$(cts_name).zip
$(INTERNAL_CTS_TARGET): PRIVATE_NAME := $(cts_name)
$(INTERNAL_CTS_TARGET): PRIVATE_CTS_DIR := $(cts_dir)
$(INTERNAL_CTS_TARGET): PRIVATE_DIR := $(cts_dir)/$(cts_name)
$(INTERNAL_CTS_TARGET): TMP_DIR := $(cts_dir)/temp
$(INTERNAL_CTS_TARGET): $(cts_dir)/all_cts_files_stamp $(DEFAULT_TEST_PLAN)
@echo "Package CTS: $@"
$(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)
.PHONY: cts
cts: $(INTERNAL_CTS_TARGET) adb
$(call dist-for-goals,cts,$(INTERNAL_CTS_TARGET))
define copy-testcase-apk
$(hide) $(ACP) -fp $(call intermediates-dir-for,APPS,$(1))/package.apk \
$(PRIVATE_DIR)/repository/testcases/$(1).apk
endef

View File

@@ -43,5 +43,5 @@ xlb: $(xlb_target)
# We want this on the build-server builds, but no reason to inflict it on # We want this on the build-server builds, but no reason to inflict it on
# everyone # everyone
$(call dist-for-goals, user droid, $(xlb_target)) $(call dist-for-goals, droid, $(xlb_target))

View File

@@ -39,7 +39,7 @@ ifeq "" "$(PLATFORM_VERSION)"
# which is the version that we reveal to the end user. # which is the version that we reveal to the end user.
# Update this value when the platform version changes (rather # Update this value when the platform version changes (rather
# than overriding it somewhere else). Can be an arbitrary string. # than overriding it somewhere else). Can be an arbitrary string.
PLATFORM_VERSION := 1.0 PLATFORM_VERSION := 1.5
endif endif
ifeq "" "$(PLATFORM_SDK_VERSION)" ifeq "" "$(PLATFORM_SDK_VERSION)"
@@ -47,7 +47,7 @@ ifeq "" "$(PLATFORM_SDK_VERSION)"
# the set of APIs and functionality available in the platform. This is # the set of APIs and functionality available in the platform. This is
# a single integer, that increases monotonically as updates to the SDK # a single integer, that increases monotonically as updates to the SDK
# are released. # are released.
PLATFORM_SDK_VERSION := 1 PLATFORM_SDK_VERSION := 3
endif endif
ifeq "" "$(BUILD_ID)" ifeq "" "$(BUILD_ID)"

View File

@@ -1,6 +1,6 @@
function help() { function help() {
cat <<EOF cat <<EOF
Invoke ". envsetup.sh" from your shell to add the following functions to your environment: Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- croot: Changes directory to the top of the tree. - croot: Changes directory to the top of the tree.
- m: Makes from the top of the tree. - m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory. - mm: Builds all of the modules in the current directory.
@@ -28,8 +28,8 @@ function get_abs_build_var()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return return
fi fi
CALLED_FROM_SETUP=true \ CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
make --no-print-directory -C "$T" -f build/core/envsetup.mk dumpvar-abs-$1 make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1
} }
# Get the exact value of a build variable. # Get the exact value of a build variable.
@@ -40,8 +40,38 @@ function get_build_var()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return return
fi fi
CALLED_FROM_SETUP=true \ CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
make --no-print-directory -C "$T" -f build/core/envsetup.mk dumpvar-$1 make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-$1
}
# check to see if the supplied product is one we can build
function check_product()
{
T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
TARGET_PRODUCT=$1 TARGET_BUILD_VARIANT= \
TARGET_SIMULATOR= TARGET_BUILD_TYPE= \
get_build_var TARGET_DEVICE > /dev/null
# hide successful answers, but allow the errors to show
}
VARIANT_CHOICES=(user userdebug eng)
# check to see if the supplied variant is valid
function check_variant()
{
for v in ${VARIANT_CHOICES[@]}
do
if [ "$v" = "$1" ]
then
return 0
fi
done
return 1
} }
function setpaths() function setpaths()
@@ -63,7 +93,6 @@ function setpaths()
# # # #
################################################################## ##################################################################
# out with the old # out with the old
if [ -n $ANDROID_BUILD_PATHS ] ; then if [ -n $ANDROID_BUILD_PATHS ] ; then
export PATH=${PATH/$ANDROID_BUILD_PATHS/} export PATH=${PATH/$ANDROID_BUILD_PATHS/}
@@ -72,58 +101,58 @@ function setpaths()
# and in with the new # and in with the new
CODE_REVIEWS= CODE_REVIEWS=
prebuiltdir=$(getprebuilt) prebuiltdir=$(getprebuilt)
export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain-eabi-4.2.1/bin export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.2.1/bin
export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
export ANDROID_QTOOLS=$T/development/emulator/qtools export ANDROID_QTOOLS=$T/development/emulator/qtools
export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
export PATH=$PATH$ANDROID_BUILD_PATHS export PATH=$PATH$ANDROID_BUILD_PATHS
unset ANDROID_PRODUCT_OUT
export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT) export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT)
export OUT=$ANDROID_PRODUCT_OUT export OUT=$ANDROID_PRODUCT_OUT
# needed for building linux on MacOS # needed for building linux on MacOS
# TODO: fix the path # TODO: fix the path
#export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
# needed for OProfile to post-process collected samples
export OPROFILE_EVENTS_DIR=$prebuiltdir/oprofile
} }
function printconfig() function printconfig()
{ {
echo "==============================================" T=$(gettop)
echo "Build System Configuration" if [ ! "$T" ]; then
echo echo "Couldn't locate the top of the tree. Try setting TOP." >&2
echo " TARGET_SIMULATOR: " $TARGET_SIMULATOR return
echo " TARGET_BUILD_TYPE: " $TARGET_BUILD_TYPE fi
echo " TARGET_PRODUCT: " $TARGET_PRODUCT get_build_var report_config
echo "=============================================="
} }
function set_stuff_for_environment() function set_stuff_for_environment()
{ {
if [ "$TARGET_SIMULATOR" -a "$TARGET_PRODUCT" -a "$TARGET_BUILD_TYPE" ] settitle
then setpaths
settitle set_sequence_number
printconfig
setpaths
set_sequence_number
# Don't try to do preoptimization until it works better on OSX. # Don't try to do preoptimization until it works better on OSX.
export DISABLE_DEXPREOPT=true export DISABLE_DEXPREOPT=true
export ANDROID_BUILD_TOP=$(gettop) export ANDROID_BUILD_TOP=$(gettop)
fi
} }
function set_sequence_number() function set_sequence_number()
{ {
export BUILD_ENV_SEQUENCE_NUMBER=8 export BUILD_ENV_SEQUENCE_NUMBER=9
} }
function settitle() function settitle()
{ {
if [ "$STAY_OFF_MY_LAWN" = "" ]; then if [ "$STAY_OFF_MY_LAWN" = "" ]; then
TARGET_PRODUCT=$(get_build_var TARGET_PRODUCT) local product=$(get_build_var TARGET_PRODUCT)
export PROMPT_COMMAND='echo -ne "\033]0;[${TARGET_PRODUCT}] ${USER}@${HOSTNAME}: ${PWD}\007"' local variant=$(get_build_var TARGET_BUILD_VARIANT)
fi export PROMPT_COMMAND="echo -ne \"\033]0;[${product}-${variant}] ${USER}@${HOSTNAME}: ${PWD}\007\""
fi
} }
case `uname -s` in case `uname -s` in
@@ -135,11 +164,17 @@ case `uname -s` in
echo " 2. Simulator" echo " 2. Simulator"
echo echo
export TARGET_SIMULATOR=$1 export TARGET_SIMULATOR=
local ANSWER
while [ -z $TARGET_SIMULATOR ] while [ -z $TARGET_SIMULATOR ]
do do
echo -n "Which would you like? [1] " echo -n "Which would you like? [1] "
read ANSWER if [ -z "$1" ] ; then
read ANSWER
else
echo $1
ANSWER=$1
fi
case $ANSWER in case $ANSWER in
"") "")
export TARGET_SIMULATOR=false export TARGET_SIMULATOR=false
@@ -147,16 +182,24 @@ case `uname -s` in
1) 1)
export TARGET_SIMULATOR=false export TARGET_SIMULATOR=false
;; ;;
Device)
export TARGET_SIMULATOR=false
;;
2) 2)
export TARGET_SIMULATOR=true export TARGET_SIMULATOR=true
;; ;;
Simulator)
export TARGET_SIMULATOR=true
;;
*) *)
echo echo
echo "I didn't understand your response. Please try again." echo "I didn't understand your response. Please try again."
echo echo
continue
;; ;;
esac esac
if [ -n "$1" ] ; then
break
fi
done done
set_stuff_for_environment set_stuff_for_environment
@@ -168,8 +211,11 @@ case `uname -s` in
echo "Only device builds are supported for" `uname -s` echo "Only device builds are supported for" `uname -s`
echo " Forcing TARGET_SIMULATOR=false" echo " Forcing TARGET_SIMULATOR=false"
echo echo
echo -n "Press enter: " if [ -z "$1" ]
read then
echo -n "Press enter: "
read
fi
export TARGET_SIMULATOR=false export TARGET_SIMULATOR=false
set_stuff_for_environment set_stuff_for_environment
@@ -184,6 +230,7 @@ function choosetype()
echo " 2. debug" echo " 2. debug"
echo echo
local DEFAULT_NUM DEFAULT_VALUE
if [ $TARGET_SIMULATOR = "false" ] ; then if [ $TARGET_SIMULATOR = "false" ] ; then
DEFAULT_NUM=1 DEFAULT_NUM=1
DEFAULT_VALUE=release DEFAULT_VALUE=release
@@ -192,11 +239,17 @@ function choosetype()
DEFAULT_VALUE=debug DEFAULT_VALUE=debug
fi fi
export TARGET_BUILD_TYPE=$1 export TARGET_BUILD_TYPE=
local ANSWER
while [ -z $TARGET_BUILD_TYPE ] while [ -z $TARGET_BUILD_TYPE ]
do do
echo -n "Which would you like? ["$DEFAULT_NUM"] " echo -n "Which would you like? ["$DEFAULT_NUM"] "
read ANSWER if [ -z "$1" ] ; then
read ANSWER
else
echo $1
ANSWER=$1
fi
case $ANSWER in case $ANSWER in
"") "")
export TARGET_BUILD_TYPE=$DEFAULT_VALUE export TARGET_BUILD_TYPE=$DEFAULT_VALUE
@@ -204,39 +257,61 @@ function choosetype()
1) 1)
export TARGET_BUILD_TYPE=release export TARGET_BUILD_TYPE=release
;; ;;
release)
export TARGET_BUILD_TYPE=release
;;
2) 2)
export TARGET_BUILD_TYPE=debug export TARGET_BUILD_TYPE=debug
;; ;;
debug)
export TARGET_BUILD_TYPE=debug
;;
*) *)
echo echo
echo "I didn't understand your response. Please try again." echo "I didn't understand your response. Please try again."
echo echo
continue
;; ;;
esac esac
if [ -n "$1" ] ; then
break
fi
done done
set_stuff_for_environment set_stuff_for_environment
} }
#
# This function isn't really right: It chooses a TARGET_PRODUCT
# based on the list of boards. Usually, that gets you something
# that kinda works with a generic product, but really, you should
# pick a product by name.
#
function chooseproduct() function chooseproduct()
{ {
# Find the makefiles that must exist for a product. # Find the makefiles that must exist for a product.
# Send stderr to /dev/null in case partner isn't present. # Send stderr to /dev/null in case partner isn't present.
local -a choices
choices=(`/bin/ls build/target/board/*/BoardConfig.mk vendor/*/*/BoardConfig.mk 2> /dev/null`) choices=(`/bin/ls build/target/board/*/BoardConfig.mk vendor/*/*/BoardConfig.mk 2> /dev/null`)
count=${#choices[@]}
index=0
echo "Product choices are:"
while [ "$index" -lt "$count" ] local choice
local -a prodlist
for choice in ${choices[@]}
do do
# The product name is the name of the directory containing # The product name is the name of the directory containing
# the makefile we found, above. # the makefile we found, above.
choices[$index]=`dirname ${choices[$index]} | xargs basename` prodlist=(${prodlist[@]} `dirname ${choice} | xargs basename`)
echo " $index. ${choices[$index]}" done
local index=1
local p
echo "Product choices are:"
for p in ${prodlist[@]}
do
echo " $index. $p"
let "index = $index + 1" let "index = $index + 1"
done done
if [ "x$TARGET_PRODUCT" != x ] ; then if [ "x$TARGET_PRODUCT" != x ] ; then
default_value=$TARGET_PRODUCT default_value=$TARGET_PRODUCT
else else
@@ -247,21 +322,91 @@ function chooseproduct()
fi fi
fi fi
export TARGET_PRODUCT=$1 export TARGET_PRODUCT=
local ANSWER
while [ -z "$TARGET_PRODUCT" ] while [ -z "$TARGET_PRODUCT" ]
do do
echo -n "which would you like? [$default_value] " echo "You can also type the name of a product if you know it."
read ANSWER echo -n "Which would you like? [$default_value] "
if [ -z "$1" ] ; then
read ANSWER
else
echo $1
ANSWER=$1
fi
if [ -z "$ANSWER" ] ; then if [ -z "$ANSWER" ] ; then
export TARGET_PRODUCT=$default_value export TARGET_PRODUCT=$default_value
elif [ "$ANSWER" -lt "$count" ] ; then elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
export TARGET_PRODUCT=${choices[$ANSWER]} local poo=`echo -n $ANSWER`
if [ $poo -le ${#prodlist[@]} ] ; then
export TARGET_PRODUCT=${prodlist[$(($ANSWER-$_arrayoffset))]}
else
echo "** Bad product selection: $ANSWER"
fi
else
if check_product $ANSWER
then
export TARGET_PRODUCT=$ANSWER
else
echo "** Not a valid product: $ANSWER"
fi
fi
if [ -n "$1" ] ; then
break
fi fi
done done
set_stuff_for_environment set_stuff_for_environment
} }
function choosevariant()
{
echo "Variant choices are:"
local index=1
local v
for v in ${VARIANT_CHOICES[@]}
do
# The product name is the name of the directory containing
# the makefile we found, above.
echo " $index. $v"
index=$(($index+1))
done
local default_value=eng
local ANSWER
export TARGET_BUILD_VARIANT=
while [ -z "$TARGET_BUILD_VARIANT" ]
do
echo -n "Which would you like? [$default_value] "
if [ -z "$1" ] ; then
read ANSWER
else
echo $1
ANSWER=$1
fi
if [ -z "$ANSWER" ] ; then
export TARGET_BUILD_VARIANT=$default_value
elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
if [ "$ANSWER" -le "${#VARIANT_CHOICES[@]}" ] ; then
export TARGET_BUILD_VARIANT=${VARIANT_CHOICES[$(($ANSWER-$_arrayoffset))]}
fi
else
if check_variant $ANSWER
then
export TARGET_BUILD_VARIANT=$ANSWER
else
echo "** Not a valid variant: $ANSWER"
fi
fi
if [ -n "$1" ] ; then
break
fi
done
}
function tapas() function tapas()
{ {
choosecombo choosecombo
@@ -279,118 +424,146 @@ function choosecombo()
echo echo
chooseproduct $3 chooseproduct $3
echo
echo
choosevariant $4
echo echo
set_stuff_for_environment set_stuff_for_environment
printconfig
} }
# Clear this variable. It will be built up again when the vendorsetup.sh
# files are included at the end of this file.
unset LUNCH_MENU_CHOICES
function add_lunch_combo()
{
local new_combo=$1
local c
for c in ${LUNCH_MENU_CHOICES[@]} ; do
if [ "$new_combo" = "$c" ] ; then
return
fi
done
LUNCH_MENU_CHOICES=(${LUNCH_MENU_CHOICES[@]} $new_combo)
}
# add the default one here
add_lunch_combo generic-eng
# if we're on linux, add the simulator. There is a special case
# in lunch to deal with the simulator
if [ "$(uname)" = "Linux" ] ; then
add_lunch_combo simulator
fi
function print_lunch_menu() function print_lunch_menu()
{ {
local uname=$(uname) local uname=$(uname)
echo echo
echo "You're building on" $uname echo "You're building on" $uname
echo echo
echo ${LUNCH_MENU_CHOICES[@]}
echo "Lunch menu... pick a combo:" echo "Lunch menu... pick a combo:"
echo " 1. device release generic"
if [ $uname = Linux ] local i=1
then local choice
echo " 2. simulator debug sim" for choice in ${LUNCH_MENU_CHOICES[@]}
else do
echo " <no simulator on $uname>" echo " $i. $choice"
fi i=$(($i+1))
done
echo echo
} }
function lunch() function lunch()
{ {
local answer
if [ "$1" ] ; then if [ "$1" ] ; then
ANSWER=$1 answer=$1
else else
print_lunch_menu print_lunch_menu
echo -n "Which would you like? " echo -n "Which would you like? [generic-eng] "
read ANSWER read answer
fi fi
if [ $ANSWER -eq 2 -a $(uname) != Linux ] local selection=
if [ -z "$answer" ]
then then
echo "Simulator builds are not supported on this platform" selection=generic-eng
ANSWER=0 elif [ "$answer" = "simulator" ]
then
selection=simulator
elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$")
then
if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]
then
selection=${LUNCH_MENU_CHOICES[$(($answer-$_arrayoffset))]}
fi
elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$")
then
selection=$answer
fi fi
case $ANSWER in if [ -z "$selection" ]
1) then
export TARGET_SIMULATOR=false echo
export TARGET_BUILD_TYPE=release echo "Invalid lunch combo: $answer"
export TARGET_PRODUCT=generic return 1
;; fi
2)
# special case the simulator
if [ "$selection" = "simulator" ]
then
export TARGET_PRODUCT=sim
export TARGET_BUILD_VARIANT=eng
export TARGET_SIMULATOR=true export TARGET_SIMULATOR=true
export TARGET_BUILD_TYPE=debug export TARGET_BUILD_TYPE=debug
export TARGET_PRODUCT=sim else
;; local product=$(echo -n $selection | sed -e "s/-.*$//")
*) check_product $product
echo if [ $? -ne 0 ]
if [ "$1" ] ; then then
echo "I didn't understand your request. Please try again" echo
print_lunch_menu echo "** Don't have a product spec for: '$product'"
else echo "** Do you have the right repo manifest?"
echo "I didn't understand your response. Please try again." product=
fi fi
return
;; local variant=$(echo -n $selection | sed -e "s/^[^\-]*-//")
esac check_variant $variant
if [ $? -ne 0 ]
then
echo
echo "** Invalid variant: '$variant'"
echo "** Must be one of ${VARIANT_CHOICES[@]}"
variant=
fi
if [ -z "$product" -o -z "$variant" ]
then
echo
return 1
fi
export TARGET_PRODUCT=$product
export TARGET_BUILD_VARIANT=$variant
export TARGET_SIMULATOR=false
export TARGET_BUILD_TYPE=release
fi # !simulator
echo echo
set_stuff_for_environment set_stuff_for_environment
} printconfig
function partner_setup()
{
# Set up the various TARGET_ variables so that we can use
# the lunch helper functions to build the PATH.
#
if [ $# -lt 1 ] ; then
export TARGET_PRODUCT=generic
echo "Usage: partner_setup <product-name>" >&2
echo " Defaulting to product \"$TARGET_PRODUCT\"" >&2
else
export TARGET_PRODUCT=$1
fi
if [ $TARGET_PRODUCT = "sim" ] ; then
export TARGET_SIMULATOR=true
export TARGET_BUILD_TYPE=debug
else
export TARGET_SIMULATOR=false
export TARGET_BUILD_TYPE=release
fi
# setpaths will fix up the PATH to point to the tools, and will also
# set ANDROID_PRODUCT_OUT. set_sequence_number is necessary for
# certain consistency checks within the build system.
#
setpaths
set_sequence_number
# Clear the TARGET_ variables so that the build is based purely on
# buildspec.mk and the commandline, except for sim
#
if [ $TARGET_PRODUCT != sim ] ; then
export TARGET_PRODUCT=
export TARGET_SIMULATOR=
export TARGET_BUILD_TYPE=
fi
export ANDROID_BUILD_TOP=$(gettop)
# Don't try to do preoptimization until it works better on OSX.
export DISABLE_DEXPREOPT=true
echo " ANDROID_PRODUCT_OUT: $ANDROID_PRODUCT_OUT"
echo " ANDROID_BUILD_TOP: $ANDROID_BUILD_TOP"
} }
function gettop function gettop
{ {
TOPFILE=build/core/envsetup.mk local TOPFILE=build/core/envsetup.mk
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then
echo $TOP echo $TOP
else else
@@ -400,7 +573,7 @@ function gettop
# We redirect cd to /dev/null in case it's aliased to # We redirect cd to /dev/null in case it's aliased to
# a command that prints something as a side-effect # a command that prints something as a side-effect
# (like pushd) # (like pushd)
HERE=$PWD local HERE=$PWD
T= T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
cd .. > /dev/null cd .. > /dev/null
@@ -430,7 +603,7 @@ function findmakefile()
# We redirect cd to /dev/null in case it's aliased to # We redirect cd to /dev/null in case it's aliased to
# a command that prints something as a side-effect # a command that prints something as a side-effect
# (like pushd) # (like pushd)
HERE=$PWD local HERE=$PWD
T= T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
T=$PWD T=$PWD
@@ -453,7 +626,7 @@ function mm()
else else
# Find the closest Android.mk file. # Find the closest Android.mk file.
T=$(gettop) T=$(gettop)
M=$(findmakefile) local M=$(findmakefile)
if [ ! "$T" ]; then if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." echo "Couldn't locate the top of the tree. Try setting TOP."
elif [ ! "$M" ]; then elif [ ! "$M" ]; then
@@ -468,8 +641,9 @@ function mmm()
{ {
T=$(gettop) T=$(gettop)
if [ "$T" ]; then if [ "$T" ]; then
MAKEFILE= local MAKEFILE=
ARGS= local ARGS=
local DIR TO_CHOP
for DIR in $@ ; do for DIR in $@ ; do
DIR=`echo $DIR | sed -e 's:/$::'` DIR=`echo $DIR | sed -e 's:/$::'`
if [ -f $DIR/Android.mk ]; then if [ -f $DIR/Android.mk ]; then
@@ -521,11 +695,11 @@ function pid()
function gdbclient() function gdbclient()
{ {
OUT_ROOT=$(get_abs_build_var PRODUCT_OUT) local OUT_ROOT=$(get_abs_build_var PRODUCT_OUT)
OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED) local OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED)
OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED) local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)
OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED) local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS) local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then
local EXE="$1" local EXE="$1"
if [ "$EXE" ] ; then if [ "$EXE" ] ; then
@@ -616,7 +790,7 @@ case `uname -s` in
*) *)
function mgrep() function mgrep()
{ {
find . -regextype posix-egrep -iregex '\(.*\/Makefile\|.*\/Makefile\..*\|.*\.make\|.*\.mak\|.*\.mk\)' -type f -print0 | xargs -0 grep --color -n "$@" find . -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -type f -print0 | xargs -0 grep --color -n "$@"
} }
function treegrep() function treegrep()
@@ -632,7 +806,6 @@ function getprebuilt
get_abs_build_var ANDROID_PREBUILTS get_abs_build_var ANDROID_PREBUILTS
} }
function tracedmdump() function tracedmdump()
{ {
T=$(gettop) T=$(gettop)
@@ -640,16 +813,16 @@ function tracedmdump()
echo "Couldn't locate the top of the tree. Try setting TOP." echo "Couldn't locate the top of the tree. Try setting TOP."
return return
fi fi
prebuiltdir=$(getprebuilt) local prebuiltdir=$(getprebuilt)
KERNEL=$T/prebuilt/android-arm/vmlinux-qemu local KERNEL=$T/prebuilt/android-arm/vmlinux-qemu
TRACE=$1 local TRACE=$1
if [ ! "$TRACE" ] ; then if [ ! "$TRACE" ] ; then
echo "usage: tracedmdump tracename" echo "usage: tracedmdump tracename"
return return
fi fi
BASETRACE=$(basename $TRACE) local BASETRACE=$(basename $TRACE)
if [ "$BASETRACE" = "$TRACE" ] ; then if [ "$BASETRACE" = "$TRACE" ] ; then
TRACE=$ANDROID_PRODUCT_OUT/traces/$TRACE TRACE=$ANDROID_PRODUCT_OUT/traces/$TRACE
fi fi
@@ -674,45 +847,66 @@ function tracedmdump()
echo " traceview $TRACE/dmtrace" echo " traceview $TRACE/dmtrace"
} }
# communicate with a running device or emulator, set up necessary state,
# and run the hat command.
function runhat() function runhat()
{ {
targetPid=$1 # process standard adb options
outputFile=$2 local adbTarget=""
if [ $1 = "-d" -o $1 = "-e" ]; then
adbTarget=$1
shift 1
elif [ $1 = "-s" ]; then
adbTarget="$1 $2"
shift 2
fi
local adbOptions=${adbTarget}
echo adbOptions = ${adbOptions}
# runhat options
local targetPid=$1
local outputFile=$2
if [ "$targetPid" = "" ]; then if [ "$targetPid" = "" ]; then
echo "Usage: runhat target-pid [output-file]" echo "Usage: runhat [ -d | -e | -s serial ] target-pid [output-file]"
return return
fi fi
adb shell >/dev/null mkdir /data/misc # confirm hat is available
adb shell chmod 777 /data/misc if [ -z $(which hat) ]; then
echo "hat is not available in this configuration."
return
fi
adb ${adbOptions} shell >/dev/null mkdir /data/misc
adb ${adbOptions} shell chmod 777 /data/misc
echo "Poking $targetPid and waiting for data..." echo "Poking $targetPid and waiting for data..."
adb shell kill -10 $targetPid adb ${adbOptions} shell kill -10 $targetPid
echo "Press enter when logcat shows \"GC freed ## objects / ## bytes\"" echo "Press enter when logcat shows \"GC freed ## objects / ## bytes\""
echo -n "> " echo -n "> "
read read
availFiles=( $(adb shell ls /data/misc | grep '^heap-dump' | sed -e 's/.*heap-dump-/heap-dump-/' | sort -r | tr '[:space:][:cntrl:]' ' ') ) local availFiles=( $(adb ${adbOptions} shell ls /data/misc | grep '^heap-dump' | sed -e 's/.*heap-dump-/heap-dump-/' | sort -r | tr '[:space:][:cntrl:]' ' ') )
devHeadFile=/data/misc/${availFiles[0]} local devHeadFile=/data/misc/${availFiles[0]}
devTailFile=/data/misc/${availFiles[1]} local devTailFile=/data/misc/${availFiles[1]}
localHeadFile=/tmp/$$-hprof-head local localHeadFile=/tmp/$$-hprof-head
localTailFile=/tmp/$$-hprof-tail local localTailFile=/tmp/$$-hprof-tail
echo "Retrieving file $devHeadFile..." echo "Retrieving file $devHeadFile..."
adb pull $devHeadFile $localHeadFile adb ${adbOptions} pull $devHeadFile $localHeadFile
echo "Retrieving file $devTailFile..." echo "Retrieving file $devTailFile..."
adb pull $devTailFile $localTailFile adb ${adbOptions} pull $devTailFile $localTailFile
combinedFile=$outputFile local combinedFile=$outputFile
if [ "$combinedFile" = "" ]; then if [ "$combinedFile" = "" ]; then
combinedFile=/tmp/$$.hprof combinedFile=/tmp/$$.hprof
fi fi
cat $localHeadFile $localTailFile >$combinedFile cat $localHeadFile $localTailFile >$combinedFile
adb shell rm $devHeadFile adb ${adbOptions} shell rm $devHeadFile
adb shell rm $devTailFile adb ${adbOptions} shell rm $devTailFile
rm $localHeadFile rm $localHeadFile
rm $localTailFile rm $localTailFile
@@ -724,28 +918,25 @@ function runhat()
function getbugreports() function getbugreports()
{ {
reports=(`adb shell ls /sdcard/bugreports | tr -d '\r'`) local reports=(`adb shell ls /sdcard/bugreports | tr -d '\r'`)
if [ ! "$reports" ]; then if [ ! "$reports" ]; then
echo "Could not locate any bugreports." echo "Could not locate any bugreports."
return return
fi fi
count=${#reports[@]} local report
index=0 for report in ${reports[@]}
while [ "$index" -lt "$count" ]
do do
echo "/sdcard/bugreports/${reports[$index]}" echo "/sdcard/bugreports/${report}"
adb pull /sdcard/bugreports/${reports[$index]} ${reports[$index]} adb pull /sdcard/bugreports/${report} ${report}
gunzip ${reports[$index]} gunzip ${report}
let "index = $index + 1"
done done
} }
function startviewserver() function startviewserver()
{ {
port=4939 local port=4939
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
port=$1 port=$1
fi fi
@@ -782,3 +973,31 @@ function smoketest()
adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner
} }
# simple shortcut to the runtest command
function runtest()
{
T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
(cd "$T" && development/tools/runtest $@)
}
# determine whether arrays are zero-based (bash) or one-based (zsh)
_xarray=(a b c)
if [ -z "${_xarray[${#_xarray[@]}]}" ]
then
_arrayoffset=1
else
_arrayoffset=0
fi
unset _xarray
# Execute the contents of any vendorsetup.sh files we can find.
for f in `/bin/ls vendor/*/vendorsetup.sh 2> /dev/null`
do
echo "including $f"
. $f
done
unset f

View File

@@ -26,17 +26,17 @@ else
INSTALLED_RADIOIMAGE_TARGET := INSTALLED_RADIOIMAGE_TARGET :=
endif endif
include $(TARGET_PRODUCT_DIR)/Android.mk include $(TARGET_DEVICE_DIR)/Android.mk
# Generate a file that contains various information about the # Generate a file that contains various information about the
# device we're building for. This file is typically packaged up # device we're building for. This file is typically packaged up
# with everything else. # with everything else.
# #
# If the file "board-info.txt" appears in $(TARGET_PRODUCT_DIR), # If the file "board-info.txt" appears in $(TARGET_DEVICE_DIR),
# it will be appended to the output file. # it will be appended to the output file.
# #
INSTALLED_ANDROID_INFO_TXT_TARGET := $(PRODUCT_OUT)/android-info.txt INSTALLED_ANDROID_INFO_TXT_TARGET := $(PRODUCT_OUT)/android-info.txt
board_info_txt := $(wildcard $(TARGET_PRODUCT_DIR)/board-info.txt) board_info_txt := $(wildcard $(TARGET_DEVICE_DIR)/board-info.txt)
$(INSTALLED_ANDROID_INFO_TXT_TARGET): $(board_info_txt) $(INSTALLED_ANDROID_INFO_TXT_TARGET): $(board_info_txt)
$(call pretty,"Generated: ($@)") $(call pretty,"Generated: ($@)")
$(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@ $(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@

View File

@@ -1,6 +1,7 @@
PRODUCT_BRAND := PRODUCT_BRAND :=
PRODUCT_NAME := PRODUCT_NAME :=
PRODUCT_DEVICE := PRODUCT_DEVICE :=
PRODUCT_POLICY := android.policy_phone
PRODUCT_PROPERTY_OVERRIDES := \ PRODUCT_PROPERTY_OVERRIDES := \
ro.config.notification_sound=F1_New_SMS.ogg ro.config.notification_sound=F1_New_SMS.ogg
@@ -14,8 +15,6 @@ PRODUCT_PACKAGES := \
ContactsProvider \ ContactsProvider \
DownloadProvider \ DownloadProvider \
GoogleSearch \ GoogleSearch \
ImProvider \
ImCredentialProvider \
MediaProvider \ MediaProvider \
SettingsProvider \ SettingsProvider \
TelephonyProvider \ TelephonyProvider \

View File

@@ -8,6 +8,7 @@ PRODUCT_PACKAGES := \
Calendar \ Calendar \
Camera \ Camera \
DrmProvider \ DrmProvider \
LatinIME \
Mms \ Mms \
Music \ Music \
Settings \ Settings \

View File

@@ -4,6 +4,7 @@ PRODUCT_PACKAGES := \
ApiDemos \ ApiDemos \
Development \ Development \
Fallback \ Fallback \
GPSEnable
$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)

View File

@@ -174,14 +174,14 @@ public class ClassInfo {
} }
} else { } else {
Errors.error(Errors.REMOVED_METHOD, mInfo.position(), Errors.error(Errors.REMOVED_METHOD, mInfo.position(),
"Removed public constructor " + mInfo.qualifiedName()); "Removed public constructor " + mInfo.prettySignature());
consistent = false; consistent = false;
} }
} }
for (ConstructorInfo mInfo : cl.mConstructors.values()) { for (ConstructorInfo mInfo : cl.mConstructors.values()) {
if (!mInfo.isInBoth()) { if (!mInfo.isInBoth()) {
Errors.error(Errors.ADDED_METHOD, mInfo.position(), Errors.error(Errors.ADDED_METHOD, mInfo.position(),
"Added public constructor " + mInfo.qualifiedName()); "Added public constructor " + mInfo.prettySignature());
consistent = false; consistent = false;
} }
} }
@@ -224,10 +224,16 @@ public class ClassInfo {
} }
if (!mScope.equals(cl.mScope)) { if (!mScope.equals(cl.mScope)) {
consistent = false; consistent = false;
Errors.error(Errors.CHANGED_SCOPE, cl.position(), Errors.error(Errors.CHANGED_SCOPE, cl.position(),
"Class " + cl.qualifiedName() + " scope changed from " "Class " + cl.qualifiedName() + " scope changed from "
+ mScope + " to " + cl.mScope); + mScope + " to " + cl.mScope);
}
if (!mDeprecated.equals(cl.mDeprecated)) {
consistent = false;
Errors.error(Errors.CHANGED_DEPRECATED, cl.position(),
"Class " + cl.qualifiedName() + " has changed deprecation state");
} }
if (mSuperClassName != null) { if (mSuperClassName != null) {

View File

@@ -81,6 +81,17 @@ public class ConstructorInfo implements AbstractMethodInfo {
return baseName + name(); return baseName + name();
} }
public String prettySignature() {
String params = "";
for (ParameterInfo pInfo : mParameters) {
if (params.length() > 0) {
params += ", ";
}
params += pInfo.getType();
}
return qualifiedName() + '(' + params + ')';
}
public boolean isConsistent(ConstructorInfo mInfo) { public boolean isConsistent(ConstructorInfo mInfo) {
mInfo.mExistsInBoth = true; mInfo.mExistsInBoth = true;
mExistsInBoth = true; mExistsInBoth = true;
@@ -89,26 +100,32 @@ public class ConstructorInfo implements AbstractMethodInfo {
if (mIsFinal != mInfo.mIsFinal) { if (mIsFinal != mInfo.mIsFinal) {
consistent = false; consistent = false;
Errors.error(Errors.CHANGED_FINAL, mInfo.position(), Errors.error(Errors.CHANGED_FINAL, mInfo.position(),
"Method " + mInfo.qualifiedName() + " has changed 'final' qualifier"); "Constructor " + mInfo.qualifiedName() + " has changed 'final' qualifier");
} }
if (mIsStatic != mInfo.mIsStatic) { if (mIsStatic != mInfo.mIsStatic) {
consistent = false; consistent = false;
Errors.error(Errors.CHANGED_FINAL, mInfo.position(), Errors.error(Errors.CHANGED_FINAL, mInfo.position(),
"Method " + mInfo.qualifiedName() + " has changed 'static' qualifier"); "Constructor " + mInfo.qualifiedName() + " has changed 'static' qualifier");
} }
if (!mScope.equals(mInfo.mScope)) { if (!mScope.equals(mInfo.mScope)) {
consistent = false; consistent = false;
Errors.error(Errors.CHANGED_SCOPE, mInfo.position(), Errors.error(Errors.CHANGED_SCOPE, mInfo.position(),
"Method " + mInfo.qualifiedName() + " changed scope from " "Constructor " + mInfo.qualifiedName() + " changed scope from "
+ mScope + " to " + mInfo.mScope); + mScope + " to " + mInfo.mScope);
} }
if (!mDeprecated.equals(mInfo.mDeprecated)) {
consistent = false;
Errors.error(Errors.CHANGED_DEPRECATED, mInfo.position(),
"Constructor " + mInfo.qualifiedName() + " has changed deprecation state");
}
for (String exec : mExceptions) { for (String exec : mExceptions) {
if (!mInfo.mExceptions.contains(exec)) { if (!mInfo.mExceptions.contains(exec)) {
Errors.error(Errors.CHANGED_THROWS, mInfo.position(), Errors.error(Errors.CHANGED_THROWS, mInfo.position(),
"Method " + mInfo.qualifiedName() + " no longer throws exception " "Constructor " + mInfo.qualifiedName() + " no longer throws exception "
+ exec); + exec);
consistent = false; consistent = false;
} }
@@ -117,7 +134,7 @@ public class ConstructorInfo implements AbstractMethodInfo {
for (String exec : mInfo.mExceptions) { for (String exec : mInfo.mExceptions) {
if (!mExceptions.contains(exec)) { if (!mExceptions.contains(exec)) {
Errors.error(Errors.CHANGED_THROWS, mInfo.position(), Errors.error(Errors.CHANGED_THROWS, mInfo.position(),
"Method " + mInfo.qualifiedName() + " added thrown exception " "Constructor " + mInfo.qualifiedName() + " added thrown exception "
+ exec); + exec);
consistent = false; consistent = false;
} }

View File

@@ -113,6 +113,7 @@ public class Errors
public static Error CHANGED_THROWS = new Error(21, WARNING); public static Error CHANGED_THROWS = new Error(21, WARNING);
public static Error CHANGED_NATIVE = new Error(22, HIDDEN); public static Error CHANGED_NATIVE = new Error(22, HIDDEN);
public static Error CHANGED_CLASS = new Error(23, WARNING); public static Error CHANGED_CLASS = new Error(23, WARNING);
public static Error CHANGED_DEPRECATED = new Error(24, WARNING);
public static Error[] ERRORS = { public static Error[] ERRORS = {
PARSE_ERROR, PARSE_ERROR,
@@ -137,6 +138,8 @@ public class Errors
CHANGED_ABSTRACT, CHANGED_ABSTRACT,
CHANGED_THROWS, CHANGED_THROWS,
CHANGED_NATIVE, CHANGED_NATIVE,
CHANGED_CLASS,
CHANGED_DEPRECATED,
}; };
public static boolean setErrorLevel(int code, int level) { public static boolean setErrorLevel(int code, int level) {

View File

@@ -148,6 +148,12 @@ public class FieldInfo {
consistent = false; consistent = false;
} }
if (!mDeprecated.equals(fInfo.mDeprecated)) {
Errors.error(Errors.CHANGED_DEPRECATED, fInfo.position(),
"Field " + fInfo.qualifiedName() + " has changed deprecation state");
consistent = false;
}
return consistent; return consistent;
} }

View File

@@ -66,6 +66,17 @@ public class MethodInfo implements AbstractMethodInfo {
return parentQName + name(); return parentQName + name();
} }
public String prettySignature() {
String params = "";
for (ParameterInfo pInfo : mParameters) {
if (params.length() > 0) {
params += ", ";
}
params += pInfo.getType();
}
return qualifiedName() + '(' + params + ')';
}
public SourcePositionInfo position() { public SourcePositionInfo position() {
return mSourcePosition; return mSourcePosition;
} }
@@ -128,21 +139,33 @@ public class MethodInfo implements AbstractMethodInfo {
+ mScope + " to " + mInfo.mScope); + mScope + " to " + mInfo.mScope);
} }
if (!mDeprecated.equals(mInfo.mDeprecated)) {
Errors.error(Errors.CHANGED_DEPRECATED, mInfo.position(),
"Method " + mInfo.qualifiedName() + " has changed deprecation state");
consistent = false;
}
for (String exec : mExceptions) { for (String exec : mExceptions) {
if (!mInfo.mExceptions.contains(exec)) { if (!mInfo.mExceptions.contains(exec)) {
Errors.error(Errors.CHANGED_THROWS, mInfo.position(), // exclude 'throws' changes to finalize() overrides with no arguments
"Method " + mInfo.qualifiedName() + " no longer throws exception " if (!name().equals("finalize") || (mParameters.size() > 0)) {
+ exec); Errors.error(Errors.CHANGED_THROWS, mInfo.position(),
consistent = false; "Method " + mInfo.qualifiedName() + " no longer throws exception "
+ exec);
consistent = false;
}
} }
} }
for (String exec : mInfo.mExceptions) { for (String exec : mInfo.mExceptions) {
// exclude 'throws' changes to finalize() overrides with no arguments
if (!mExceptions.contains(exec)) { if (!mExceptions.contains(exec)) {
Errors.error(Errors.CHANGED_THROWS, mInfo.position(), if (!name().equals("finalize") || (mParameters.size() > 0)) {
"Method " + mInfo.qualifiedName() + " added thrown exception " Errors.error(Errors.CHANGED_THROWS, mInfo.position(),
+ exec); "Method " + mInfo.qualifiedName() + " added thrown exception "
consistent = false; + exec);
consistent = false;
}
} }
} }

View File

@@ -5,19 +5,22 @@
LOCAL_PATH:= $(call my-dir) LOCAL_PATH:= $(call my-dir)
ifeq ($(TARGET_ARCH),arm) ifneq ($(TARGET_SIMULATOR),true)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_LDLIBS += -ldl LOCAL_LDLIBS += -ldl
LOCAL_CFLAGS += -O2 -g LOCAL_CFLAGS += -O2 -g
LOCAL_CFLAGS += -fno-function-sections -fno-data-sections -fno-inline LOCAL_CFLAGS += -fno-function-sections -fno-data-sections -fno-inline
LOCAL_CFLAGS += -Wall -Wno-unused-function #-Werror LOCAL_CFLAGS += -Wall -Wno-unused-function #-Werror
LOCAL_CFLAGS += -DBIG_ENDIAN=1
LOCAL_CFLAGS += -DARM_SPECIFIC_HACKS
LOCAL_CFLAGS += -DSUPPORT_ANDROID_PRELINK_TAGS LOCAL_CFLAGS += -DSUPPORT_ANDROID_PRELINK_TAGS
LOCAL_CFLAGS += -DDEBUG LOCAL_CFLAGS += -DDEBUG
LOCAL_CFLAGS += -DADJUST_ELF=1 LOCAL_CFLAGS += -DADJUST_ELF=1
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DARM_SPECIFIC_HACKS
LOCAL_CFLAGS += -DBIG_ENDIAN=1
endif
ifeq ($(HOST_OS),darwin) ifeq ($(HOST_OS),darwin)
LOCAL_CFLAGS += -DFSCANF_IS_BROKEN LOCAL_CFLAGS += -DFSCANF_IS_BROKEN
endif endif
@@ -46,9 +49,13 @@ LOCAL_C_INCLUDES:= \
external/elfutils/libebl/ \ external/elfutils/libebl/ \
external/elfcopy/ external/elfcopy/
LOCAL_STATIC_LIBRARIES := libelfcopy libelf libebl libebl_arm #dl LOCAL_STATIC_LIBRARIES := libelfcopy libelf libebl #dl
ifeq ($(TARGET_ARCH),arm)
LOCAL_STATIC_LIBRARIES += libebl_arm
endif
LOCAL_MODULE := apriori LOCAL_MODULE := apriori
include $(BUILD_HOST_EXECUTABLE) include $(BUILD_HOST_EXECUTABLE)
endif #TARGET_ARCH==arm endif # TARGET_SIMULATOR != true

View File

@@ -5,12 +5,15 @@
#include "files.h" #include "files.h"
#include "fs.h" #include "fs.h"
#include <set> #include <set>
#include <iostream>
#include <sstream>
using namespace std; using namespace std;
bool g_debug = false; bool g_debug = false;
vector<string> g_listFiles; vector<string> g_listFiles;
vector<string> g_inputBases; vector<string> g_inputBases;
map<string, string> g_variables;
string g_outputBase; string g_outputBase;
string g_dependency; string g_dependency;
bool g_useHardLinks = false; bool g_useHardLinks = false;
@@ -29,6 +32,7 @@ const char* USAGE =
" -l Use hard links instead of copying the files.\n" " -l Use hard links instead of copying the files.\n"
" -m DEPENDENCY Output a make-formatted file containing the list.\n" " -m DEPENDENCY Output a make-formatted file containing the list.\n"
" of files included. It sets the variable ATREE_FILES.\n" " of files included. It sets the variable ATREE_FILES.\n"
" -v VAR=VAL Replaces ${VAR} by VAL when reading input files.\n"
"\n" "\n"
"FILELIST file format:\n" "FILELIST file format:\n"
" The FILELIST files contain the list of files that will end up\n" " The FILELIST files contain the list of files that will end up\n"
@@ -53,13 +57,28 @@ int usage()
return 1; return 1;
} }
static bool
add_variable(const char* arg) {
const char* p = arg;
while (*p && *p != '=') p++;
if (*p == 0 || p == arg || p[1] == 0) {
return false;
}
ostringstream var;
var << "${" << string(arg, p-arg) << "}";
g_variables[var.str()] = string(p+1);
return true;
}
int int
main(int argc, char* const* argv) main(int argc, char* const* argv)
{ {
int err; int err;
bool done = false; bool done = false;
while (!done) { while (!done) {
int opt = getopt(argc, argv, "f:I:o:hlm:"); int opt = getopt(argc, argv, "f:I:o:hlm:v:");
switch (opt) switch (opt)
{ {
case -1: case -1:
@@ -90,6 +109,14 @@ main(int argc, char* const* argv)
} }
g_dependency = optarg; g_dependency = optarg;
break; break;
case 'v':
if (!add_variable(optarg)) {
fprintf(stderr, "%s Invalid expression in '-v %s': "
"expected format is '-v VAR=VALUE'.\n",
argv[0], optarg);
return usage();
}
break;
default: default:
case '?': case '?':
case 'h': case 'h':
@@ -143,7 +170,7 @@ main(int argc, char* const* argv)
// read file lists // read file lists
for (vector<string>::iterator it=g_listFiles.begin(); for (vector<string>::iterator it=g_listFiles.begin();
it!=g_listFiles.end(); it++) { it!=g_listFiles.end(); it++) {
err = read_list_file(*it, &files, &excludes); err = read_list_file(*it, g_variables, &files, &excludes);
if (err != 0) { if (err != 0) {
return err; return err;
} }

View File

@@ -102,9 +102,61 @@ add_file(vector<FileRecord>* files, const string& listFile, int listLine,
files->push_back(rec); files->push_back(rec);
} }
static string
replace_variables(const string& input,
const map<string, string>& variables,
bool* error) {
if (variables.empty()) {
return input;
}
// Abort if the variable prefix is not found
if (input.find("${") == string::npos) {
return input;
}
string result = input;
// Note: rather than be fancy to detect recursive replacements,
// we simply iterate till a given threshold is met.
int retries = 1000;
bool did_replace;
do {
did_replace = false;
for (map<string, string>::const_iterator it = variables.begin();
it != variables.end(); ++it) {
string::size_type pos = 0;
while((pos = result.find(it->first, pos)) != string::npos) {
result = result.replace(pos, it->first.length(), it->second);
pos += it->second.length();
did_replace = true;
}
}
if (did_replace && --retries == 0) {
*error = true;
fprintf(stderr, "Recursive replacement detected during variables "
"substitution. Full list of variables is: ");
for (map<string, string>::const_iterator it = variables.begin();
it != variables.end(); ++it) {
fprintf(stderr, " %s=%s\n",
it->first.c_str(), it->second.c_str());
}
return result;
}
} while (did_replace);
return result;
}
int int
read_list_file(const string& filename, vector<FileRecord>* files, read_list_file(const string& filename,
vector<string>* excludes) const map<string, string>& variables,
vector<FileRecord>* files,
vector<string>* excludes)
{ {
int err = 0; int err = 0;
FILE* f = NULL; FILE* f = NULL;
@@ -194,11 +246,27 @@ read_list_file(const string& filename, vector<FileRecord>* files,
if (words.size() == 1) { if (words.size() == 1) {
// pattern: DEST // pattern: DEST
add_file(files, filename, i+1, words[0], words[0]); bool error = false;
string w0 = replace_variables(words[0], variables, &error);
if (error) {
err = 1;
goto cleanup;
}
add_file(files, filename, i+1, w0, w0);
} }
else if (words.size() == 2) { else if (words.size() == 2) {
// pattern: SRC DEST // pattern: SRC DEST
add_file(files, filename, i+1, words[0], words[1]); bool error = false;
string w0, w1;
w0 = replace_variables(words[0], variables, &error);
if (!error) {
w1 = replace_variables(words[1], variables, &error);
}
if (error) {
err = 1;
goto cleanup;
}
add_file(files, filename, i+1, w0, w1);
} }
else { else {
fprintf(stderr, "%s:%d: bad format: %s\n", filename.c_str(), fprintf(stderr, "%s:%d: bad format: %s\n", filename.c_str(),

View File

@@ -1,6 +1,7 @@
#ifndef FILES_H #ifndef FILES_H
#define FILES_H #define FILES_H
#include <map>
#include <string> #include <string>
#include <vector> #include <vector>
#include <sys/types.h> #include <sys/types.h>
@@ -25,8 +26,10 @@ struct FileRecord
unsigned int mode; unsigned int mode;
}; };
int read_list_file(const string& filename, vector<FileRecord>* files, int read_list_file(const string& filename,
vector<string>* excludes); const map<string, string>& variables,
vector<FileRecord>* files,
vector<string>* excludes);
int locate(FileRecord* rec, const vector<string>& search); int locate(FileRecord* rec, const vector<string>& search);
void stat_out(const string& base, FileRecord* rec); void stat_out(const string& base, FileRecord* rec);
string dir_part(const string& filename); string dir_part(const string& filename);

View File

@@ -16,14 +16,14 @@ echo "ro.build.tags=$BUILD_VERSION_TAGS"
echo "ro.product.model=$PRODUCT_MODEL" echo "ro.product.model=$PRODUCT_MODEL"
echo "ro.product.brand=$PRODUCT_BRAND" echo "ro.product.brand=$PRODUCT_BRAND"
echo "ro.product.name=$PRODUCT_NAME" echo "ro.product.name=$PRODUCT_NAME"
echo "ro.product.device=$TARGET_PRODUCT" echo "ro.product.device=$TARGET_DEVICE"
echo "ro.product.board=$TARGET_BOOTLOADER_BOARD_NAME" echo "ro.product.board=$TARGET_BOOTLOADER_BOARD_NAME"
echo "ro.product.manufacturer=$PRODUCT_MANUFACTURER" echo "ro.product.manufacturer=$PRODUCT_MANUFACTURER"
echo "ro.product.locale.language=$PRODUCT_DEFAULT_LANGUAGE" echo "ro.product.locale.language=$PRODUCT_DEFAULT_LANGUAGE"
echo "ro.product.locale.region=$PRODUCT_DEFAULT_REGION" echo "ro.product.locale.region=$PRODUCT_DEFAULT_REGION"
echo "# ro.build.product is obsolete; use ro.product.device" echo "# ro.build.product is obsolete; use ro.product.device"
echo "ro.build.product=$TARGET_PRODUCT" echo "ro.build.product=$TARGET_DEVICE"
echo "# Do not try to parse ro.build.description or .fingerprint" echo "# Do not try to parse ro.build.description or .fingerprint"
echo "ro.build.description=$PRIVATE_BUILD_DESC" echo "ro.build.description=$PRIVATE_BUILD_DESC"

View File

@@ -14,6 +14,7 @@
# limitations under the License. # limitations under the License.
# #
ifneq ($(TARGET_SIMULATOR),true) ifneq ($(TARGET_SIMULATOR),true)
ifneq ($(DISABLE_DEXPREOPT),true)
LOCAL_PATH := $(my-dir) LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
@@ -33,4 +34,5 @@ subdir_makefiles := \
$(LOCAL_PATH)/afar/Android.mk $(LOCAL_PATH)/afar/Android.mk
include $(subdir_makefiles) include $(subdir_makefiles)
endif # !disable_dexpreopt
endif # !sim endif # !sim

View File

@@ -91,7 +91,7 @@ $(BUILT_DEXPREOPT_SYSTEMIMAGE):
$(hide) \ $(hide) \
PATH=$(HOST_OUT_EXECUTABLES):$$PATH \ PATH=$(HOST_OUT_EXECUTABLES):$$PATH \
$(DEXPREOPT) \ $(DEXPREOPT) \
--kernel prebuilt/android-arm/kernel-qemu \ --kernel prebuilt/android-arm/kernel/kernel-qemu \
--ramdisk $(BUILT_DEXPREOPT_RAMDISK) \ --ramdisk $(BUILT_DEXPREOPT_RAMDISK) \
--image $(BUILT_SYSTEMIMAGE_UNOPT) \ --image $(BUILT_SYSTEMIMAGE_UNOPT) \
--system $(PRODUCT_OUT) \ --system $(PRODUCT_OUT) \

View File

@@ -520,7 +520,11 @@ def DownloadDirectoryHierarchy(ep, src, dest, timeout=0):
buf.fromfile(ep.stdout, 4) buf.fromfile(ep.stdout, 4)
(adler32,) = struct.unpack('>i', buf) # adler32 wants a signed int ('i') (adler32,) = struct.unpack('>i', buf) # adler32 wants a signed int ('i')
data_adler32 = zlib.adler32(data) data_adler32 = zlib.adler32(data)
if adler32 != data_adler32: # Because of a difference in behavior of zlib.adler32 on 32-bit and 64-bit
# systems (one returns signed values, the other unsigned), we take the
# modulo 2**32 of the checksums, and compare those.
# See also http://bugs.python.org/issue1202
if (adler32 % (2**32)) != (data_adler32 % (2**32)):
Trace('adler32 does not match: calculated 0x%08x != expected 0x%08x' % Trace('adler32 does not match: calculated 0x%08x != expected 0x%08x' %
(data_adler32, adler32)) (data_adler32, adler32))
return False return False

View File

@@ -39,6 +39,7 @@ LOCAL_SRC_FILES := \
LiteralTagInfo.java \ LiteralTagInfo.java \
MemberInfo.java \ MemberInfo.java \
MethodInfo.java \ MethodInfo.java \
NavTree.java \
PackageInfo.java \ PackageInfo.java \
ParamTagInfo.java \ ParamTagInfo.java \
ParameterInfo.java \ ParameterInfo.java \

View File

@@ -116,21 +116,21 @@ public class DocFile
hdf.setValue("commentText", commentText); hdf.setValue("commentText", commentText);
if(outfile.indexOf("sdk/") != -1) { if (outfile.indexOf("sdk/") != -1) {
hdf.setValue("sdk", "true"); hdf.setValue("sdk", "true");
if(outfile.indexOf("index.html") != -1) { if (outfile.indexOf("index.html") != -1) {
ClearPage.write(hdf, "sdkpage.cs", outfile); ClearPage.write(hdf, "sdkpage.cs", outfile);
}else{ } else {
ClearPage.write(hdf, "docpage.cs", outfile);
}
} else if (outfile.indexOf("guide/") != -1){
hdf.setValue("guide", "true");
ClearPage.write(hdf, "docpage.cs", outfile); ClearPage.write(hdf, "docpage.cs", outfile);
} } else if (outfile.indexOf("publish/") != -1){
}else if(outfile.indexOf("guide/") != -1){ hdf.setValue("publish", "true");
hdf.setValue("guide", "true"); ClearPage.write(hdf, "docpage.cs", outfile);
ClearPage.write(hdf, "docpage.cs", outfile); } else {
}else if(outfile.indexOf("publish/") != -1){ ClearPage.write(hdf, "nosidenavpage.cs", outfile);
hdf.setValue("publish", "true");
ClearPage.write(hdf, "docpage.cs", outfile);
}else{
ClearPage.write(hdf, "nosidenavpage.cs", outfile);
} }
} }

View File

@@ -209,6 +209,9 @@ public class DroidDoc
writeHTMLPages(); writeHTMLPages();
} }
// Navigation tree
NavTree.writeNavTree(javadocDir);
// Packages Pages // Packages Pages
writePackages(javadocDir writePackages(javadocDir
+ (ClearPage.htmlDir!=null + (ClearPage.htmlDir!=null
@@ -475,7 +478,7 @@ public class DroidDoc
classesToCheck = pkg.interfaces(); classesToCheck = pkg.interfaces();
break; break;
default: default:
System.out.println("Error reading package: " + pkg.name()); System.err.println("Error reading package: " + pkg.name());
break; break;
} }
for (ClassInfo cl : classesToCheck) { for (ClassInfo cl : classesToCheck) {
@@ -516,24 +519,17 @@ public class DroidDoc
if (len > 3 && ".cs".equals(templ.substring(len-3))) { if (len > 3 && ".cs".equals(templ.substring(len-3))) {
HDF data = makeHDF(); HDF data = makeHDF();
String filename = templ.substring(0,len-3) + htmlExtension; String filename = templ.substring(0,len-3) + htmlExtension;
System.out.println("Writing CS: " + filename);
ClearPage.write(data, templ, filename); ClearPage.write(data, templ, filename);
} }
else if (len > 3 && ".jd".equals(templ.substring(len-3))) { else if (len > 3 && ".jd".equals(templ.substring(len-3))) {
String filename = templ.substring(0,len-3) + htmlExtension; String filename = templ.substring(0,len-3) + htmlExtension;
System.out.println("Writing JD: " + filename);
DocFile.writePage(f.getAbsolutePath(), relative, filename); DocFile.writePage(f.getAbsolutePath(), relative, filename);
} }
else { else {
// System.out.println("relative=" + relative
// + " f.getAbsolutePath()=" + f.getAbsolutePath()
// + " templ=" + templ);
System.out.println("Copying: " + templ);
ClearPage.copyFile(f, templ); ClearPage.copyFile(f, templ);
} }
} }
else if (f.isDirectory()) { else if (f.isDirectory()) {
System.out.println("Writing dir: " + relative + f.getName() + "/");
writeDirectory(f, relative + f.getName() + "/"); writeDirectory(f, relative + f.getName() + "/");
} }
} }
@@ -543,7 +539,7 @@ public class DroidDoc
{ {
File f = new File(ClearPage.htmlDir); File f = new File(ClearPage.htmlDir);
if (!f.isDirectory()) { if (!f.isDirectory()) {
System.out.println("htmlDir not a directory: " + ClearPage.htmlDir); System.err.println("htmlDir not a directory: " + ClearPage.htmlDir);
} }
writeDirectory(f, ""); writeDirectory(f, "");
} }
@@ -644,7 +640,7 @@ public class DroidDoc
} }
} }
catch (FileNotFoundException e) { catch (FileNotFoundException e) {
System.out.println("error writing file: " + filename); System.err.println("error writing file: " + filename);
} }
finally { finally {
if (stream != null) { if (stream != null) {
@@ -653,13 +649,13 @@ public class DroidDoc
} }
} }
public static void writePackages(String filename) private static PackageInfo[] sVisiblePackages = null;
{ public static PackageInfo[] choosePackages() {
System.out.println("Writing packages..."); if (sVisiblePackages != null) {
HDF data = makePackageHDF(); return sVisiblePackages;
}
ClassInfo[] classes = Converter.rootClasses(); ClassInfo[] classes = Converter.rootClasses();
SortedMap<String, PackageInfo> sorted = new TreeMap<String, PackageInfo>(); SortedMap<String, PackageInfo> sorted = new TreeMap<String, PackageInfo>();
for (ClassInfo cl: classes) { for (ClassInfo cl: classes) {
PackageInfo pkg = cl.containingPackage(); PackageInfo pkg = cl.containingPackage();
@@ -672,7 +668,8 @@ public class DroidDoc
sorted.put(name, pkg); sorted.put(name, pkg);
} }
int i = 0; ArrayList<PackageInfo> result = new ArrayList();
for (String s: sorted.keySet()) { for (String s: sorted.keySet()) {
PackageInfo pkg = sorted.get(s); PackageInfo pkg = sorted.get(s);
@@ -680,10 +677,13 @@ public class DroidDoc
continue; continue;
} }
Boolean allHidden = true; Boolean allHidden = true;
int pass = 1; int pass = 0;
ClassInfo[] classesToCheck = pkg.ordinaryClasses(); ClassInfo[] classesToCheck = null;
while (pass < 5 ) { while (pass < 5 ) {
switch(pass) { switch(pass) {
case 0:
classesToCheck = pkg.ordinaryClasses();
break;
case 1: case 1:
classesToCheck = pkg.enums(); classesToCheck = pkg.enums();
break; break;
@@ -697,7 +697,7 @@ public class DroidDoc
classesToCheck = pkg.interfaces(); classesToCheck = pkg.interfaces();
break; break;
default: default:
System.out.println("Error reading package: " + pkg.name()); System.err.println("Error reading package: " + pkg.name());
break; break;
} }
for (ClassInfo cl : classesToCheck) { for (ClassInfo cl : classesToCheck) {
@@ -715,8 +715,26 @@ public class DroidDoc
continue; continue;
} }
result.add(pkg);
}
sVisiblePackages = result.toArray(new PackageInfo[result.size()]);
return sVisiblePackages;
}
public static void writePackages(String filename)
{
HDF data = makePackageHDF();
int i = 0;
for (PackageInfo pkg: choosePackages()) {
writePackage(pkg); writePackage(pkg);
data.setValue("docs.packages." + i + ".name", pkg.name());
data.setValue("docs.packages." + i + ".link", pkg.htmlPage());
TagInfo.makeHDF(data, "docs.packages." + i + ".shortDescr",
pkg.firstSentenceTags());
i++; i++;
} }
@@ -739,7 +757,6 @@ public class DroidDoc
HDF data = makePackageHDF(); HDF data = makePackageHDF();
String name = pkg.name(); String name = pkg.name();
System.out.println("Writing " + name);
data.setValue("package.name", name); data.setValue("package.name", name);
data.setValue("package.descr", "...description..."); data.setValue("package.descr", "...description...");
@@ -762,8 +779,7 @@ public class DroidDoc
setPageTitle(data, name); setPageTitle(data, name);
ClearPage.write(data, "package.cs", filename); ClearPage.write(data, "package.cs", filename);
filename = filename.substring(0, filename.lastIndexOf('/')+1) filename = pkg.fullDescriptionHtmlPage();
+ "package-descr" + htmlExtension;
setPageTitle(data, name + " Details"); setPageTitle(data, name + " Details");
ClearPage.write(data, "package-descr.cs", filename); ClearPage.write(data, "package-descr.cs", filename);
@@ -804,8 +820,6 @@ public class DroidDoc
sorted[j].label = sorted[j].label + " (" + pkg.name() + ")"; sorted[j].label = sorted[j].label + " (" + pkg.name() + ")";
} }
} }
} else {
//System.out.println("not duplicate: " + sorted[i].label);
} }
firstMatch = i; firstMatch = i;
lastName = s; lastName = s;
@@ -838,7 +852,7 @@ public class DroidDoc
cl.makeKeywordEntries(keywords); cl.makeKeywordEntries(keywords);
} }
HDF data = makePackageHDF(); HDF data = makeHDF();
Collections.sort(keywords); Collections.sort(keywords);
@@ -884,7 +898,6 @@ public class DroidDoc
{ {
cl.makeHDF(data); cl.makeHDF(data);
System.out.println("Writing " + cl.name());
setPageTitle(data, cl.name()); setPageTitle(data, cl.name());
ClearPage.write(data, "class.cs", cl.htmlPage()); ClearPage.write(data, "class.cs", cl.htmlPage());

View File

@@ -376,7 +376,8 @@ public class LinkReference {
if (result.href == null && !skipHref) { if (result.href == null && !skipHref) {
if (printOnErrors && (base == null || base.checkLevel())) { if (printOnErrors && (base == null || base.checkLevel())) {
Errors.error(Errors.UNRESOLVED_LINK, pos, Errors.error(Errors.UNRESOLVED_LINK, pos,
"Unresolved link/see tag: " + text.trim()); "Unresolved link/see tag \"" + text.trim()
+ "\" in " + ((base != null) ? base.qualifiedName() : "[null]"));
} }
result.makeError(); result.makeError();
} }

View File

@@ -266,9 +266,12 @@ public class MethodInfo extends MemberInfo
ClassInfo[] thrownExceptions, SourcePositionInfo position, ClassInfo[] thrownExceptions, SourcePositionInfo position,
AnnotationInstanceInfo[] annotations) AnnotationInstanceInfo[] annotations)
{ {
// Explicitly coerce 'final' state of Java6-compiled enum values() method, to match
// the Java5-emitted base API description.
super(rawCommentText, name, signature, containingClass, realContainingClass, super(rawCommentText, name, signature, containingClass, realContainingClass,
isPublic, isProtected, isPackagePrivate, isPrivate, isPublic, isProtected, isPackagePrivate, isPrivate,
isFinal, isStatic, isSynthetic, kind, position, annotations); ((name.equals("values") && containingClass.isEnum()) ? true : isFinal),
isStatic, isSynthetic, kind, position, annotations);
// The underlying MethodDoc for an interface's declared methods winds up being marked // The underlying MethodDoc for an interface's declared methods winds up being marked
// non-abstract. Correct that here by looking at the immediate-parent class, and marking // non-abstract. Correct that here by looking at the immediate-parent class, and marking

View File

@@ -0,0 +1,142 @@
/*
* 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.
*/
import org.clearsilver.HDF;
import java.util.ArrayList;
public class NavTree {
public static void writeNavTree(String dir) {
ArrayList<Node> children = new ArrayList();
for (PackageInfo pkg: DroidDoc.choosePackages()) {
children.add(makePackageNode(pkg));
}
Node node = new Node("Reference", dir + "packages.html", children);
StringBuilder buf = new StringBuilder();
if (false) {
// if you want a root node
buf.append("[");
node.render(buf);
buf.append("]");
} else {
// if you don't want a root node
node.renderChildren(buf);
}
HDF data = DroidDoc.makeHDF();
data.setValue("reference_tree", buf.toString());
ClearPage.write(data, "navtree_data.cs", "navtree_data.js");
}
private static Node makePackageNode(PackageInfo pkg) {
ArrayList<Node> children = new ArrayList();
children.add(new Node("Description", pkg.fullDescriptionHtmlPage(), null));
addClassNodes(children, "Interfaces", pkg.interfaces());
addClassNodes(children, "Classes", pkg.ordinaryClasses());
addClassNodes(children, "Enums", pkg.enums());
addClassNodes(children, "Exceptions", pkg.exceptions());
addClassNodes(children, "Errors", pkg.errors());
return new Node(pkg.name(), pkg.htmlPage(), children);
}
private static void addClassNodes(ArrayList<Node> parent, String label, ClassInfo[] classes) {
ArrayList<Node> children = new ArrayList();
for (ClassInfo cl: classes) {
if (cl.checkLevel()) {
children.add(new Node(cl.name(), cl.htmlPage(), null));
}
}
if (children.size() > 0) {
parent.add(new Node(label, null, children));
}
}
private static class Node {
private String mLabel;
private String mLink;
ArrayList<Node> mChildren;
Node(String label, String link, ArrayList<Node> children) {
mLabel = label;
mLink = link;
mChildren = children;
}
static void renderString(StringBuilder buf, String s) {
if (s == null) {
buf.append("null");
} else {
buf.append('"');
final int N = s.length();
for (int i=0; i<N; i++) {
char c = s.charAt(i);
if (c >= ' ' && c <= '~' && c != '"' && c != '\\') {
buf.append(c);
} else {
buf.append("\\u");
for (int j=0; i<4; i++) {
char x = (char)(c & 0x000f);
if (x > 10) {
x = (char)(x - 10 + 'a');
} else {
x = (char)(x + '0');
}
buf.append(x);
c >>= 4;
}
}
}
buf.append('"');
}
}
void renderChildren(StringBuilder buf) {
ArrayList<Node> list = mChildren;
if (list == null || list.size() == 0) {
// We output null for no children. That way empty lists here can just
// be a byproduct of how we generate the lists.
buf.append("null");
} else {
buf.append("[ ");
final int N = list.size();
for (int i=0; i<N; i++) {
list.get(i).render(buf);
if (i != N-1) {
buf.append(", ");
}
}
buf.append(" ]\n");
}
}
void render(StringBuilder buf) {
buf.append("[ ");
renderString(buf, mLabel);
buf.append(", ");
renderString(buf, mLink);
buf.append(", ");
renderChildren(buf);
buf.append(" ]");
}
}
}

View File

@@ -49,11 +49,10 @@ public class PackageInfo extends DocInfo implements ContainerInfo
return s; return s;
} }
public String htmlLinksPage() public String fullDescriptionHtmlPage() {
{
String s = mName; String s = mName;
s = s.replace('.', '/'); s = s.replace('.', '/');
s += "/package-links.html"; s += "/package-descr.html";
s = DroidDoc.javadocDir + s; s = DroidDoc.javadocDir + s;
return s; return s;
} }

View File

@@ -83,8 +83,9 @@ public class Stubs {
if (!t.isPrimitive()) { if (!t.isPrimitive()) {
if (t.asClassInfo().isHidden()) { if (t.asClassInfo().isHidden()) {
Errors.error(Errors.UNAVAILABLE_SYMBOL, Errors.error(Errors.UNAVAILABLE_SYMBOL,
p.position(), "Reference to unavailable class " m.position(), "Parameter of hidden type "
+ t.fullName()); + t.fullName() + " in "
+ cl.qualifiedName() + "." + m.name() + "()");
} }
} }
} }
@@ -255,10 +256,19 @@ public class Stubs {
if (pInfo.type().typeArguments() != null){ if (pInfo.type().typeArguments() != null){
for (TypeInfo tInfoType : pInfo.type().typeArguments()){ for (TypeInfo tInfoType : pInfo.type().typeArguments()){
if (tInfoType.asClassInfo() != null){ if (tInfoType.asClassInfo() != null){
cantStripThis(tInfoType.asClassInfo(), notStrippable, ClassInfo tcl = tInfoType.asClassInfo();
"10:" + if (tcl.isHidden()) {
mInfo.realContainingClass().qualifiedName() + ":" + Errors.error(Errors.UNAVAILABLE_SYMBOL, mInfo.position(),
mInfo.name()); "Parameter of hidden type "
+ tInfoType.fullName() + " in "
+ mInfo.containingClass().qualifiedName()
+ '.' + mInfo.name() + "()");
} else {
cantStripThis(tcl, notStrippable,
"10:" +
mInfo.realContainingClass().qualifiedName() + ":" +
mInfo.name());
}
} }
} }
} }
@@ -552,14 +562,8 @@ public class Stubs {
int count = 1; int count = 1;
int size = method.parameters().length; int size = method.parameters().length;
for (ParameterInfo param: method.parameters()) { for (ParameterInfo param: method.parameters()) {
String fullTypeName = param.type().fullName(method.typeVariables()); stream.print(comma + fullParameterTypeName(method, param.type(), count == size)
if (count == size && method.isVarArgs()) { + " " + param.name());
// TODO: note that this does not attempt to handle hypothetical
// vararg methods whose last parameter is a list of arrays, e.g.
// "Object[]...".
fullTypeName = param.type().qualifiedTypeName() + "...";
}
stream.print(comma + fullTypeName + " " + param.name());
comma = ", "; comma = ", ";
count++; count++;
} }
@@ -852,6 +856,7 @@ public class Stubs {
static void writeMethodXML(PrintStream xmlWriter, MethodInfo mi) { static void writeMethodXML(PrintStream xmlWriter, MethodInfo mi) {
String scope = DroidDoc.scope(mi); String scope = DroidDoc.scope(mi);
String deprecatedString = ""; String deprecatedString = "";
if (mi.isDeprecated()) { if (mi.isDeprecated()) {
deprecatedString = "deprecated"; deprecatedString = "deprecated";
@@ -860,7 +865,7 @@ public class Stubs {
} }
xmlWriter.println("<method name=\"" + mi.name() + "\"\n" xmlWriter.println("<method name=\"" + mi.name() + "\"\n"
+ ((mi.returnType() != null) + ((mi.returnType() != null)
? " return=\"" + mi.returnType().qualifiedTypeName() + "\"\n" ? " return=\"" + makeXMLcompliant(fullParameterTypeName(mi, mi.returnType(), false)) + "\"\n"
: "") : "")
+ " abstract=\"" + mi.isAbstract() + "\"\n" + " abstract=\"" + mi.isAbstract() + "\"\n"
+ " native=\"" + mi.isNative() + "\"\n" + " native=\"" + mi.isNative() + "\"\n"
@@ -873,8 +878,11 @@ public class Stubs {
+ ">"); + ">");
// write parameters in declaration order // write parameters in declaration order
int numParameters = mi.parameters().length;
int count = 0;
for (ParameterInfo pi : mi.parameters()) { for (ParameterInfo pi : mi.parameters()) {
writeParameterXML(xmlWriter, pi); count++;
writeParameterXML(xmlWriter, mi, pi, count == numParameters);
} }
// but write exceptions in canonicalized order // but write exceptions in canonicalized order
@@ -905,6 +913,13 @@ public class Stubs {
//+ " source=\"" + mi.position() + "\"\n" //+ " source=\"" + mi.position() + "\"\n"
+ ">"); + ">");
int numParameters = mi.parameters().length;
int count = 0;
for (ParameterInfo pi : mi.parameters()) {
count++;
writeParameterXML(xmlWriter, mi, pi, count == numParameters);
}
ClassInfo[] exceptions = mi.thrownExceptions(); ClassInfo[] exceptions = mi.thrownExceptions();
Arrays.sort(exceptions, ClassInfo.comparator); Arrays.sort(exceptions, ClassInfo.comparator);
for (ClassInfo pi : exceptions) { for (ClassInfo pi : exceptions) {
@@ -915,9 +930,10 @@ public class Stubs {
xmlWriter.println("</constructor>"); xmlWriter.println("</constructor>");
} }
static void writeParameterXML(PrintStream xmlWriter, ParameterInfo pi) { static void writeParameterXML(PrintStream xmlWriter, MethodInfo method,
ParameterInfo pi, boolean isLast) {
xmlWriter.println("<parameter name=\"" + pi.name() + "\" type=\"" + xmlWriter.println("<parameter name=\"" + pi.name() + "\" type=\"" +
pi.type().qualifiedTypeName() + "\">"); makeXMLcompliant(fullParameterTypeName(method, pi.type(), isLast)) + "\">");
xmlWriter.println("</parameter>"); xmlWriter.println("</parameter>");
} }
@@ -931,8 +947,12 @@ public class Stubs {
} }
//need to make sure value is valid XML //need to make sure value is valid XML
String value = makeXMLcompliant(fi.constantLiteralValue()); String value = makeXMLcompliant(fi.constantLiteralValue());
String fullTypeName = makeXMLcompliant(fi.type().qualifiedTypeName())
+ fi.type().dimension();
xmlWriter.println("<field name=\"" + fi.name() +"\"\n" xmlWriter.println("<field name=\"" + fi.name() +"\"\n"
+ " type=\"" + fi.type().qualifiedTypeName() + "\"\n" + " type=\"" + fullTypeName + "\"\n"
+ " transient=\"" + fi.isTransient() + "\"\n" + " transient=\"" + fi.isTransient() + "\"\n"
+ " volatile=\"" + fi.isVolatile() + "\"\n" + " volatile=\"" + fi.isVolatile() + "\"\n"
+ (fieldIsInitialized(fi) ? " value=\"" + value + "\"\n" : "") + (fieldIsInitialized(fi) ? " value=\"" + value + "\"\n" : "")
@@ -954,5 +974,16 @@ public class Stubs {
returnString = returnString.replaceAll("'", "&pos;"); returnString = returnString.replaceAll("'", "&pos;");
return returnString; return returnString;
} }
static String fullParameterTypeName(MethodInfo method, TypeInfo type, boolean isLast) {
String fullTypeName = type.fullName(method.typeVariables());
if (isLast && method.isVarArgs()) {
// TODO: note that this does not attempt to handle hypothetical
// vararg methods whose last parameter is a list of arrays, e.g.
// "Object[]...".
fullTypeName = type.qualifiedTypeName() + "...";
}
return fullTypeName;
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -1,15 +0,0 @@
<?cs # appears above the blue bar at the top of every page ?>
<?cs def:custom_masthead() ?>
<?cs /def ?>
<?cs # appears in the blue bar at the top of every page ?>
<?cs def:custom_subhead() ?>
<?cs if:android.buglink ?>
<?cs /if ?>
<?cs /def ?>
<?cs # appears on the left side of the blue bar at the bottom of every page ?>
<?cs def:custom_copyright() ?><?cs /def ?>
<?cs def:devdoc_left_nav() ?>
<?cs /def ?>

View File

@@ -1,7 +0,0 @@
template {
which = codesite
extension=.ezt
escape.0.key=[
escape.0.value=[[]
}

View File

@@ -1,6 +0,0 @@
</div><!-- end gc-pagecontent -->
</div><!-- end gooey wrapper -->
[include "/html/_common_page_footer.ezt"]
[include "/android/_build_id.ezt"]
</body>

View File

@@ -1,15 +0,0 @@
[include "/android/_local_variables.ezt"]
[define page_title]<?cs var:page.title ?>[end]
<head>
[include "/html/apis/_common_head_elements.ezt"]
<script src="<?cs var:toroot ?>assets/search_autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="/css/semantic_headers.css" />
<link rel="stylesheet" type="text/css" href="<?cs var:toroot ?>assets/style.css" />
<script>
jQuery(document).ready(function() {
jQuery("pre").addClass("prettyprint");
});
</script>
</head>

View File

@@ -1,14 +0,0 @@
[#] <body class="gc-documentation">
[#]
[#] [include "/html/_common_page_header.ezt"]
[#] <div class="g-section g-tpl-180">
[#]
[#] <a name="gc-toc-anchor"></a>
[#] <div class="g-unit g-first" id="gc-toc">
[#] [include toc_path]
[#] </div>
[#]
[#] <a name="gc-pagecontent-anchor"></a>
[#] <div class="g-unit" id="gc-pagecontent">

View File

@@ -1,29 +0,0 @@
<?cs # appears above the blue bar at the top of every page ?>
<?cs def:custom_masthead() ?>
<?cs /def ?>
<?cs # appears in the blue bar at the top of every page ?>
<?cs def:custom_subhead() ?>SDK Documentation<?cs /def ?>
<?cs # appears on the left side of the blue bar at the bottom of every page ?>
<?cs def:custom_copyright() ?>Copyright 2007 XXX<?cs /def ?>
<?cs # appears on the right side of the blue bar at the bottom of every page ?>
<?cs def:custom_buildinfo() ?>Built <?cs var:page.now ?><?cs /def ?>
<?cs def:custom_left_nav() ?>
<ul>
<li><a href="<?cs var:toroot ?>documentation.html">Main Page</a></li>
<li><a href="<?cs var:toroot ?>reference/packages.html">Package Index</a></li>
<li><a href="<?cs var:toroot ?>reference/classes.html">Class Index</a></li>
<li><a href="<?cs var:toroot ?>reference/hierarchy.html">Class Hierarchy</a></li>
<li><a href="<?cs var:toroot ?>reference/keywords.html">Index</a></li>
</ul>
<?cs /def ?>
<?cs def:devdoc_left_nav() ?>
<div id="devdoc-nav">
<?cs include:"devdoc-nav.cs" ?>
</div>
<?cs /def ?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -1,36 +0,0 @@
<?cs # appears above the blue bar at the top of every page ?>
<?cs def:custom_masthead() ?>
</div>
<?cs /def ?>
<?cs # appears in the blue bar at the top of every page ?>
<?cs def:custom_subhead() ?>
<?cs if:android.buglink ?>
<?cs /if ?>
<?cs /def ?>
<?cs # appears on the left side of the blue bar at the bottom of every page ?>
<?cs def:custom_copyright() ?><?cs /def ?>
<?cs # appears on the right side of the blue bar at the bottom of every page ?>
<?cs def:custom_buildinfo() ?>Build <?cs var:page.build ?> - <?cs var:page.now ?><?cs /def ?>
<?cs def:list(label, classes) ?>
<?cs if:subcount(classes) ?>
<h2><?cs var:label ?></h2>
<ul>
<?cs each:cl=classes ?>
<li><?cs call:type_link(cl) ?></li>
<?cs /each ?>
</ul>
<?cs /if ?>
<?cs /def ?>
<?cs def:custom_left_nav() ?>
<?cs /def ?>
<?cs def:devdoc_left_nav() ?>
<?cs /def ?>

View File

@@ -1,4 +0,0 @@
template {
which = normal
}

View File

@@ -0,0 +1,90 @@
<?cs # This default template file is meant to be replaced. ?>
<?cs # Use the -tempatedir arg to javadoc to set your own directory with a replacement for this file in it. ?>
<?cs def:custom_masthead() ?>
<div id="header">
<div id="headerLeft">
<a href="<?cs var:toroot ?>index.html" tabindex="-1"><img
src="<?cs var:toroot ?>assets/images/bg_logo.jpg" /></a>
</div>
<div id="headerRight">
<div id="headerLinks" align="right">
<img src="<?cs var:toroot ?>assets/images/icon_world.jpg"><span class="text">&nbsp;<a href="#">English</a> | <a href="http://www.android.com">Android.com</a></span>
</div>
<?cs call:default_search_box() ?>
<ul class="<?cs
if:reference ?>reference<?cs
elif:guide ?>guide<?cs
elif:sdk ?>sdk<?cs
elif:home ?>home<?cs
elif:community ?>community<?cs
elif:publish ?>publish<?cs
elif:about ?>about<?cs /if ?>">
<?cs if:android.whichdoc == "online" ?>
<li id="home-link"><a href="<?cs var:toroot ?>index.html"><span>Home</span></a></li>
<?cs /if ?>
<li id="sdk-link"><a href="<?cs var:toroot ?>sdk/index.html"><span>SDK</span></a></li>
<li id="guide-link"><a href="<?cs var:toroot ?>guide/index.html"
onClick="return loadLast('guide')"><span>Dev Guide</span></a></li>
<li id="reference-link"><a href="<?cs var:toroot ?>reference/packages.html"
onClick="return loadLast('reference')"><span>Reference</span></a></li>
<li><a href="http://android-developers.blogspot.com"><span>Blog</span></a></li>
<li id="community-link"><a href="<?cs var:toroot ?>community/index.html"><span>Community</span></a></li>
</ul>
</div><!-- headerRight -->
</div><!-- header -->
<?cs /def ?><?cs # custom_masthead ?>
<?cs def:sdk_nav() ?>
<div class="g-section g-tpl-180" id="body-content">
<div class="g-unit g-first" id="side-nav">
<div id="devdoc-nav">
<?cs include:"../../../java/android/html/sdk/sdk_toc.cs" ?>
</div>
</div> <!-- end side-nav -->
<?cs /def ?>
<?cs def:guide_nav() ?>
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="devdoc-nav">
<?cs include:"../../../java/android/html/guide/guide_toc.cs" ?>
</div>
</div> <!-- end side-nav -->
<script>
addLoadEvent(function() {
scrollIntoView("devdoc-nav");
});
</script>
<?cs /def ?>
<?cs def:publish_nav() ?>
<div class="g-section g-tpl-180" id="body-content">
<div class="g-unit g-first" id="side-nav">
<div id="devdoc-nav">
<?cs include:"../../../java/android/html/publish/publish_toc.cs" ?>
</div>
</div> <!-- end side-nav -->
<?cs /def ?>
<?cs def:custom_left_nav() ?>
<?cs if:guide ?>
<?cs call:guide_nav() ?>
<?cs elif:publish ?>
<?cs call:publish_nav() ?>
<?cs elif:sdk ?>
<?cs call:sdk_nav() ?>
<?cs else ?>
<?cs call:default_left_nav() ?>
<?cs /if ?>
<?cs /def ?>
<?cs # appears on the left side of the blue bar at the bottom of every page ?>
<?cs def:custom_copyright() ?>Copyright 2008 <a href="http://source.android.com/">The Android Open Source Project</a><?cs /def ?>
<?cs # appears on the right side of the blue bar at the bottom of every page ?>
<?cs def:custom_buildinfo() ?>Build <?cs var:page.build ?> - <?cs var:page.now ?><?cs /def ?>

View File

@@ -10,7 +10,7 @@
<div class="g-unit" id="doc-content" > <div class="g-unit" id="doc-content" >
<div id="jd-content" style="min-width:820px"> <div id="jd-content" style="min-width:870px">
<h1><?cs var:sdk.version ?></h1> <h1><?cs var:sdk.version ?></h1>
<p><em> <p><em>
@@ -18,20 +18,20 @@
<a href="RELEASENOTES.html">Release Notes</a> <a href="RELEASENOTES.html">Release Notes</a>
</em></p> </em></p>
<div class="sidebox-wrapper" style="width:250px"> <div id="qv-wrapper">
<div class="sidebox-inner"> <div id="qv">
<h2>Get Started</h2> <h2>Get Started</h2>
<p><a href="requirements.html">System and Sofware Requirements &rarr;</a></p> <p><a href="requirements.html">System and Sofware Requirements</a></p>
<p><a href="installing.html">Guide to Installing the SDK &rarr;</a></p> <p><a href="installing.html">Guide to Installing the SDK</a></p>
<h2>Upgrade</h2> <h2>Upgrade</h2>
<p><a href="upgrading.html">Upgrading the SDK &rarr;</a></p> <p><a href="upgrading.html">Upgrading the SDK</a></p>
<p><a href="">API changes overview &rarr;</a></p> <p><a href="migrating/changes-overview.html">API changes overview</a></p>
<p><a href="">API differences report &rarr;</a></p> <p><a href="migrating/changes.html">API differences report</a></p>
<h2>Using Eclipse?</h2> <h2>Using Eclipse?</h2>
<p>Android provides an Eclipse plugin to help make programming and debugging easier.</p> <p>Android provides an Eclipse plugin to help make programming and debugging easier.</p>
<p><a href="">Install Eclipse plugin &rarr;</a></p> <p><a href="<?cs var:toroot ?>guide/developing/tools/adt.html">Install Eclipse plugin</a></p>
</div> </div>
</div> </div>

View File

@@ -4,12 +4,23 @@
info: core developer styles (developer.android.com) info: core developer styles (developer.android.com)
*/ */
@import url("http://www.google.com/css/goog.css");
@import url("http://www.google.com/css/inlay.css"); /* RESET STYLES */
html,body,div,h1,h2,h3,h4,h5,h6,p,img,
dl,dt,dd,ol,ul,li,table,caption,tbody,
tfoot,thead,tr,th,td,form,fieldset,
embed,object,applet {
margin: 0;
padding: 0;
border: 0;
}
/* BASICS */ /* BASICS */
body { body {
font-family:arial,sans-serif;
color:#000;
font-size:13px; font-size:13px;
color:#333; color:#333;
overflow:hidden; overflow:hidden;
@@ -19,17 +30,47 @@ body {
background-repeat:repeat-x; background-repeat:repeat-x;
} }
a, a code {
color:#00c;
}
a:active,
a:active code {
color:#f00;
}
a:visited,
a:visited code {
color:#551a8b;
}
input, select,
textarea, option {
font-family:inherit;
font-size:inherit;
}
p {
padding:0;
margin:0 0 1em;
}
code, pre { code, pre {
color:#007000; color:#007000;
font-family:monospace; font-family:monospace;
line-height:1em; line-height:1em;
} }
var {
color:#007000;
font-style:italic;
}
pre { pre {
border:1px solid #5B7957; border:1px solid #ccc;
background-color:#fafafa; background-color:#fafafa;
padding:10px; padding:10px;
margin:0 0 1em; margin:0 0 1em 1em;
overflow:auto; overflow:auto;
} }
@@ -43,55 +84,66 @@ p,ul,ol,dl,dd,dt,li {
} }
ul,ol { ul,ol {
margin:0; margin:0 0 .8em;
padding:0 0 1em 2em; padding:0 0 0 2em;
}
dl {
margin:0;
padding:0;
}
dt {
font-weight:bold;
margin:0;
padding:0 0 .5em;
}
dd {
font-weight:normal;
margin:0;
padding:0 0 .5em 1em;
}
li p, li pre, li table, li img,
dd p, dd pre, dd table, dd img {
margin:.5em 0 0;
} }
li { li {
padding:0 0 .5em; padding:0 0 .5em;
} }
dl {
margin:0 0 1em 0;
padding:0;
}
dt {
margin:0;
padding:0;
}
dd {
margin:0 0 1em;
padding:0 0 0 2em;
}
li p, dd p {
margin:1em 0 0;
}
li pre, li table, li img,
dd pre, dd table, dd img {
margin:1em 0 0 1em;
}
li ul, li ul,
li ol { li ol {
padding: .5em 0 0 2em; margin:.5em 0 0 0;
padding: 0 0 0 2em;
} }
dl dl { dl li {
padding:.5em 0 0; padding:.5em 0 0 0;
} }
li p { dl dl,
ol dl,
ul dl {
margin:0 0 1em;
padding:0; padding:0;
} }
table { table {
font-size:1em;
margin:0 0 1em; margin:0 0 1em;
padding:0;
border-collapse:collapse;
border-width:0;
empty-cells:show;
} }
td,th { td,th {
border:1px solid #666; border:1px solid #ccc;
padding:6px 12px; padding:6px 12px;
text-align:left; text-align:left;
vertical-align:top; vertical-align:top;
@@ -99,17 +151,7 @@ td,th {
} }
th { th {
background-color:#ccc; background-color:#dee8f1;
}
a code {
color:#00c;
}
a:active code {
color:#f00;
}
a:visited code {
color:#551a8b;
} }
hr.blue { hr.blue {
@@ -124,6 +166,7 @@ hr.blue {
margin:0; margin:0;
position:fixed; position:fixed;
top:103px; top:103px;
width:100%;
} }
#header { #header {
@@ -131,25 +174,21 @@ hr.blue {
height: 100px; height: 100px;
position:relative; position:relative;
z-index:100; z-index:100;
min-width:730px; min-width:620px;
}
#header img {
padding:0;
} }
#headerLeft{ #headerLeft{
float:left; position:absolute;
border:none; border:none;
width:1px;
margin:20px 0 0 10px; margin:20px 0 0 10px;
overflow:visible; overflow:visible;
font-size: 36px;
} }
#headerRight { #headerRight {
float:right; float:right;
border:none; border:none;
width:715px; width:615px;
height:100px; height:100px;
} }
@@ -162,10 +201,11 @@ hr.blue {
height: 32px; height: 32px;
position:absolute; position:absolute;
bottom:0; bottom:0;
right:0;
} }
#header li { #header li {
float: right; float: left;
margin: 0px 5px 0px 0px; margin: 0px 5px 0px 0px;
padding:0; padding:0;
} }
@@ -180,9 +220,8 @@ hr.blue {
font-weight: normal; font-weight: normal;
width: 96px; width: 96px;
height: 32px; height: 32px;
padding-top: 9px;
text-align: center; text-align: center;
margin: 0px 0px 0px 0px; margin: 0px;
} }
#header li a:hover { #header li a:hover {
@@ -191,18 +230,34 @@ hr.blue {
color: #fff; color: #fff;
} }
#header li a span {
position:relative;
top:9px;
}
/* TAB HIGHLIGHTING */ /* TAB HIGHLIGHTING */
.home #home-link, .home #home-link a,
.publish #publish-link, .publish #publish-link a,
.guide #guide-link, .guide #guide-link a,
.reference #reference-link, .reference #reference-link a,
.sdk #sdk-link, .sdk #sdk-link a,
.community #community-link, .community #community-link a,
.about #about-link { .about #about-link a {
background-image: url(images/tab_selected.png); background-image: url(images/tab_selected.png);
background-repeat: no-repeat; background-repeat: no-repeat;
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
cursor:default;
}
.home #home-link a:hover,
.publish #publish-link a:hover,
.guide #guide-link a:hover,
.reference #reference-link a:hover,
.sdk #sdk-link a:hover,
.community #community-link a:hover,
.about #about-link a:hover {
background-image: url(images/tab_selected.png);
} }
#headerLinks { #headerLinks {
@@ -234,10 +289,9 @@ hr.blue {
/* main */ /* main */
#mainBodyFixed { #mainBodyFixed {
float: left; margin: 20px auto;
margin: 20px;
color: #333; color: #333;
min-width:920px; width:920px;
} }
#mainBodyFixed h3 { #mainBodyFixed h3 {
@@ -254,7 +308,14 @@ hr.blue {
padding-bottom:.5em; padding-bottom:.5em;
} }
#mainBodyFixed .green { #mainBodyFixed h1 {
color:#435A6E;
font-size:1.7em;
margin: 1em 0;
}
#mainBodyFixed .green,
#jd-content .green {
color:#7BB026; color:#7BB026;
background-color:none; background-color:none;
} }
@@ -322,7 +383,7 @@ div.indent {
text-align:left; text-align:left;
} }
#mainBodyRight td.blueBorderBox { #mainBodyRight .blueBorderBox {
border:5px solid #ddf0f2; border:5px solid #ddf0f2;
padding:18px 18px 18px 18px; padding:18px 18px 18px 18px;
text-align:left; text-align:left;
@@ -389,28 +450,25 @@ div.indent {
} }
.groupTable { .groupTable {
width: 95%; width: 100%;
} }
.groupTable th { .groupTable th {
padding: 10px 20px 10px 20px; padding: 10px;
color: #ffffff; color: #ffffff;
background-color: #6D8293; background-color: #6D8293;
border: 2px solid #fff; border: 2px solid #fff;
} }
.groupTable .oddRow td { .groupTable td {
padding: 20px 28px 20px 28px; padding: 10px;
color: #333333; color: #333333;
background-color: #d9d9d9; background-color: #d9d9d9;
border: 2px solid #fff; border: 2px solid #fff;
} }
.groupTable .evenRow td { .groupTable .evenRow td {
padding: 20px 28px 20px 28px;
color: #333333;
background-color: #ededed; background-color: #ededed;
border: 2px solid #fff;
} }
span.BigBlue { span.BigBlue {
@@ -496,7 +554,7 @@ vertical-align: bottom;
color:#0000cc; color:#0000cc;
} }
#search_filtered .jd-selected { #search_filtered .jd-selected {
background-color: #7BB026; background-color: #A4C639;
cursor:pointer; cursor:pointer;
} }
#search_filtered .jd-selected, #search_filtered .jd-selected,
@@ -514,10 +572,10 @@ vertical-align: bottom;
padding-right: 6px; padding-right: 6px;
padding-top: 1px; padding-top: 1px;
padding-bottom: 1px; padding-bottom: 1px;
font-size: 80%; font-size: .8em;
border: none; border: none;
margin: 0; margin: 0;
line-height: 105%; line-height: 1.05em;
} }
.show-row { .show-row {
@@ -608,7 +666,7 @@ input.gsc-input {
border:1px solid #BCCDF0; border:1px solid #BCCDF0;
width:99%; width:99%;
padding-left:2px; padding-left:2px;
font-size:95%; font-size:.95em;
} }
td.gsc-search-button { td.gsc-search-button {
@@ -721,17 +779,19 @@ div#app-list {
#app-list img { #app-list img {
width:90px; width:90px;
height:70px; height:70px;
padding:0; margin:0;
} }
#app-list a.selected, #app-list a.selected,
.app-list a:active.selected, #app-list a:active.selected,
.app-list a:hover.selected { #app-list a:hover.selected {
background:#A4C639; background:#A4C639;
color:#fff; color:#fff;
cursor:default;
text-decoration:none;
} }
#app-list a:hover, #app-list a:hover,
.app-list a:active { #app-list a:active {
background:#ff9900; background:#ff9900;
text-decoration:underline; text-decoration:underline;
} }
@@ -751,7 +811,7 @@ div#app-list {
} }
#carouselMain img { #carouselMain img {
padding:0; margin:0;
} }
/*carousel bulletin layouts*/ /*carousel bulletin layouts*/
@@ -792,3 +852,4 @@ div#app-list {
} }

View File

@@ -0,0 +1,19 @@
@import url("android-developer-docs.css");
/* Page title */
#jd-header h1 {
padding: 8px 0 0 0;
}
/* Page content container */
#jd-header table {
margin: 0 0 1em 1em;
}
#jd-content table table,
#jd-content table img {
margin:1em 0;
}

View File

@@ -15,7 +15,7 @@
color:#336666; color:#336666;
margin:0; margin:0;
padding: 5px 10px; padding: 5px 10px;
font-size: 100%; font-size: 1em;
line-height: 15px; line-height: 15px;
} }
@@ -26,29 +26,23 @@
padding:0 0 0 15px; padding:0 0 0 15px;
} }
#crumb {
font-size:95%;
padding:5px 20px;
float:right;
color:#336666;
}
/* SIDE NAVIGATION */ /* SIDE NAVIGATION */
#side-nav { #side-nav {
padding:0 6px 0 0; padding:0 6px 0 0;
background-color: #fff; background-color: #fff;
font-size:12px;
} }
#resize-packages-nav { #resize-packages-nav {
/* keeps the resize handle below the h-scroll handle */ /* keeps the resize handle below the h-scroll handle */
height:200px; height:270px;
overflow:hidden; overflow:hidden;
max-height:100%; max-height:100%;
} }
#packages-nav { #packages-nav {
height:200px; height:270px;
max-height:inherit; max-height:inherit;
position:relative; position:relative;
overflow:auto; overflow:auto;
@@ -57,6 +51,7 @@
#classes-nav, #classes-nav,
#devdoc-nav { #devdoc-nav {
overflow:auto; overflow:auto;
position:relative;
} }
#side-nav ul { #side-nav ul {
@@ -66,25 +61,30 @@
} }
#side-nav ul ul { #side-nav ul ul {
margin: 0; margin: .35em 0 0 0;
padding: 0; padding: 0;
} }
#side-nav li { #side-nav li {
padding: 1px 0 2px 0; padding:0;
line-height:1.1em; line-height:16px;
white-space:nowrap; white-space:nowrap;
} }
#side-nav li h2 { #side-nav li h2 {
font-size: 100%; font-size:12px;
font-weight: bold; font-weight: bold;
margin: 0; margin:.5em 0 0 0;
padding: 8px 0 0 10px; padding: 3px 0 1px 9px;
} }
#side-nav li a { #side-nav li a {
padding: 0 0 0 11px; text-decoration:none;
padding: 0 0 0 18px;
}
#side-nav li a:hover {
text-decoration:underline;
} }
#side-nav li a+a { #side-nav li a+a {
@@ -93,23 +93,55 @@
#side-nav li li li a { #side-nav li li li a {
/*sdk lists*/ /*sdk lists*/
padding: 0 0 0 25px; padding: 0 0 0 28px;
} }
#side-nav .selected { #side-nav .selected {
background-color: #97a2ac; background-color: #435a6e;
color: #fff; color: #fff;
font-weight:bold; font-weight:bold;
} }
#side-nav .selected a { #side-nav .selected a {
color: #fff; color: #fff;
text-decoration:none;
} }
#side-nav strong { #side-nav strong {
display:block; display:block;
} }
#side-nav .toggle-img {
margin:0;
padding:0;
position:absolute;
top:0;
left:0;
height:16px;
width:15px;
outline-style:none;
}
#side-nav .closed .toggle-img {
background:url('images/triangle-closed-small.png') 7px 4px no-repeat;
}
#side-nav .open .toggle-img {
background:url('images/triangle-opened-small.png') 7px 4px no-repeat;
}
#side-nav .toggle-list {
position:relative;
}
#side-nav .toggle-list ul {
margin:0;
display:none;
}
#side-nav .toggle-list div {
display:block;
}
#index-links .selected { #index-links .selected {
background-color: #fff; background-color: #fff;
color: #000; color: #000;
@@ -121,6 +153,53 @@
padding:7px 0 4px 10px; padding:7px 0 4px 10px;
} }
/* nav tree */
#nav-tree ul {
padding:5px 0 1.5em;
}
#side-nav #nav-tree ul li a,
#side-nav #nav-tree ul li span.no-children {
padding: 0 0 0 0;
margin: 0;
}
#nav-tree .plus {
margin: 0 3px 0 0;
}
#nav-tree ul ul {
list-style: none;
margin: 0;
padding: 0 0 0 0;
}
#nav-tree ul li {
margin: 0;
padding: 0 0 0 0;
white-space: nowrap;
}
#nav-tree .children_ul {
margin:0;
}
#nav-tree a.nolink {
color: black;
text-decoration: none;
}
#nav-tree span.label {
width: 100%;
}
#nav-tree {
overflow-x: auto;
overflow-y: scroll;
}
/* DOCUMENT BODY */ /* DOCUMENT BODY */
#doc-content { #doc-content {
@@ -128,13 +207,29 @@
} }
#jd-header { #jd-header {
background-color: #9bb0c3; background-color: #E9E9E9;
padding: 10px 20px; padding: 7px 20px;
} }
#jd-header h1 { #jd-header h1 {
margin: 0 0 10px; margin: 0 0 10px;
font-size:160%; font-size:1.7em;
}
#jd-header .crumb {
font-size:.9em;
line-height:1em;
color:#777;
}
#jd-header .crumb a,
#jd-header .crumb a:visited {
text-decoration:none;
color:#777;
}
#jd-header .crumb a:hover {
text-decoration:underline;
} }
#jd-header table { #jd-header table {
@@ -148,13 +243,22 @@
vertical-align:top; vertical-align:top;
} }
#jd-header.guide-header {
background-color:#fff;
color:#435a6e;
height:50px;
}
#jd-descr {
position:relative;
}
/* inheritance table */ /* inheritance table */
.jd-inheritance-table { .jd-inheritance-table {
border-spacing:0; border-spacing:0;
margin:0; margin:0;
padding:0; padding:0;
font-size:90%; font-size:.9em;
} }
.jd-inheritance-table td { .jd-inheritance-table td {
border: none; border: none;
@@ -170,7 +274,7 @@
} }
#jd-content { #jd-content {
padding: 12px 20px; padding: 18px 20px;
} }
hr { hr {
@@ -181,51 +285,60 @@ hr {
#jd-content h1 { #jd-content h1 {
/*sdk page*/ /*sdk page*/
font-size:160%; font-size:1.6em;
color:#336666; color:#336666;
margin:0 0 .5em; margin:0 0 .5em;
} }
#jd-content h2 { #jd-content h2 {
font-size:140%; font-size:1.45em;
background-color: #97a2ac; color:#111;
border-right:20px solid #97a2ac; border-top:2px solid #ccc;
position:relative; padding: .5em 0 0;
left:-20px; margin: 1.75em 0 1em 0;
width:100%; max-width:968px;
padding: 8px 0 8px 20px;
z-index:-1;
} }
#jd-content h3 { #jd-content h3 {
font-size:130%; font-size:1.2em;
border-top: 3px solid #97a2ac; color:#222;
padding:3px 0 5px; padding: .75em 0 .65em 0;
margin:0;
} }
#jd-content h4 { #jd-content h4 {
font-size:110%; font-size:1.1em;
margin-bottom:.5em; margin-bottom:.5em;
color:#222;
} }
img { #jd-content .small-header {
padding:0 0 1em 0; font-size:1em;
color:#000;
font-weight:bold;
border:none;
padding:0;
margin:1em 0 .5em;
position:inherit;
}
#jd-content img {
margin: 0 0 1em 1em;
} }
#jd-content li img, #jd-content li img,
#jd-content dd img { #jd-content dd img {
margin:.5em 0 0; margin:.5em 0 0 1em;
padding:0;
} }
.nolist { .nolist {
list-style:none; list-style:none;
padding:0 0 1em; padding:0;
margin:0 0 0 1em; margin:0 0 1em 1em;
} }
h4 .normal { h4 .normal {
font-size:90%; font-size:.9em;
font-weight:normal; font-weight:normal;
} }
@@ -244,7 +357,7 @@ h4 .normal {
} }
h4.jd-details-title { h4.jd-details-title {
font-size:115%; font-size:1.15em;
background-color: #d6d6d6; background-color: #d6d6d6;
margin:0 0 .6em; margin:0 0 .6em;
padding:3px; padding:3px;
@@ -275,43 +388,9 @@ h4.jd-tagtitle {
font-style:italic; font-style:italic;
} }
.sidebox-wrapper {
float: right;
width:300px;
background-color:#fff;
padding-left:15px;
}
.sidebox-inner {
border-left:2px solid #7BB026;
padding:0 5px 0 15px;
}
.sidebox {
float: right;
width:300px;
background-color:#fff;
border-left:2px solid #7BB026;
margin-left:15px;
padding:0 5px 0 15px;
}
#jd-content .sidebox h2,
#jd-content .sidebox h3,
#jd-content .sidebox-inner h2,
#jd-content .sidebox-inner h3 {
background-color:#fff;
border:none;
font-size:110%;
margin:0;
padding:0 0 10px;
left:0;
z-index:0;
}
#jd-content table h2 { #jd-content table h2 {
background-color: #d6d6d6; background-color: #d6d6d6;
font-size: 110%; font-size: 1.1em;
margin:0 0 10px; margin:0 0 10px;
padding:5px; padding:5px;
left:0; left:0;
@@ -319,25 +398,46 @@ h4.jd-tagtitle {
} }
div.special { div.special {
padding: 10px 25px 0; padding: 15px 20px 3px;
margin: 0 0 1em; margin: 0 0 1em;
background-color: #ddf0f2; background-color: #ddf0f2;
} }
div.special p {
margin: .25em 0;
}
div.special ol {
margin: 0;
}
div.special ol li {
margin: 0;
padding: 0;
}
#jd-content div.special h2,
#jd-content div.special h3 { #jd-content div.special h3 {
color:#669999; color:#669999;
font-size:120%; font-size:1.2em;
border:none; border:none;
margin:0 0 .5em; margin:0 0 .5em;
padding:0;
} }
p.note, p.caution, p.warning { /* old p.note, p.caution, p.warning {
margin:0 0 1em; margin:0 0 1em;
padding: 4px 10px; padding: 4px 10px;
background-color: #efefef; background-color: #efefef;
border-top: 1px solid; border-top: 1px solid;
border-bottom: 1px solid; border-bottom: 1px solid;
} }
*/
p.note, p.caution, p.warning {
margin: 1em;
padding: 0 0 0 .5em;
border-left: 4px solid;
}
p.special-note { p.special-note {
background-color:#EBF3DB; background-color:#EBF3DB;
@@ -346,7 +446,7 @@ p.special-note {
} }
p.note { p.note {
border-color: #3366CC; border-color: #99aacc;
} }
p.caution { p.caution {
@@ -369,37 +469,208 @@ li p.note, li p.warning, li p.caution {
dl.xml dt { dl.xml dt {
font-variant:small-caps; font-variant:small-caps;
font-size:1.2em;
}
dl.xml dl {
padding:0;
}
dl.xml dl dt {
font-variant:normal;
font-size:1em;
}
.listhead li {
font-weight: bold;
}
.listhead li *, /*ie*/.listhead li li {
font-weight: normal;
}
ol.no-style,
ul.no-style {
list-style:none;
padding-left:1em;
} }
.new { .new {
font-size: 78%; font-size: .78em;
font-weight: bold; font-weight: bold;
color: red; color: red;
text-decoration: none; text-decoration: none;
} }
pre.classic {
background-color:transparent;
border:none;
padding:0;
}
/* BEGIN quickview sidebar element styles */
#qv-wrapper {
float: right;
position:relative;
width:315px;
background-color:#fff;
padding:4px 30px 15px 20px;
top:-55px;
left:20px;
}
#qv {
background-color:#fff;
border:4px solid #dee8f1;
margin:0 0 0 15px;
padding:0 6px 6px;
margin-top:0px;
width:295;
float:right;
}
#qv ol {
list-style:none;
padding: 0;
}
#qv ol ol{
list-style:none;
padding: 0 0 3px 12px;
margin:0;
}
#qv ul {
padding: 0 10px 0 2em;
}
#qv li {
padding: 0 10px;
margin: 2 0 0;
line-height: 1.2em;
}
#qv ul li {
padding: 0 10px 0 0;
}
#qv li.selected a {
color:#555;
text-decoration:none;
}
#qv a {
color:#cc6600;
}
#qv p {
margin:8px 0 0;
padding:0 10px;
}
#qv-extra #rule {
padding: 0 10px;
margin: 0;
}
#qv-sub-rule {
padding: 6px 20px;
margin: 0;
}
#qv-sub-rule p {
margin: 0;
}
#jd-content #qv h2 {
font-size:1.05em;
font-weight:bold;
margin:12px 0 .25em 0;
padding:0 10px;
background-color:transparent;
color:#7BB026;
border:none;
left:0;
z-index:1;
}
/* END quickview sidebar element styles */
/* Begin sidebox sidebar element styles */
.sidebox-wrapper {
float: right;
width:300px;
background-color:#fff;
margin: 0 0 0 15px;
padding: 5px 0 5px 15px;
}
.sidebox-inner {
border-left:1px solid #dee8f1;
background-color:#ffffee;
padding:0 5px 0 15px;
}
.sidebox {
float: right;
width:285px;
background-color:#ffffee;
border-left:1px solid #dee8f1;
margin: 0 0 0 15px;
padding:5px 8px 0 12px;
}
#jd-content .sidebox h2,
#jd-content .sidebox h3,
#jd-content .sidebox-inner h2,
#jd-content .sidebox-inner h3 {
border:none;
font-size:1em;
margin:0;
padding:4px 0 4px;
left:0;
z-index:0;
}
.sidebox hr,
.sidebox-inner hr {
background-color:#ccc;
border:none;
}
/* End sidebox sidebar element styles */
/* table of contents */ /* table of contents */
ol.toc { ol.toc {
margin: 1em 0 0 0; margin: 0 0 1em 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
font-size:95%;
} }
ol.toc li { ol.toc li {
font-weight: bold; font-weight: bold;
margin: .5em 0 0 1.5em; margin: 0 0 .5em 1em;
padding: 0; padding: 0;
} }
ol.toc li p {
font-weight: normal;
}
ol.toc li ol { ol.toc li ol {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ol.toc li ol li { ol.toc li li {
padding: 0; padding: 0;
margin: .1em 0 0 1em; margin: 0 0 0 1em;
font-weight: normal; font-weight: normal;
list-style: none; list-style: none;
} }
@@ -458,8 +729,8 @@ tr.alt-color {
} }
/* expando trigger */ /* expando trigger */
.jd-expando-trigger { #jd-content .jd-expando-trigger {
padding:0; margin:0;
} }
/* jd-expando */ /* jd-expando */
@@ -487,7 +758,7 @@ table.download th {
color:#fff; color:#fff;
} }
/* INLAY 240PX EXTENSION */ /* INLAY 180 COPY and 240PX EXTENSION */
/* modified to 43px so that all browsers eliminate the package panel h-scroll */ /* modified to 43px so that all browsers eliminate the package panel h-scroll */
.g-tpl-240 .g-unit, .g-tpl-240 .g-unit,
.g-unit .g-tpl-240 .g-unit, .g-unit .g-tpl-240 .g-unit,
@@ -523,10 +794,45 @@ table.download th {
float: right; float: right;
} }
/* 180px */
.g-tpl-180 .g-unit,
.g-unit .g-tpl-180 .g-unit,
.g-unit .g-unit .g-tpl-180 .g-unit {
display: block;
margin: 0 0 0 180px;
width: auto;
float: none;
}
.g-unit .g-unit .g-tpl-180 .g-first,
.g-unit .g-tpl-180 .g-first,
.g-tpl-180 .g-first {
display: block;
margin: 0;
width: 180px;
float: left;
}
/* 180px alt */
.g-tpl-180-alt .g-unit,
.g-unit .g-tpl-180-alt .g-unit,
.g-unit .g-unit .g-tpl-180-alt .g-unit {
display: block;
margin: 0 180px 0 0;
width: auto;
float: none;
}
.g-unit .g-unit .g-tpl-180-alt .g-first,
.g-unit .g-tpl-180-alt .g-first,
.g-tpl-180-alt .g-first {
display: block;
margin: 0;
width: 180px;
float: right;
}
/* JQUERY RESIZABLE STYLES */ /* JQUERY RESIZABLE STYLES */
.ui-resizable { position: relative; } .ui-resizable { position: relative; }
.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; } .ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; z-index:1; }
.ui-resizable .ui-resizable-handle { display: block; } .ui-resizable .ui-resizable-handle { display: block; }
body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
@@ -538,24 +844,50 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body
body { body {
overflow:visible; overflow:visible;
} }
#header {
height:60px;
}
#headerLeft {
margin:0;
}
#headerRight {
display:none;
}
#body-content {
position:inherit;
}
#side-nav { #side-nav {
display:none; display:none;
} }
#doc-content { #doc-content {
margin-left:0; margin-left:0 !important;
height:auto; height:auto !important;
width:auto; width:auto !important;
overflow:inherit;
display:inline;
} }
#jd-header { #jd-header {
border-bottom:3px solid #9bb0c3; padding:10px 0;
} }
#jd-content h2 { #jd-content {
border-top:2px solid #97a2ac; padding:15px 0 0;
border-bottom:2px solid #97a2ac; }
#footer {
float:none;
margin:2em 0 0;
}
h4.jd-details-title {
border-bottom:1px solid #666;
} }
pre { pre {
@@ -577,4 +909,9 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body
page-break-inside: avoid; page-break-inside: avoid;
} }
#qv,
#qv-wrapper {
display:none;
}
} }

View File

@@ -4,7 +4,12 @@ var devdocNav;
var sidenav; var sidenav;
var content; var content;
var HEADER_HEIGHT = 103; var HEADER_HEIGHT = 103;
var cookie_style = 'android_dev_docs'; var cookie_style = 'android_developer';
var NAV_PREF_TREE = "tree";
var NAV_PREF_PANELS = "panels";
var nav_pref;
var toRoot;
function addLoadEvent(newfun) { function addLoadEvent(newfun) {
var current = window.onload; var current = window.onload;
@@ -21,6 +26,10 @@ function addLoadEvent(newfun) {
addLoadEvent(prepare); addLoadEvent(prepare);
window.onresize = resizeAll; window.onresize = resizeAll;
function setToRoot(root) {
toRoot = root;
}
function restoreWidth(navWidth) { function restoreWidth(navWidth) {
var windowWidth = $(window).width() + "px"; var windowWidth = $(window).width() + "px";
content.css({marginLeft:navWidth, width:parseInt(windowWidth) - parseInt(navWidth) + "px"}); content.css({marginLeft:navWidth, width:parseInt(windowWidth) - parseInt(navWidth) + "px"});
@@ -32,12 +41,15 @@ function restoreWidth(navWidth) {
function restoreHeight(packageHeight) { function restoreHeight(packageHeight) {
var windowHeight = ($(window).height() - HEADER_HEIGHT); var windowHeight = ($(window).height() - HEADER_HEIGHT);
var swapperHeight = windowHeight - 13;
$("#swapper").css({height:swapperHeight + "px"});
sidenav.css({height:windowHeight + "px"}); sidenav.css({height:windowHeight + "px"});
content.css({height:windowHeight + "px"}); content.css({height:windowHeight + "px"});
resizePackagesNav.css({maxHeight:windowHeight + "px", height:packageHeight}); resizePackagesNav.css({maxHeight:swapperHeight + "px", height:packageHeight});
classesNav.css({height:windowHeight - parseInt(packageHeight) + "px"}); classesNav.css({height:swapperHeight - parseInt(packageHeight) + "px"});
$("#packages-nav").css({height:parseInt(packageHeight) - 6 + "px"}); //move 6px to give space for the resize handle $("#packages-nav").css({height:parseInt(packageHeight) - 6 + "px"}); //move 6px to give space for the resize handle
devdocNav.css({height:sidenav.css("height")}); devdocNav.css({height:sidenav.css("height")});
$("#nav-tree").css({height:swapperHeight + "px"});
} }
function getCookie(cookie) { function getCookie(cookie) {
@@ -47,6 +59,9 @@ function getCookie(cookie) {
if (index != -1) { if (index != -1) {
var valStart = index + myCookie.length; var valStart = index + myCookie.length;
var valEnd = document.cookie.indexOf(";", valStart); var valEnd = document.cookie.indexOf(";", valStart);
if (valEnd == -1) {
valEnd = document.cookie.length;
}
var val = document.cookie.substring(valStart, valEnd); var val = document.cookie.substring(valStart, valEnd);
return val; return val;
} }
@@ -54,9 +69,14 @@ function getCookie(cookie) {
return 0; return 0;
} }
function writeCookie(cookie, val) { function writeCookie(cookie, val, path, expiration) {
if (location.href.indexOf("reference") != -1) { if (!val) return;
document.cookie = cookie_style+'_'+cookie+'='+val+'; path=/gae/reference'; if (location.href.indexOf("/reference/") != -1) {
document.cookie = cookie_style+'_reference_'+cookie+'='+ val+'; path=' + toRoot + path +
((expiration) ? '; expires=' + expiration : '');
} else if (location.href.indexOf("/guide/") != -1) {
document.cookie = cookie_style+'_guide_'+cookie+'='+val+'; path=' + toRoot + path +
((expiration) ? '; expires=' + expiration : '');
} }
} }
@@ -68,8 +88,14 @@ function prepare() {
sidenav = $("#side-nav"); sidenav = $("#side-nav");
devdocNav = $("#devdoc-nav"); devdocNav = $("#devdoc-nav");
var cookieWidth = getCookie('width');
var cookieHeight = getCookie('height'); if (location.href.indexOf("/reference/") != -1) {
var cookiePath = "reference_";
} else if (location.href.indexOf("/guide/") != -1) {
var cookiePath = "guide_";
}
var cookieWidth = getCookie(cookiePath+'width');
var cookieHeight = getCookie(cookiePath+'height');
if (cookieWidth) { if (cookieWidth) {
restoreWidth(cookieWidth); restoreWidth(cookieWidth);
} else { } else {
@@ -89,30 +115,43 @@ function prepare() {
function highlightNav(fullPageName) { function highlightNav(fullPageName) {
var lastSlashPos = fullPageName.lastIndexOf("/"); var lastSlashPos = fullPageName.lastIndexOf("/");
var firstSlashPos = fullPageName.indexOf("/",8); // first slash after http:// var firstSlashPos = fullPageName.indexOf("/",8); // first slash after http://
if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (index.html) if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (add 'index.html')
fullPageName = fullPageName + "index.html"; fullPageName = fullPageName + "index.html";
} }
var htmlPos = fullPageName.lastIndexOf(".html", fullPageName.length); var htmlPos = fullPageName.lastIndexOf(".html", fullPageName.length);
var pageName = fullPageName.slice(firstSlashPos, htmlPos + 5); var pathPageName = fullPageName.slice(firstSlashPos, htmlPos + 5);
var link = $("#devdoc-nav a[href$='"+pageName+"']"); var link = $("#devdoc-nav a[href$='"+ pathPageName+"']");
if (link.length == 0) { // if there's no match, maybe the nav url ends in a slash, also if (link.length == 0) { // if there's no match, then the nav url must be the parent dir (ie, this doc isn't listed, so highlight the parent
link = $("#devdoc-nav a[href$='"+pageName.slice(0,pageName.indexOf("index.html"))+"']"); link = $("#devdoc-nav a[href$='"+ pathPageName.slice(0, pathPageName.lastIndexOf("/") + 1)+"']");
} }
link.parent().addClass('selected'); link.parent().addClass('selected');
if (link.parent().parent().is(':hidden')) {
toggle(link.parent().parent().parent(), false);
} else if (link.parent().parent().hasClass('toggle-list')) {
toggle(link.parent().parent(), false);
}
} }
function resizeHeight() { function resizeHeight() {
var windowHeight = ($(window).height() - HEADER_HEIGHT); var windowHeight = ($(window).height() - HEADER_HEIGHT);
var swapperHeight = windowHeight - 13;
$("#swapper").css({height:swapperHeight + "px"});
sidenav.css({height:windowHeight + "px"}); sidenav.css({height:windowHeight + "px"});
content.css({height:windowHeight + "px"}); content.css({height:windowHeight + "px"});
resizePackagesNav.css({maxHeight:windowHeight + "px"}); resizePackagesNav.css({maxHeight:swapperHeight + "px"});
classesNav.css({height:windowHeight - parseInt(resizePackagesNav.css("height")) + "px"}); classesNav.css({height:swapperHeight - parseInt(resizePackagesNav.css("height")) + "px"});
$("#packages-nav").css({height:parseInt(resizePackagesNav.css("height")) - 6 + "px"}); //move 6px for handle $("#packages-nav").css({height:parseInt(resizePackagesNav.css("height")) - 6 + "px"}); //move 6px for handle
devdocNav.css({height:sidenav.css("height")}); devdocNav.css({height:sidenav.css("height")});
writeCookie("height", resizePackagesNav.css("height")); $("#nav-tree").css({height:swapperHeight + "px"});
writeCookie("height", resizePackagesNav.css("height"), "reference/", null);
} }
function resizeWidth() { function resizeWidth() {
if (location.href.indexOf("/reference/") != -1) {
var path = "reference/";
} else if (location.href.indexOf("/guide/") != -1) {
var path = "guide/";
}
var windowWidth = $(window).width() + "px"; var windowWidth = $(window).width() + "px";
if (sidenav.length) { if (sidenav.length) {
var sidenavWidth = sidenav.css("width"); var sidenavWidth = sidenav.css("width");
@@ -123,7 +162,7 @@ function resizeWidth() {
resizePackagesNav.css({width:sidenavWidth}); resizePackagesNav.css({width:sidenavWidth});
classesNav.css({width:sidenavWidth}); classesNav.css({width:sidenavWidth});
$("#packages-nav").css({width:sidenavWidth}); $("#packages-nav").css({width:sidenavWidth});
writeCookie("width", sidenavWidth); writeCookie("width", sidenavWidth, path, null);
} }
function resizeAll() { function resizeAll() {
@@ -131,14 +170,116 @@ function resizeAll() {
resizeWidth(); resizeWidth();
} }
//added to onload when the bottom-left panel is empty function loadLast(cookiePath) {
function maxPackageHeight() { var lastPage = getCookie(cookiePath + "_lastpage");
var windowHeight = resizePackagesNav.css("maxHeight"); if (lastPage) {
resizePackagesNav.css({height:windowHeight}); window.location = lastPage;
$("#packages-nav").css({height:windowHeight}); return false;
}
return true;
} }
$(document).ready(function(){ $(document).ready(function(){
$("#resize-packages-nav").resizable({handles: "s", resize: function(e, ui) { resizeHeight(); } }); $("#resize-packages-nav").resizable({handles: "s", resize: function(e, ui) { resizeHeight(); } });
$(".side-nav-resizable").resizable({handles: "e", resize: function(e, ui) { resizeWidth(); } }); $(".side-nav-resizable").resizable({handles: "e", resize: function(e, ui) { resizeWidth(); } });
}); });
$(window).unload(function(){
var href = location.href;
if (href.indexOf("/reference/") != -1) {
writeCookie("lastpage", href, "", null);
} else if (href.indexOf("/guide/") != -1) {
writeCookie("lastpage", href, "", null);
}
});
function toggle(obj, slide) {
var ul = $("ul", obj);
var li = ul.parent();
if (li.hasClass("closed")) {
if (slide) {
ul.slideDown("fast");
} else {
ul.show();
}
li.removeClass("closed");
li.addClass("open");
$(".toggle-img", li).attr("title", "hide pages");
} else {
ul.slideUp("fast");
li.removeClass("open");
li.addClass("closed");
$(".toggle-img", li).attr("title", "show pages");
}
}
function buildToggleLists() {
$(".toggle-list").each(
function(i) {
$("div", this).append("<a class='toggle-img' href='#' title='show pages' onClick='toggle(this.parentNode.parentNode, true); return false;'></a>");
$(this).addClass("closed");
});
}
function getNavPref() {
var v = getCookie('reference_nav');
if (v != NAV_PREF_TREE) {
v = NAV_PREF_PANELS;
}
return v;
}
function chooseDefaultNav() {
nav_pref = getNavPref();
if (nav_pref == NAV_PREF_TREE) {
$("#nav-panels").toggle();
$("#panel-link").toggle();
$("#nav-tree").toggle();
$("#tree-link").toggle();
}
}
function swapNav() {
if (nav_pref == NAV_PREF_TREE) {
nav_pref = NAV_PREF_PANELS;
} else {
nav_pref = NAV_PREF_TREE;
init_navtree("nav-tree", toRoot, NAVTREE_DATA);
}
var date = new Date();
date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
writeCookie("nav", nav_pref, "reference/", date.toGMTString());
$("#nav-panels").toggle();
$("#panel-link").toggle();
$("#nav-tree").toggle();
$("#tree-link").toggle();
if ($("#nav-tree").is(':visible')) scrollIntoView("nav-tree");
else {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
}
}
function scrollIntoView(nav) {
var navObj = $("#"+nav);
if (navObj.is(':visible')) {
var selected = $(".selected", navObj);
if (selected.length == 0) return;
var scrolling = document.getElementById(nav);
var navHeight = navObj.height();
var offset = selected.position();
if(offset.top > navHeight - 92) {
scrolling.scrollTop = offset.top - navHeight + 92;
}
}
}

584
tools/droiddoc/templates/assets/carousel.js Executable file → Normal file
View File

@@ -1,291 +1,293 @@
/* file: carousel.js /* file: carousel.js
date: oct 2008 date: oct 2008
author: jeremydw,smain author: jeremydw,smain
info: operates the carousel widget for announcements on info: operates the carousel widget for announcements on
the android developers home page. modified from the the android developers home page. modified from the
original market.js from jeremydw. */ original market.js from jeremydw. */
/* -- video switcher -- */ /* -- video switcher -- */
var oldVid = "multi"; // set the default video var oldVid = "multi"; // set the default video
var nowPlayingString = "Now playing:"; var nowPlayingString = "Now playing:";
var assetsRoot = "/gae/assets/"; var assetsRoot = "/assets/";
/* -- app thumbnail switcher -- */ /* -- app thumbnail switcher -- */
var currentDroid; var currentDroid;
var oldDroid; var oldDroid;
// shows a random application // shows a random application
function randomDroid(){ function randomDroid(){
// count the total number of apps // count the total number of apps
var droidListLength = 0; var droidListLength = 0;
for (var k in droidList) for (var k in droidList)
droidListLength++; droidListLength++;
// pick a random app and show it // pick a random app and show it
var j = 0; var j = 0;
var i = Math.floor(droidListLength*Math.random()); var i = Math.floor(droidListLength*Math.random());
for (var x in droidList) { for (var x in droidList) {
if(j++ == i){ if(j++ == i){
currentDroid = x; currentDroid = x;
showPreview(x); showPreview(x);
centerSlide(x); centerSlide(x);
} }
} }
} }
// shows a bulletin, swaps the carousel highlighting // shows a bulletin, swaps the carousel highlighting
function droid(appName){ function droid(appName){
oldDroid = $("#droidlink-"+currentDroid); oldDroid = $("#droidlink-"+currentDroid);
currentDroid = appName; currentDroid = appName;
var droid = droidList[appName]; var droid = droidList[appName];
var layout = droid.layout; var layout = droid.layout;
var imgDiv = document.getElementById("bulletinImg"); var imgDiv = document.getElementById("bulletinImg");
var descDiv = document.getElementById("bulletinDesc"); var descDiv = document.getElementById("bulletinDesc");
if (layout == "imgLeft") { if (layout == "imgLeft") {
imgDiv.className = "img-left"; imgDiv.className = "img-left";
descDiv.className = "desc-right"; descDiv.className = "desc-right";
} else if (layout == "imgTop") { } else if (layout == "imgTop") {
imgDiv.className = "img-top"; imgDiv.className = "img-top";
descDiv.className = "desc-bottom"; descDiv.className = "desc-bottom";
} else if (layout == "imgRight") { } else if (layout == "imgRight") {
imgDiv.className = "img-right"; imgDiv.className = "img-right";
descDiv.className = "desc-left"; descDiv.className = "desc-left";
} }
imgDiv.innerHTML = "<img src='" + assetsRoot + "images/home/" + droid.img + "'>"; imgDiv.innerHTML = "<img src='" + assetsRoot + "images/home/" + droid.img + "'>";
descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc; descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc;
if(oldDroid) if(oldDroid)
oldDroid.removeClass("selected"); oldDroid.removeClass("selected");
$("#droidlink-"+appName).addClass("selected"); $("#droidlink-"+appName).addClass("selected");
} }
// -- * build the carousel based on the droidList * -- // // -- * build the carousel based on the droidList * -- //
function buildCarousel() { function buildCarousel() {
var appList = document.getElementById("app-list"); var appList = document.getElementById("app-list");
for (var x in droidList) { for (var x in droidList) {
var droid = droidList[x]; var droid = droidList[x];
var icon = droid.icon; var icon = droid.icon;
var name = droid.name; var name = droid.name;
var a = document.createElement("a"); var a = document.createElement("a");
var img = document.createElement("img"); var img = document.createElement("img");
var br = document.createElement("br"); var br = document.createElement("br");
var text = document.createTextNode(droid.name); var text = document.createTextNode(droid.name);
a.setAttribute("id", "droidlink-" + x); a.setAttribute("id", "droidlink-" + x);
a.className = x; a.className = x;
a.setAttribute("href", "#"); a.setAttribute("href", "#");
a.onclick = function() { showPreview(this.className); return false; } a.onclick = function() { showPreview(this.className); return false; }
img.setAttribute("src", assetsRoot + "images/home/" + droid.icon); img.setAttribute("src", assetsRoot + "images/home/" + droid.icon);
img.setAttribute("alt", ""); img.setAttribute("alt", "");
a.appendChild(img); a.appendChild(img);
a.appendChild(br); a.appendChild(br);
a.appendChild(text); a.appendChild(text);
appList.appendChild(a); appList.appendChild(a);
} }
} }
// -- * slider * -- // // -- * slider * -- //
// -- dependencies: // -- dependencies:
// (1) div containing slides, (2) a "clip" div to hide the scroller // (1) div containing slides, (2) a "clip" div to hide the scroller
// (3) control arrows // (3) control arrows
// -- * config below * -- // // -- * config below * -- //
var slideCode = droidList; // the dictionary of slides var slideCode = droidList; // the dictionary of slides
var slideList = 'app-list'; // the div containing the slides var slideList = 'app-list'; // the div containing the slides
var arrowRight = 'arrow-right'; // the right control arrow var arrowRight = 'arrow-right'; // the right control arrow
var arrowLeft = 'arrow-left'; // the left control arrow var arrowLeft = 'arrow-left'; // the left control arrow
function showPreview(slideName) { function showPreview(slideName) {
// centerSlide(slideName); // centerSlide(slideName);
droid(slideName); // do this function when slide is clicked if (slideName.indexOf('selected') != -1) {
return false;
} }
droid(slideName); // do this function when slide is clicked
var thumblist = document.getElementById(slideList);// the div containing the slides }
var slideWidth = 144; // width of a slide including all margins, etc. var thumblist = document.getElementById(slideList);// the div containing the slides
var slidesAtOnce = 3; // no. of slides to appear at once (requires odd number to have a centered slide)
var slideWidth = 144; // width of a slide including all margins, etc.
// -- * no editing should be needed below * -- // var slidesAtOnce = 3; // no. of slides to appear at once (requires odd number to have a centered slide)
var originPosition = {}; // -- * no editing should be needed below * -- //
var is_animating = 0;
var currentStripPosition = 0; var originPosition = {};
var centeringPoint = 0; var is_animating = 0;
var rightScrollLimit = 0; var currentStripPosition = 0;
var centeringPoint = 0;
// makeSlideStrip() var rightScrollLimit = 0;
// - figures out how many slides there are
// - determines the centering point of the slide strip // makeSlideStrip()
function makeSlideStrip() { // - figures out how many slides there are
var slideTotal = 0; // - determines the centering point of the slide strip
centeringPoint = Math.ceil(slidesAtOnce/2); function makeSlideStrip() {
for (var x in slideCode) { var slideTotal = 0;
slideTotal++; centeringPoint = Math.ceil(slidesAtOnce/2);
} for (var x in slideCode) {
var i = 0; slideTotal++;
for (var code in slideCode) { }
if (i <= centeringPoint-1) { var i = 0;
originPosition[code] = 0; for (var code in slideCode) {
} else { if (i <= centeringPoint-1) {
if (i >= slideTotal-centeringPoint+1) { originPosition[code] = 0;
originPosition[code] = (slideTotal-slidesAtOnce)*slideWidth; } else {
} else { if (i >= slideTotal-centeringPoint+1) {
originPosition[code] = (i-centeringPoint+1)*slideWidth; originPosition[code] = (slideTotal-slidesAtOnce)*slideWidth;
} } else {
} originPosition[code] = (i-centeringPoint+1)*slideWidth;
i++; }
} }
rightScrollLimit = -1*(slideTotal-slidesAtOnce)*slideWidth; i++;
} }
rightScrollLimit = -1*(slideTotal-slidesAtOnce)*slideWidth;
// slides with acceleration }
function slide(goal, id, go_left, cp) {
var div = document.getElementById(id); // slides with acceleration
var animation = {}; function slide(goal, id, go_left, cp) {
animation.time = 0.5; // in seconds var div = document.getElementById(id);
animation.fps = 60; var animation = {};
animation.goal = goal; animation.time = 0.5; // in seconds
origin = 0.0; animation.fps = 60;
animation.origin = Math.abs(origin); animation.goal = goal;
animation.frames = (animation.time * animation.fps) - 1.0; origin = 0.0;
var current_frame = 0; animation.origin = Math.abs(origin);
var motions = Math.abs(animation.goal - animation.origin); animation.frames = (animation.time * animation.fps) - 1.0;
function animate() { var current_frame = 0;
var ease_right = function (t) { return (1 - Math.cos(t * Math.PI))/2.0; }; var motions = Math.abs(animation.goal - animation.origin);
var ease = ease_right; function animate() {
if (go_left == 1) { var ease_right = function (t) { return (1 - Math.cos(t * Math.PI))/2.0; };
ease = function(t) { return 1.0 - ease_right(t); }; var ease = ease_right;
} if (go_left == 1) {
var left = (ease(current_frame/animation.frames) * Math.abs(animation.goal - animation.origin)) - cp; ease = function(t) { return 1.0 - ease_right(t); };
if(left < 0) { }
left = 0; var left = (ease(current_frame/animation.frames) * Math.abs(animation.goal - animation.origin)) - cp;
} if(left < 0) {
if(!isNaN(left)) { left = 0;
div.style.left = '-' + Math.round(left) + 'px'; }
} if(!isNaN(left)) {
current_frame += 1; div.style.left = '-' + Math.round(left) + 'px';
if (current_frame == animation.frames) { }
is_animating = 0; current_frame += 1;
window.clearInterval(timeoutId) if (current_frame == animation.frames) {
} is_animating = 0;
} window.clearInterval(timeoutId)
var timeoutId = window.setInterval(animate, animation.time/animation.fps * 1000); }
} }
var timeoutId = window.setInterval(animate, animation.time/animation.fps * 1000);
//Get style property }
function getStyle(element, cssProperty){
var elem = document.getElementById(element); //Get style property
if(elem.currentStyle){ function getStyle(element, cssProperty){
return elem.currentStyle[cssProperty]; //IE var elem = document.getElementById(element);
} else{ if(elem.currentStyle){
var style = document.defaultView.getComputedStyle(elem, null); //firefox, Opera return elem.currentStyle[cssProperty]; //IE
return style.getPropertyValue(cssProperty); } else{
} var style = document.defaultView.getComputedStyle(elem, null); //firefox, Opera
} return style.getPropertyValue(cssProperty);
}
// Left and right arrows }
function page_left() {
var amount = slideWidth; // Left and right arrows
animateSlide(amount, 'left'); function page_left() {
} var amount = slideWidth;
animateSlide(amount, 'left');
function page_right() { }
var amount = slideWidth;
animateSlide(amount, 'right'); function page_right() {
} var amount = slideWidth;
animateSlide(amount, 'right');
}
// animates the strip
// - sets arrows to on or off
function animateSlide(amount,dir) { // animates the strip
var currentStripPosition = parseInt(getStyle(slideList,'left')); // - sets arrows to on or off
var motionDistance; function animateSlide(amount,dir) {
if (amount == slideWidth ) { var currentStripPosition = parseInt(getStyle(slideList,'left'));
motionDistance = slideWidth; var motionDistance;
} else { if (amount == slideWidth ) {
motionDistance = amount; motionDistance = slideWidth;
} } else {
motionDistance = amount;
var rightarrow = document.getElementById(arrowRight); }
var leftarrow = document.getElementById(arrowLeft);
var rightarrow = document.getElementById(arrowRight);
function aToggle(state,aDir) { var leftarrow = document.getElementById(arrowLeft);
if (state == 'on') {
if (aDir =='right') { function aToggle(state,aDir) {
rightarrow.className = 'arrow-right-on'; if (state == 'on') {
rightarrow.href = "javascript:page_right()"; if (aDir =='right') {
} else { rightarrow.className = 'arrow-right-on';
leftarrow.className = 'arrow-left-on'; rightarrow.href = "javascript:page_right()";
leftarrow.href = "javascript:page_left()"; } else {
} leftarrow.className = 'arrow-left-on';
} else { leftarrow.href = "javascript:page_left()";
if (aDir =='right') { }
rightarrow.href = "javascript:{}"; } else {
rightarrow.className = 'arrow-right-off'; if (aDir =='right') {
} else { rightarrow.href = "javascript:{}";
leftarrow.href = "javascript:{}"; rightarrow.className = 'arrow-right-off';
leftarrow.className = 'arrow-left-off'; } else {
} leftarrow.href = "javascript:{}";
} leftarrow.className = 'arrow-left-off';
} }
}
function arrowChange(rP) { }
if (rP >= rightScrollLimit) {
aToggle('on','right'); function arrowChange(rP) {
} if (rP >= rightScrollLimit) {
if (rP <= rightScrollLimit) { aToggle('on','right');
aToggle('off','right'); }
} if (rP <= rightScrollLimit) {
if (rP <= slideWidth) { aToggle('off','right');
aToggle('on','left'); }
} if (rP <= slideWidth) {
if (rP >= 0) { aToggle('on','left');
aToggle('off','left'); }
} if (rP >= 0) {
} aToggle('off','left');
}
if (dir == 'right' && is_animating == 0) { }
arrowChange(currentStripPosition-motionDistance);
is_animating = 1; if (dir == 'right' && is_animating == 0) {
slide(motionDistance, slideList, 0, currentStripPosition); arrowChange(currentStripPosition-motionDistance);
} else if (dir == 'left' && is_animating == 0) { is_animating = 1;
arrowChange(currentStripPosition+motionDistance); slide(motionDistance, slideList, 0, currentStripPosition);
is_animating = 1; } else if (dir == 'left' && is_animating == 0) {
rightStripPosition = currentStripPosition + motionDistance; arrowChange(currentStripPosition+motionDistance);
slide(motionDistance, slideList, 1, rightStripPosition); is_animating = 1;
} rightStripPosition = currentStripPosition + motionDistance;
} slide(motionDistance, slideList, 1, rightStripPosition);
}
function centerSlide(slideName) { }
var currentStripPosition = parseInt(getStyle(slideList,'left'));
var dir = 'left'; function centerSlide(slideName) {
var originpoint = Math.abs(currentStripPosition); var currentStripPosition = parseInt(getStyle(slideList,'left'));
if (originpoint <= originPosition[slideName]) { var dir = 'left';
dir = 'right'; var originpoint = Math.abs(currentStripPosition);
} if (originpoint <= originPosition[slideName]) {
var motionValue = Math.abs(originPosition[slideName]-originpoint); dir = 'right';
animateSlide(motionValue,dir); }
} var motionValue = Math.abs(originPosition[slideName]-originpoint);
animateSlide(motionValue,dir);
}
function initCarousel(def) {
buildCarousel();
showPreview(def); function initCarousel(def) {
makeSlideStrip(); buildCarousel();
} showPreview(def);
makeSlideStrip();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,179 @@
function new_node(me, mom, text, link, children_data)
{
var node = new Object();
node.children = Array();
node.children_data = children_data;
node.depth = mom.depth + 1;
node.li = document.createElement("li");
mom.get_children_ul().appendChild(node.li);
node.label_div = document.createElement("div");
node.li.appendChild(node.label_div);
node.label_div.style.paddingLeft = 10*node.depth + "px";
node.label_div.className = "label";
if (children_data == null) {
// 12 is the width of the triangle and padding extra space
node.label_div.style.paddingLeft = ((10*node.depth)+12) + "px";
} else {
node.label_div.style.paddingLeft = 10*node.depth + "px";
node.expand_toggle = document.createElement("a");
node.expand_toggle.href = "javascript:void(0)";
node.expand_toggle.onclick = function() {
if (node.expanded) {
$(node.get_children_ul()).slideUp("fast");
node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png";
node.expanded = false;
} else {
expand_node(me, node);
}
};
node.label_div.appendChild(node.expand_toggle);
node.plus_img = document.createElement("img");
node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png";
node.plus_img.className = "plus";
node.plus_img.border = "0";
node.expand_toggle.appendChild(node.plus_img);
node.expanded = false;
}
var a = document.createElement("a");
node.label_div.appendChild(a);
node.label = document.createTextNode(text);
a.appendChild(node.label);
if (link) {
a.href = me.toroot + link;
} else {
if (children_data != null) {
a.className = "nolink";
a.href = "javascript:void(0)";
a.onclick = node.expand_toggle.onclick;
// This next line shouldn't be necessary. I'll buy a beer for the first
// person who figures out how to remove this line and have the link
// toggle shut on the first try. --joeo@android.com
node.expanded = false;
}
}
node.children_ul = null;
node.get_children_ul = function() {
if (!node.children_ul) {
node.children_ul = document.createElement("ul");
node.children_ul.className = "children_ul";
node.children_ul.style.display = "none";
node.li.appendChild(node.children_ul);
}
return node.children_ul;
};
return node;
}
function expand_node(me, node)
{
if (node.children_data && !node.expanded) {
if (node.children_visited) {
$(node.get_children_ul()).slideDown("fast");
} else {
get_node(me, node);
$(node.get_children_ul()).slideDown("fast");
}
node.plus_img.src = me.toroot + "assets/images/triangle-opened-small.png";
node.expanded = true;
}
}
function get_node(me, mom)
{
mom.children_visited = true;
for (var i in mom.children_data) {
var node_data = mom.children_data[i];
mom.children[i] = new_node(me, mom, node_data[0], node_data[1],
node_data[2]);
}
}
function this_page_relative(toroot)
{
var full = document.location.pathname;
var file = "";
if (toroot.substr(0, 1) == "/") {
if (full.substr(0, toroot.length) == toroot) {
return full.substr(toroot.length);
} else {
// the file isn't under toroot. Fail.
return null;
}
} else {
if (toroot != "./") {
toroot = "./" + toroot;
}
do {
if (toroot.substr(toroot.length-3, 3) == "../" || toroot == "./") {
var pos = full.lastIndexOf("/");
file = full.substr(pos) + file;
full = full.substr(0, pos);
toroot = toroot.substr(0, toroot.length-3);
}
} while (toroot != "" && toroot != "/");
return file.substr(1);
}
}
function find_page(url, data)
{
var nodes = data;
var result = null;
for (var i in nodes) {
var d = nodes[i];
if (d[1] == url) {
return new Array(i);
}
else if (d[2] != null) {
result = find_page(url, d[2]);
if (result != null) {
return (new Array(i).concat(result));
}
}
}
return null;
}
function init_navtree(navtree_id, toroot, root_nodes)
{
var me = new Object();
me.toroot = toroot;
me.node = new Object();
me.node.li = document.getElementById(navtree_id);
me.node.children_data = root_nodes;
me.node.children = new Array();
me.node.children_ul = document.createElement("ul");
me.node.get_children_ul = function() { return me.node.children_ul; };
//me.node.children_ul.className = "children_ul";
me.node.li.appendChild(me.node.children_ul);
me.node.depth = 0;
get_node(me, me.node);
me.this_page = this_page_relative(toroot);
me.breadcrumbs = find_page(me.this_page, root_nodes);
if (me.breadcrumbs != null && me.breadcrumbs.length != 0) {
var mom = me.node;
for (var i in me.breadcrumbs) {
var j = me.breadcrumbs[i];
mom = mom.children[j];
expand_node(me, mom);
}
mom.label_div.className = mom.label_div.className + " selected";
addLoadEvent(function() {
scrollIntoView("nav-tree");
});
}
}

View File

@@ -136,7 +136,7 @@ function search_changed(e, kd, toroot)
gSelectedIndex = -1; gSelectedIndex = -1;
for (i=0; i<DATA.length; i++) { for (i=0; i<DATA.length; i++) {
var s = DATA[i]; var s = DATA[i];
if (text.length != 0 && s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) { if (text.length != 0 && s.label.indexOf(text) != -1) {
gMatches[matchedCount] = s; gMatches[matchedCount] = s;
if (gSelectedID == s.id) { if (gSelectedID == s.id) {
gSelectedIndex = matchedCount; gSelectedIndex = matchedCount;
@@ -156,8 +156,10 @@ function search_focus_changed(obj, focused)
obj.style.color="#000000"; obj.style.color="#000000";
} }
} else { } else {
obj.value = DEFAULT_TEXT; if(obj.value == ""){
obj.style.color="#aaaaaa"; obj.value = DEFAULT_TEXT;
obj.style.color="#aaaaaa";
}
document.getElementById("search_filtered").className = "no-display"; document.getElementById("search_filtered").className = "no-display";
} }
} }

View File

@@ -313,3 +313,4 @@ div#jd-build-id {
margin-top: 0px; margin-top: 0px;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 B

View File

@@ -10,14 +10,15 @@ function toggle_inherited(base) {
if (list.style.display == "none") { if (list.style.display == "none") {
list.style.display = "block"; list.style.display = "block";
summary.style.display = "none"; summary.style.display = "none";
trigger.src = "<?cs var:toroot ?>assets/triangle-open.png"; trigger.src = "<?cs var:toroot ?>assets/images/triangle-closed.png";
} else { } else {
list.style.display = "none"; list.style.display = "none";
summary.style.display = "block"; summary.style.display = "block";
trigger.src = "<?cs var:toroot ?>assets/triangle-close.png"; trigger.src = "<?cs var:toroot ?>assets/images/triangle-opened.png";
} }
} }
</script> </script>
<?cs include:"header.cs" ?> <?cs include:"header.cs" ?>
<div class="g-unit" id="doc-content"> <div class="g-unit" id="doc-content">
@@ -80,17 +81,17 @@ function toggle_inherited(base) {
<?cs # this next line must be exactly like this to be parsed by eclipse ?> <?cs # this next line must be exactly like this to be parsed by eclipse ?>
<!-- ======== NESTED CLASS SUMMARY ======== --> <!-- ======== NESTED CLASS SUMMARY ======== -->
<?cs if:subcount(class.inners) ?> <?cs if:subcount(class.inners) ?>
<h4><?cs call:expando_trigger("nested-classes", "close") ?>Nested Classes</h4> <h4><?cs call:expando_trigger("nested-classes", "opened") ?>Nested Classes</h4>
<?cs call:expandable_class_list("nested-classes", class.inners, "summary") ?> <?cs call:expandable_class_list("nested-classes", class.inners, "summary") ?>
<?cs /if ?> <?cs /if ?>
<?cs if:subcount(class.subclasses.direct) ?> <?cs if:subcount(class.subclasses.direct) ?>
<h4><?cs call:expando_trigger("subclasses-direct", "open") ?>Known Direct Subclasses</h4> <h4><?cs call:expando_trigger("subclasses-direct", "closed") ?>Known Direct Subclasses</h4>
<?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "list") ?> <?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "list") ?>
<?cs /if ?> <?cs /if ?>
<?cs if:subcount(class.subclasses.indirect) ?> <?cs if:subcount(class.subclasses.indirect) ?>
<h4><?cs call:expando_trigger("subclasses-indirect", "open") ?>Known Indirect Subclasses</h4> <h4><?cs call:expando_trigger("subclasses-indirect", "closed") ?>Known Indirect Subclasses</h4>
<?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "list") ?> <?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "list") ?>
<?cs /if ?> <?cs /if ?>
@@ -195,7 +196,7 @@ function toggle_inherited(base) {
<?cs each:cl=class.inherited ?> <?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.attrs) ?> <?cs if:subcount(cl.attrs) ?>
<h4><?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "open") ?>XML Attributes inherited <h4><?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "closed") ?>XML Attributes inherited
from <?cs var:cl.kind ?> from <?cs var:cl.kind ?>
<a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a>
</h4> </h4>
@@ -239,7 +240,7 @@ function toggle_inherited(base) {
<?cs each:cl=class.inherited ?> <?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.constants) ?> <?cs if:subcount(cl.constants) ?>
<h4><?cs call:expando_trigger("inherited-constants-"+cl.qualified, "open") ?>Constants inherited <h4><?cs call:expando_trigger("inherited-constants-"+cl.qualified, "closed") ?>Constants inherited
from <?cs var:cl.kind ?> from <?cs var:cl.kind ?>
<a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a>
</h4> </h4>
@@ -266,7 +267,7 @@ function toggle_inherited(base) {
<?cs each:cl=class.inherited ?> <?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.fields) ?> <?cs if:subcount(cl.fields) ?>
<h4><?cs call:expando_trigger("inherited-fields-"+cl.qualified, "open") ?>Fields inherited <h4><?cs call:expando_trigger("inherited-fields-"+cl.qualified, "closed") ?>Fields inherited
from <?cs var:cl.kind ?> from <?cs var:cl.kind ?>
<a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a>
</h4> </h4>
@@ -314,7 +315,7 @@ function toggle_inherited(base) {
<?cs each:cl=class.inherited ?> <?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.methods) ?> <?cs if:subcount(cl.methods) ?>
<h4><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "open") ?>Methods inherited <h4><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?>Methods inherited
from <?cs var:cl.kind ?> from <?cs var:cl.kind ?>
<a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a>
</h4> </h4>

View File

@@ -1,151 +1,24 @@
<?cs # This default template file is meant to be replaced. ?> <?cs # This default template file is meant to be replaced. ?>
<?cs # Use the -tempatedir arg to javadoc to set your own directory with a replacement for this file in it. ?> <?cs # Use the -templatedir arg to javadoc to set your own directory with a ?>
<?cs # As of OCT '08, there's no need to replace this... framework and gae are identical. ?> <?cs # replacement for this file in it. ?>
<?cs def:custom_masthead() ?> <?cs def:custom_masthead() ?>
<div id="header"> <div id="header">
<div id="headerLeft"> <div id="headerLeft">
<a href="<?cs var:toroot ?>"><img src="<?cs var:toroot ?>assets/images/bg_logo.jpg" /></a> <a href="<?cs var:toroot ?>index.html" tabindex="-1"><?cs var:page.title ?></a>
</div>
<div id="headerRight">
<div id="headerLinks" align="right">
<img src="<?cs var:toroot ?>assets/images/icon_world.jpg"><span class="text">&nbsp;<a href="#">English</a> | <a href="http://www.android.com">Android.com</a></span>
</div>
<div id="search" align="right">
<div id="searchForm">
<form accept-charset="utf-8" class="gsc-search-box" onsubmit="document.location='<?cs var:toroot ?>search.html?' + document.getElementById('search_autocomplete').value; return false;">
<table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
<tr>
<td class="gsc-input">
<input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off" tabindex="1"
value="search developer docs"
onFocus="search_focus_changed(this, true)"
onBlur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '<?cs var:toroot?>')"
onkeyup="search_changed(event, false, '<?cs var:toroot?>')" />
<br/>
<div id="search_filtered_div">
<table id="search_filtered" class="no-display" cellspacing=0>
</table>
</div>
</td>
<td class="gsc-search-button">
<input type="button" value="Search" title="search" id="search-button" class="gsc-search-button" onclick="document.location='<?cs var:toroot ?>search.html?' + document.getElementById('search_autocomplete').value;"/>
</td>
<td class="gsc-clear-button">
<div title="clear results" class="gsc-clear-button">&nbsp;</div>
</td>
</tr></tbody>
</table>
</form>
</div>
</div>
<ul class="<?cs
if:reference ?>reference<?cs
elif:guide ?>guide<?cs
elif:sdk ?>sdk<?cs
elif:home ?>home<?cs
elif:community ?>community<?cs
elif:publish ?>publish<?cs
elif:about ?>about<?cs /if ?>">
<li><a href="<?cs var:toroot ?>community/" id="community-link">Community</a></li>
<li><a href="http://android-developers.blogspot.com">Blog</a></li>
//<li><a href="<?cs var:toroot ?>publish/" id="publish-link">Publish</a></li>
<li><a href="<?cs var:toroot ?>reference/packages.html" id="reference-link">Reference</a></li>
<li><a href="<?cs var:toroot ?>guide/" id="guide-link">Dev Guide</a></li>
<li><a href="<?cs var:toroot ?>sdk/" id="sdk-link">SDK</a></li>
<li><a href="<?cs var:toroot ?>" id="home-link">Home</a></li>
</ul>
</div>
</div>
<?cs /def ?>
<?cs # appears in the blue bar at the top of every page ?>
<?cs def:custom_subhead() ?>
<?cs if:android.buglink ?>
<a href="http://b/createIssue?component=27745&owner=jcohen&cc=android-bugs&issue.summary=javadoc+bug%3A+<?cs var:filename ?>&issue.type=BUG&issue.priority=P2&issue.severity=S2&"><font color="red">See a bug? Report it here.</font></a> &nbsp;&nbsp;
<?cs /if ?>
<?cs /def ?>
<?cs def:custom_left_nav() ?>
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="resize-packages-nav">
<div id="packages-nav">
<div id="index-links"><nobr>
<a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> |
<a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr>
</div>
<ul>
<?cs each:pkg=docs.packages ?>
<li <?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>class="selected"<?cs /if ?>><?cs call:package_link(pkg) ?></li>
<?cs /each ?>
</ul><br/>
</div> <!-- end packages -->
</div> <!-- end resize-packages -->
<div id="classes-nav">
<?cs if:subcount(class.package) ?>
<ul>
<?cs call:list("Interfaces", class.package.interfaces) ?>
<?cs call:list("Classes", class.package.classes) ?>
<?cs call:list("Enums", class.package.enums) ?>
<?cs call:list("Exceptions", class.package.exceptions) ?>
<?cs call:list("Errors", class.package.errors) ?>
</ul>
<?cs elif:subcount(package) ?>
<ul>
<?cs call:class_link_list("Interfaces", package.interfaces) ?>
<?cs call:class_link_list("Classes", package.classes) ?>
<?cs call:class_link_list("Enums", package.enums) ?>
<?cs call:class_link_list("Exceptions", package.exceptions) ?>
<?cs call:class_link_list("Errors", package.errors) ?>
</ul>
<?cs else ?>
<script>
/*addLoadEvent(maxPackageHeight);*/
</script>
<p style="padding:10px">Select a package to view its members</p>
<?cs /if ?><br/>
</div><!-- end classes -->
</div> <!-- end side-nav -->
<?cs /def ?>
<?cs def:sdk_nav() ?>
<div class="g-section g-tpl-180" id="body-content">
<div class="g-unit g-first" id="side-nav">
<div id="devdoc-nav">
<?cs include:"../../../java/android/html/sdk/sdk_toc.cs" ?>
</div> </div>
</div> <!-- end side-nav --> <div id="headerRight">
<?cs /def ?> <?cs call:default_search_box() ?>
</div><!-- headerRight -->
</div><!-- header -->
<?cs def:guide_nav() ?> <?cs /def ?><?cs # custom_masthead ?>
<div class="g-section g-tpl-240 side-nav-resizable" id="body-content">
<div class="g-unit g-first" id="side-nav">
<div id="devdoc-nav">
<?cs include:"../../../java/android/html/guide/guide_toc.cs" ?>
</div>
</div> <!-- end side-nav -->
<?cs /def ?>
<?cs def:publish_nav() ?>
<div class="g-section g-tpl-180" id="body-content">
<div class="g-unit g-first" id="side-nav">
<div id="devdoc-nav">
<?cs include:"../../../java/android/html/publish/publish_toc.cs" ?>
</div>
</div> <!-- end side-nav -->
<?cs /def ?>
<?cs # appears on the left side of the blue bar at the bottom of every page ?> <?cs # appears on the left side of the blue bar at the bottom of every page ?>
<?cs def:custom_copyright() ?>Copyright 2008 <a href="http://open.android.com/">The Android Open Source Project</a><?cs /def ?> <?cs def:custom_copyright() ?><?cs /def ?>
<?cs # appears on the right side of the blue bar at the bottom of every page ?> <?cs # appears on the right side of the blue bar at the bottom of every page ?>
<?cs def:custom_buildinfo() ?>Build <?cs var:page.build ?> - <?cs var:page.now ?><?cs /def ?> <?cs def:custom_buildinfo() ?>Build <?cs var:page.build ?> - <?cs var:page.now ?><?cs /def ?>
<?cs def:custom_left_nav() ?><?cs call:default_left_nav() ?><?cs /def ?>

View File

@@ -4,19 +4,31 @@
<body class="gc-documentation"> <body class="gc-documentation">
<?cs include:"header.cs" ?> <?cs include:"header.cs" ?>
<div class="g-unit" id="doc-content"> <div class="g-unit" id="doc-content"><a name="top"></a>
<div id="jd-header"> <div id="jd-header" class="guide-header">
<span class="crumb">
<?cs if:parent.link ?>
<a href="<?cs var:parent.link ?>"><?cs var:parent.title ?></a> >
<?cs else ?>&nbsp;
<?cs /if ?>
</span>
<h1><?cs var:page.title ?></h1> <h1><?cs var:page.title ?></h1>
</div> </div>
<div id="jd-content"> <div id="jd-content">
<div class="jd-descr"> <div class="jd-descr">
<?cs call:tag_list(root.descr) ?> <?cs call:tag_list(root.descr) ?>
</div> </div>
<a href="#top" style="float:right">&uarr; Go to top</a>
<?cs if:parent.link ?>
<p><a href="<?cs var:parent.link ?>">&larr; Back to <?cs var:parent.title ?></a></p>
<?cs /if ?>
</div> </div>
<?cs include:"footer.cs" ?> <?cs include:"footer.cs" ?>
</div><!-- end doc-content --> </div><!-- end doc-content -->
</div><!-- end body-content --> </div><!-- end body-content -->

View File

@@ -6,11 +6,23 @@
elif:sdk ?>SDK | <?cs elif:sdk ?>SDK | <?cs
elif:sample ?>Samples | <?cs elif:sample ?>Samples | <?cs
/if ?>Android Developers</title> /if ?>Android Developers</title>
<link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" media="screen">
<?cs if:guide ?>
<link href="<?cs var:toroot ?>assets/android-developer-docs-devguide.css" rel="stylesheet" type="text/css" />
<?cs else ?>
<link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<?cs /if ?>
<script src="<?cs var:toroot ?>assets/search_autocomplete.js"></script> <script src="<?cs var:toroot ?>assets/search_autocomplete.js"></script>
<script src="<?cs var:toroot ?>reference/lists.js"></script> <script src="<?cs var:toroot ?>reference/lists.js"></script>
<script src="<?cs var:toroot ?>assets/jquery-resizable.min.js"></script> <script src="<?cs var:toroot ?>assets/jquery-resizable.min.js"></script>
<script src="<?cs var:toroot ?>assets/android-developer-docs.js"></script> <script src="<?cs var:toroot ?>assets/android-developer-docs.js"></script>
<script>
setToRoot("<?cs var:toroot ?>");
</script>
<script src="<?cs var:toroot ?>navtree_data.js"></script>
<script src="<?cs var:toroot ?>assets/navtree.js"></script>
<noscript> <noscript>
<style> <style>
@@ -18,7 +30,8 @@
#body-content{position:relative; top:0;} #body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;} #doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;} #side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;} #resize-packages-nav{border-bottom:3px solid #666;}
</style> </style>
</noscript> </noscript>
</head> </head>

Some files were not shown because too many files have changed in this diff Show More