OSDN Git Service

Ensure prebuilt executables are executable
authorDan Willemsen <dwillemsen@google.com>
Wed, 2 Mar 2016 06:04:57 +0000 (22:04 -0800)
committerDan Willemsen <dwillemsen@google.com>
Wed, 2 Mar 2016 06:11:41 +0000 (22:11 -0800)
Use 'chmod +x' to make sure that they're executable, even if the source
file is not.

Change-Id: Id155f6b4ff188f5c909fd6237fd64183af264f79

core/prebuilt_internal.mk
tools/apicheck/Android.mk

index 8c14775..3d7ddd0 100644 (file)
@@ -275,13 +275,17 @@ $(my_register_name): $(installed_apk_splits)
 endif # LOCAL_PACKAGE_SPLITS
 
 else # LOCAL_MODULE_CLASS != APPS
-ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
+
 $(built_module) : $(my_prebuilt_src_file)
+ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
        $(transform-prebuilt-to-target-strip-comments)
 else
-$(built_module) : $(my_prebuilt_src_file)
        $(transform-prebuilt-to-target)
 endif
+ifeq ($(LOCAL_MODULE_CLASS),EXECUTABLES)
+       $(hide) chmod +x $@
+endif
+
 endif # LOCAL_MODULE_CLASS != APPS
 
 ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
index 9dc7c6b..b547058 100644 (file)
 ifneq ($(TARGET_BUILD_PDK),true)
 LOCAL_PATH := $(call my-dir)
 
-# We use copy-file-to-new-target so that the installed
-# script file's timestamp is at least as new as the
-# .jar file it wraps.
-
-#TODO(dbort): add a template to do this stuff; share with jx
-
 # the hat script
 # ============================================================
 include $(CLEAR_VARS)
 LOCAL_IS_HOST_MODULE := true
 LOCAL_MODULE_CLASS := EXECUTABLES
 LOCAL_MODULE := apicheck
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
-$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/apicheck
-       @echo "Copy: $(PRIVATE_MODULE) ($@)"
-       $(copy-file-to-new-target)
-       $(hide) chmod 755 $@
+LOCAL_SRC_FILES := etc/apicheck
+LOCAL_REQUIRED_MODULES := doclava
+include $(BUILD_PREBUILT)
 
 # Apicheck is now part of Doclava -- See external/doclava.
 endif