Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Replace custom rules, remove ACP
Browse files Browse the repository at this point in the history
A few LOCAL_ADDITIONAL_DEPENDENCIES were required, where
LOCAL_REQUIRED_MODULES would be nicer, but you can't require a module of
the same name. It would create a dependency loop with the current
require implementation, so it's filtered by the build system.

Also translate monkey from ALL_PREBUILTS to a prebuilt like the rest of
the tools. This doesn't change anything, since 'monkey' is already in
build/target/product/base.mk.

ACP is being removed, so use the standard build system macros to copy
files.

Change-Id: I4f73c6b35c0d7ae25467145b0a9d5c32ba4578d2
  • Loading branch information
danw committed Mar 23, 2016
1 parent 403636a commit f230a38
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 35 deletions.
10 changes: 4 additions & 6 deletions build/Android.mk
Expand Up @@ -68,16 +68,15 @@ android_stubs: $(full_target)
# The package installation stuff doesn't know about this file, so nobody will
# ever be able to write a rule that installs it to a device.
$(dir $(full_target))javalib.jar: $(full_target)
$(hide)$(ACP) $< $@
$(copy-file-to-target)

# android.jar is what we put in the SDK package.
android_jar_intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android_jar_intermediates
android_jar_full_target := $(android_jar_intermediates)/android.jar

$(android_jar_full_target): $(full_target)
@echo Package SDK Stubs: $@
$(hide)mkdir -p $(dir $@)
$(hide)$(ACP) $< $@
$(copy-file-to-target)

ALL_SDK_FILES += $(android_jar_full_target)

Expand All @@ -97,10 +96,9 @@ ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.ht
define _package_sdk_library
$(eval _psm_build_module := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(1)_intermediates/javalib.jar)
$(eval _psm_packaging_target := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(1)_intermediates/$(1).jar)
$(_psm_packaging_target) : $(_psm_build_module) | $(ACP)
$(_psm_packaging_target) : $(_psm_build_module)
@echo "Package $(1).jar: $$@"
$(hide) mkdir -p $$(dir $$@)
$(hide) $(ACP) $$< $$@
$$(copy-file-to-target)

ALL_SDK_FILES += $(_psm_packaging_target)
$(eval _psm_build_module :=)
Expand Down
13 changes: 8 additions & 5 deletions cmds/monkey/Android.mk
@@ -1,14 +1,17 @@
# Copyright 2008 The Android Open Source Project
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_MODULE := monkey
LOCAL_MODULE := monkeylib
LOCAL_MODULE_STEM := monkey
include $(BUILD_JAVA_LIBRARY)

################################################################
include $(CLEAR_VARS)
ALL_PREBUILT += $(TARGET_OUT)/bin/monkey
$(TARGET_OUT)/bin/monkey : $(LOCAL_PATH)/monkey | $(ACP)
$(transform-prebuilt-to-target)
LOCAL_MODULE := monkey
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := monkey
LOCAL_REQUIRED_MODULES := monkeylib
include $(BUILD_PREBUILT)
15 changes: 3 additions & 12 deletions tools/apkcheck/Android.mk
Expand Up @@ -14,24 +14,15 @@

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.

# the execution script
# ============================================================
include $(CLEAR_VARS)
LOCAL_IS_HOST_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE := apkcheck

include $(BUILD_SYSTEM)/base_rules.mk

$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/apkcheck$(COMMON_JAVA_PACKAGE_SUFFIX)
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/apkcheck | $(ACP)
@echo "Copy: $(PRIVATE_MODULE) ($@)"
$(copy-file-to-new-target)
$(hide) chmod 755 $@
LOCAL_SRC_FILES := etc/apkcheck
LOCAL_ADDITIONAL_DEPENDENCIES := $(HOST_OUT_JAVA_LIBRARIES)/apkcheck$(COMMON_JAVA_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)

# the other stuff
# ============================================================
Expand Down
15 changes: 3 additions & 12 deletions tools/rmtypedefs/Android.mk
Expand Up @@ -14,24 +14,15 @@

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.

# the execution script
# ============================================================
include $(CLEAR_VARS)
LOCAL_IS_HOST_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE := rmtypedefs

include $(BUILD_SYSTEM)/base_rules.mk

$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/rmtypedefs$(COMMON_JAVA_PACKAGE_SUFFIX)
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/rmtypedefs | $(ACP)
@echo "Copy: $(PRIVATE_MODULE) ($@)"
$(copy-file-to-new-target)
$(hide) chmod 755 $@
LOCAL_SRC_FILES := etc/rmtypedefs
LOCAL_ADDITIONAL_DEPENDENCIES := $(HOST_OUT_JAVA_LIBRARIES)/rmtypedefs$(COMMON_JAVA_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)

# the other stuff
# ============================================================
Expand Down

0 comments on commit f230a38

Please sign in to comment.