development
修訂 | e4ccbd68ec540739819bea7e109d29d08a54122a (tree) |
---|---|
時間 | 2011-06-08 03:25:07 |
作者 | Ying Wang <wangying@goog...> |
Commiter | Ying Wang |
Use a function to package android support libraries.
Change-Id: I52240b31fba7728b74d57fd806a93988e3ac8fe9
@@ -66,22 +66,20 @@ $(android_jar_full_target): $(full_target) | ||
66 | 66 | ALL_SDK_FILES += $(android_jar_full_target) |
67 | 67 | |
68 | 68 | |
69 | -android-support-v4_build_module := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar | |
70 | -android-support-v4_intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android-support-v4_intermediates | |
71 | -android-support-v4_full_target := $(android-support-v4_intermediates)/android-support-v4.jar | |
72 | -$(android-support-v4_full_target): $(android-support-v4_build_module) | |
73 | - @echo Package android-support-v4.jar: $@ | |
74 | - $(hide)mkdir -p $(dir $@) | |
75 | - $(hide)$(ACP) $< $@ | |
69 | +# $(1): the Java library name | |
70 | +define _package_sdk_library | |
71 | +$(eval _psm_build_module := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(1)_intermediates/javalib.jar) | |
72 | +$(eval _psm_packaging_target := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(1)_intermediates/$(1).jar) | |
73 | +$(_psm_packaging_target) : $(_psm_build_module) | $(ACP) | |
74 | + @echo "Package $(1).jar: $$@" | |
75 | + $(hide) mkdir -p $$(dir $$@) | |
76 | + $(hide) $(ACP) $$< $$@ | |
76 | 77 | |
77 | -ALL_SDK_FILES += $(android-support-v4_full_target) | |
78 | +ALL_SDK_FILES += $(_psm_packaging_target) | |
79 | +$(eval _psm_build_module :=) | |
80 | +$(eval _psm_packaging_target :=) | |
81 | +endef | |
78 | 82 | |
79 | -android-support-v13_build_module := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android-support-v13_intermediates/javalib.jar | |
80 | -android-support-v13_intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android-support-v13_intermediates | |
81 | -android-support-v13_full_target := $(android-support-v13_intermediates)/android-support-v13.jar | |
82 | -$(android-support-v13_full_target): $(android-support-v13_build_module) | |
83 | - @echo Package android-support-v13.jar: $@ | |
84 | - $(hide)mkdir -p $(dir $@) | |
85 | - $(hide)$(ACP) $< $@ | |
83 | +ANDROID_SUPPORT_LIBRARIES := android-support-v4 android-support-v13 | |
86 | 84 | |
87 | -ALL_SDK_FILES += $(android-support-v13_full_target) | |
85 | +$(foreach lib, $(ANDROID_SUPPORT_LIBRARIES), $(eval $(call _package_sdk_library,$(lib)))) |