减少30秒左右android编译时间

找到$your_android_dir/build/core/main.mk 500左右,关键字搜索subdir_makefiles

old:

subdir_makefiles := \
 $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)

new:

#HAVE_CACHE := true
ifdef HAVE_CACHE 
subdir_makefiles := $(shell cat make_cache)
else
subdir_makefiles := $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)
$(shell echo $(subdir_makefiles) > make_cache)

endif

 

第一次编译后将#HAVE_CACHE := true前的#去掉。

当添加了新的Android.mk文件时,重新设置一次。

 

 

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