android 编译源码不生成odex

一.可以选择编译eng版本(也就是工程版本)

    通过choosecombo命令行选择


二.修改mk文件实现非odex优化

    这里涉及到两个地方,一个是apk的odex优化,还有framework的odex优化

    1.禁止apk生成odex: 修改../build/core/package.mk

            

# This file will be the one that other modules should depend on.
common_javalib.jar := $(intermediates.COMMON)/$(LOCAL_BUILT_MODULE_STEM)
LOCAL_INTERMEDIATE_TARGETS += $(common_javalib.jar)

ifneq (true,$(WITH_DEXPREOPT))
LOCAL_DEX_PREOPT :=
else
ifeq (,$(TARGET_BUILD_APPS))
ifndef LOCAL_DEX_PREOPT
LOCAL_DEX_PREOPT := true
endif
endif
endif
ifeq (false,$(LOCAL_DEX_PREOPT))
LOCAL_DEX_PREOPT :=
endif

#################################
include $(BUILD_SYSTEM)/java.mk
#################################

           把LOCAL_DEX_PREOPT := ture 修改为 LOCAL_DEX_PREOPT := false
    2.禁止jar包生成odex: 修改/build/core/java_library.mk  

           

proguard_options_file :=
ifneq ($(LOCAL_PROGUARD_ENABLED),custom)
ifneq ($(all_resources),)
    proguard_options_file := $(package_expected_intermediates_COMMON)/proguard_options
endif # all_resources
endif # !custom
LOCAL_PROGUARD_FLAGS := $(addprefix -include ,$(proguard_options_file)) $(LOCAL_PROGUARD_FLAGS)

ifneq (true,$(WITH_DEXPREOPT))
LOCAL_DEX_PREOPT :=
else
ifeq (,$(TARGET_BUILD_APPS))
ifneq (,$(LOCAL_SRC_FILES))
ifndef LOCAL_DEX_PREOPT
LOCAL_DEX_PREOPT := true
endif
endif
endif
endif
ifeq (false,$(LOCAL_DEX_PREOPT))
LOCAL_DEX_PREOPT :=
endif

#################################
include $(BUILD_SYSTEM)/java.mk
#################################


           LOCAL_DEX_PREOPT := ture  修改为 LOCAL_DEX_PREOPT := false  


编译的时候先make clean-framework

然后再make framework  make systemimage

你可能感兴趣的:(android,ics)