Tsu Chiang Chuang | 9a223d7 | 2011-04-27 17:19:46 -0700 | [diff] [blame] | 1 | # Copyright (C) 2011 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | LOCAL_PATH := $(call my-dir) |
| 16 | |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 17 | # test dex library |
| 18 | # ============================================================ |
| 19 | include $(CLEAR_VARS) |
| 20 | |
| 21 | # custom variables used to generate test description. do not touch! |
| 22 | LOCAL_SRC_FILES := $(call all-java-files-under, src/dot) |
| 23 | |
| 24 | LOCAL_MODULE := cts-tf-dalvik-lib |
| 25 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 26 | LOCAL_MODULE_TAGS := optional |
Paul Duffin | 679403a | 2016-12-01 13:31:31 +0000 | [diff] [blame] | 27 | LOCAL_JAVA_LIBRARIES := junit |
jdesprez | 03a03be | 2017-05-05 15:07:59 -0700 | [diff] [blame] | 28 | -include cts/error_prone_rules_tests.mk |
Yohann Roussel | 71044b3 | 2015-01-26 13:47:48 +0100 | [diff] [blame] | 29 | include $(BUILD_JAVA_LIBRARY) |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 30 | |
| 31 | cts-tf-dalvik-lib.jack := $(full_classes_jack) |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 32 | cts-tf-dalvik-lib.jar := $(full_classes_jar) |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 33 | |
Tsu Chiang Chuang | 9a223d7 | 2011-04-27 17:19:46 -0700 | [diff] [blame] | 34 | # buildutil java library |
| 35 | # ============================================================ |
| 36 | include $(CLEAR_VARS) |
| 37 | |
Stuart Scott | 140f797 | 2016-02-19 16:54:54 -0800 | [diff] [blame] | 38 | # custom variables used by cts/tools/utils/CollectAllTests.java to generate test description. do not touch! |
| 39 | LOCAL_TEST_TYPE := vmHostTest |
| 40 | LOCAL_JAR_PATH := android.core.vm-tests-tf.jar |
| 41 | |
Ying Wang | 80925b5 | 2012-08-21 11:45:29 -0700 | [diff] [blame] | 42 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
Tsu Chiang Chuang | 9a223d7 | 2011-04-27 17:19:46 -0700 | [diff] [blame] | 43 | |
| 44 | LOCAL_MODULE := cts-tf-dalvik-buildutil |
| 45 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 46 | LOCAL_MODULE_TAGS := optional |
| 47 | |
Paul Duffin | 53e62bc | 2016-11-23 15:54:01 +0000 | [diff] [blame] | 48 | LOCAL_JAVA_LIBRARIES := dx dasm cfassembler junit-host jsr305lib |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 49 | |
Yohann Roussel | b8654bf | 2016-02-16 12:47:32 +0100 | [diff] [blame] | 50 | LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR) |
Tsu Chiang Chuang | 9a223d7 | 2011-04-27 17:19:46 -0700 | [diff] [blame] | 51 | |
| 52 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 53 | |
Ying Wang | 80925b5 | 2012-08-21 11:45:29 -0700 | [diff] [blame] | 54 | # Buid android.core.vm-tests-tf.jar |
| 55 | # ============================================================ |
| 56 | # |
Yohann Roussel | 01d7b56 | 2015-02-02 17:47:40 +0100 | [diff] [blame] | 57 | include $(CLEAR_VARS) |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 58 | |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 59 | include $(BUILD_SYSTEM)/configure_local_jack.mk |
| 60 | |
Ying Wang | b18d921 | 2016-02-19 11:40:08 -0800 | [diff] [blame] | 61 | LOCAL_MODULE := vm-tests-tf |
| 62 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 63 | LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX) |
| 64 | LOCAL_IS_HOST_MODULE := true |
| 65 | LOCAL_BUILT_MODULE_STEM := javalib.jar |
| 66 | intermediates := $(call local-intermediates-dir) |
| 67 | # Install the module as $(intermediates)/android.core.vm-tests-tf.jar. |
| 68 | LOCAL_INSTALLED_MODULE_STEM := android.core.vm-tests-tf.jar |
| 69 | LOCAL_MODULE_PATH := $(intermediates) |
| 70 | |
Stuart Scott | 2ff78ae | 2016-02-18 19:25:52 -0800 | [diff] [blame] | 71 | # Tag this module as a cts test artifact |
nickrose | f1efbc6 | 2017-07-05 12:38:06 -0700 | [diff] [blame] | 72 | LOCAL_COMPATIBILITY_SUITE := cts vts general-tests |
Ying Wang | b18d921 | 2016-02-19 11:40:08 -0800 | [diff] [blame] | 73 | |
| 74 | include $(BUILD_SYSTEM)/base_rules.mk |
| 75 | |
Tobias Thierer | 2ee7971 | 2017-05-09 22:01:38 +0100 | [diff] [blame] | 76 | vmteststf_dep_jars := \ |
| 77 | $(HOST_JDK_TOOLS_JAR) \ |
| 78 | $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/, cts-tf-dalvik-buildutil.jar dasm.jar dx.jar cfassembler.jar junit-host.jar) |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 79 | |
Ying Wang | b18d921 | 2016-02-19 11:40:08 -0800 | [diff] [blame] | 80 | $(LOCAL_BUILT_MODULE): PRIVATE_JACK_EXTRA_ARGS := $(LOCAL_JACK_EXTRA_ARGS) |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 81 | |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 82 | ifdef LOCAL_JACK_ENABLED |
| 83 | vmteststf_dep_jars += $(cts-tf-dalvik-lib.jack) |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 84 | else |
| 85 | vmteststf_dep_jars += $(cts-tf-dalvik-lib.jar) |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 86 | endif |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 87 | |
Ying Wang | b18d921 | 2016-02-19 11:40:08 -0800 | [diff] [blame] | 88 | $(LOCAL_BUILT_MODULE): PRIVATE_SRC_FOLDER := $(LOCAL_PATH)/src |
| 89 | $(LOCAL_BUILT_MODULE): PRIVATE_INTERMEDIATES_CLASSES := $(call intermediates-dir-for,JAVA_LIBRARIES,cts-tf-dalvik-buildutil,HOST)/classes |
| 90 | $(LOCAL_BUILT_MODULE): PRIVATE_INTERMEDIATES := $(intermediates)/tests |
| 91 | $(LOCAL_BUILT_MODULE): PRIVATE_INTERMEDIATES_DEXCORE_JAR := $(intermediates)/tests/dot/junit/dexcore.jar |
| 92 | $(LOCAL_BUILT_MODULE): PRIVATE_INTERMEDIATES_MAIN_FILES := $(intermediates)/main_files |
| 93 | $(LOCAL_BUILT_MODULE): PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES := $(intermediates)/hostjunit_files |
Tobias Thierer | 2ee7971 | 2017-05-09 22:01:38 +0100 | [diff] [blame] | 94 | $(LOCAL_BUILT_MODULE): PRIVATE_CLASS_PATH := $(call normalize-path-list, $(vmteststf_dep_jars)) |
Yohann Roussel | 450354f | 2016-02-22 15:57:11 +0100 | [diff] [blame] | 95 | $(LOCAL_BUILT_MODULE): PRIVATE_JACK_VERSION := $(LOCAL_JACK_VERSION) |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 96 | ifndef LOCAL_JACK_ENABLED |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 97 | oj_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj,,COMMON)/classes.jar |
| 98 | libart_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,core-libart,,COMMON)/classes.jar |
| 99 | $(LOCAL_BUILT_MODULE): PRIVATE_DALVIK_SUITE_CLASSPATH := $(oj_jar):$(libart_jar):$(cts-tf-dalvik-lib.jar):$(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar: |
Guang Zhu | fea6cde | 2017-04-06 16:32:01 -0700 | [diff] [blame] | 100 | $(LOCAL_BUILT_MODULE) : $(vmteststf_dep_jars) $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 101 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 102 | $(hide) mkdir -p $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/dot/junit $(dir $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)) |
| 103 | # generated and compile the host side junit tests |
| 104 | @echo "Write generated Main_*.java files to $(PRIVATE_INTERMEDIATES_MAIN_FILES)" |
Colin Cross | 95fa051 | 2017-06-30 14:19:12 -0700 | [diff] [blame] | 105 | $(hide) $(JAVA) \ |
Tobias Thierer | cbcdff2 | 2017-05-22 15:38:36 +0100 | [diff] [blame] | 106 | $(if $(EXPERIMENTAL_USE_OPENJDK9),--add-exports jdk.jartool/sun.tools.jar=ALL-UNNAMED) \ |
| 107 | -cp $(PRIVATE_CLASS_PATH) util.build.BuildDalvikSuite $(PRIVATE_SRC_FOLDER) $(PRIVATE_INTERMEDIATES) \ |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 108 | $(PRIVATE_DALVIK_SUITE_CLASSPATH) \ |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 109 | $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(PRIVATE_INTERMEDIATES_CLASSES) $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES) $$RUN_VM_TESTS_RTO |
| 110 | @echo "Generate $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)" |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 111 | $(hide) $(JAR) -cf $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)-class.jar \ |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 112 | $(addprefix -C $(PRIVATE_INTERMEDIATES_CLASSES) , dot/junit/DxUtil.class dot/junit/DxAbstractMain.class) |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 113 | $(hide) mkdir -p $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).tmp |
| 114 | $(hide) $(DX) -JXms16M -JXmx768M --dex --output=$(PRIVATE_INTERMEDIATES_DEXCORE_JAR).tmp \ |
| 115 | $(if $(NO_OPTIMIZE_DX), --no-optimize) $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)-class.jar && rm -f $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jar |
| 116 | $(hide) cd $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).tmp && zip -q -r $(abspath $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)) . |
| 117 | $(hide) cd $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/classes && zip -q -r ../../$(notdir $@) . |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 118 | $(hide) cd $(dir $@) && zip -q -r $(notdir $@) tests |
Colin Cross | b0b3669 | 2017-08-01 17:15:20 -0700 | [diff] [blame^] | 119 | oj_jar := |
| 120 | libart_jar := |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 121 | else # LOCAL_JACK_ENABLED |
Narayan Kamath | 8dc7ffb | 2015-12-24 14:16:11 +0000 | [diff] [blame] | 122 | oj_jack := $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj,,COMMON)/classes.jack |
Shinichiro Hamaji | 2e85014 | 2015-11-30 17:17:59 +0900 | [diff] [blame] | 123 | libart_jack := $(call intermediates-dir-for,JAVA_LIBRARIES,core-libart,,COMMON)/classes.jack |
Julien Desprez | 26d92f2 | 2016-11-11 12:11:33 +0000 | [diff] [blame] | 124 | $(LOCAL_BUILT_MODULE): PRIVATE_DALVIK_SUITE_CLASSPATH := $(oj_jack):$(libart_jack):$(cts-tf-dalvik-lib.jack):$(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar |
| 125 | $(LOCAL_BUILT_MODULE) : $(vmteststf_dep_jars) $(JACK) $(oj_jack) $(libart_jack) $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar | setup-jack-server |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 126 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 127 | $(hide) mkdir -p $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/dot/junit $(dir $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)) |
| 128 | # generated and compile the host side junit tests |
| 129 | @echo "Write generated Main_*.java files to $(PRIVATE_INTERMEDIATES_MAIN_FILES)" |
Colin Cross | 95fa051 | 2017-06-30 14:19:12 -0700 | [diff] [blame] | 130 | $(hide) JACK_VERSION=$(PRIVATE_JACK_VERSION) $(JAVA) -cp $(PRIVATE_CLASS_PATH) util.build.JackBuildDalvikSuite $(JACK) $(PRIVATE_SRC_FOLDER) $(PRIVATE_INTERMEDIATES) \ |
Shinichiro Hamaji | 2e85014 | 2015-11-30 17:17:59 +0900 | [diff] [blame] | 131 | $(PRIVATE_DALVIK_SUITE_CLASSPATH) \ |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 132 | $(PRIVATE_INTERMEDIATES_MAIN_FILES) $(PRIVATE_INTERMEDIATES_CLASSES) $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES) $$RUN_VM_TESTS_RTO |
| 133 | @echo "Generate $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)" |
Colin Cross | 95fa051 | 2017-06-30 14:19:12 -0700 | [diff] [blame] | 134 | $(hide) $(JAR) -cf $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)-class.jar \ |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 135 | $(addprefix -C $(PRIVATE_INTERMEDIATES_CLASSES) , dot/junit/DxUtil.class dot/junit/DxAbstractMain.class) |
Yohann Roussel | 450354f | 2016-02-22 15:57:11 +0100 | [diff] [blame] | 136 | $(hide) $(call call-jack) --import $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)-class.jar --output-jack $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jack |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 137 | $(hide) mkdir -p $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).tmp |
Yohann Roussel | 0acccbb | 2015-07-02 12:12:30 +0200 | [diff] [blame] | 138 | $(hide) $(call call-jack,$(PRIVATE_JACK_EXTRA_ARGS)) --output-dex $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).tmp \ |
Yohann Roussel | 1046142 | 2014-09-25 10:13:32 +0200 | [diff] [blame] | 139 | $(if $(NO_OPTIMIZE_DX), -D jack.dex.optimize "false") --import $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jack && rm -f $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).jack |
| 140 | $(hide) cd $(PRIVATE_INTERMEDIATES_DEXCORE_JAR).tmp && zip -q -r $(abspath $(PRIVATE_INTERMEDIATES_DEXCORE_JAR)) . |
Ying Wang | b18d921 | 2016-02-19 11:40:08 -0800 | [diff] [blame] | 141 | $(hide) cd $(PRIVATE_INTERMEDIATES_HOSTJUNIT_FILES)/classes && zip -q -r ../../$(notdir $@) . |
| 142 | $(hide) cd $(dir $@) && zip -q -r $(notdir $@) tests |
Narayan Kamath | 8dc7ffb | 2015-12-24 14:16:11 +0000 | [diff] [blame] | 143 | oj_jack := |
Shinichiro Hamaji | 2e85014 | 2015-11-30 17:17:59 +0900 | [diff] [blame] | 144 | libart_jack := |
Colin Cross | 63cd6af | 2017-01-18 13:46:00 -0800 | [diff] [blame] | 145 | endif # LOCAL_JACK_ENABLED |
Tsu Chiang Chuang | 9a223d7 | 2011-04-27 17:19:46 -0700 | [diff] [blame] | 146 | |
Ying Wang | 80925b5 | 2012-08-21 11:45:29 -0700 | [diff] [blame] | 147 | # Clean up temp vars |
| 148 | intermediates := |
Ying Wang | 80925b5 | 2012-08-21 11:45:29 -0700 | [diff] [blame] | 149 | vmteststf_dep_jars := |
Stuart Scott | 140f797 | 2016-02-19 16:54:54 -0800 | [diff] [blame] | 150 | |
Yohann Roussel | 450354f | 2016-02-22 15:57:11 +0100 | [diff] [blame] | 151 | include $(call all-makefiles-under,$(LOCAL_PATH)) |