Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 1 | # Copyright (C) 2010 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) |
Dan Shi | 1564c7b | 2017-12-12 14:03:43 -0800 | [diff] [blame] | 16 | COMPATIBILITY.tradefed_tests_dir := \ |
Julien Desprez | 2901024 | 2018-10-23 10:42:48 -0700 | [diff] [blame] | 17 | $(COMPATIBILITY.tradefed_tests_dir) $(LOCAL_PATH)/res/config $(LOCAL_PATH)/tests/res/config |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 18 | |
Colin Cross | a48b567 | 2019-10-21 18:31:07 +0000 | [diff] [blame] | 19 | include $(CLEAR_VARS) |
| 20 | |
| 21 | # makefile rules to copy jars to HOST_OUT/tradefed |
| 22 | # so tradefed.sh can automatically add to classpath |
| 23 | deps := $(call copy-many-files,\ |
| 24 | $(call intermediates-dir-for,JAVA_LIBRARIES,tradefed,HOST)/javalib.jar:$(HOST_OUT)/tradefed/tradefed.jar) |
| 25 | |
Joseph Murphy | b927bf6 | 2019-09-30 19:17:00 -0700 | [diff] [blame] | 26 | isodeps := $(call copy-many-files,\ |
| 27 | $(call intermediates-dir-for,JAVA_LIBRARIES,tradefed-isolation,HOST)/javalib.jar:$(HOST_OUT)/tradefed/tradefed-isolation.jar) |
| 28 | |
Colin Cross | a48b567 | 2019-10-21 18:31:07 +0000 | [diff] [blame] | 29 | # this dependency ensures the above rule will be executed if jar is installed |
Joseph Murphy | b927bf6 | 2019-09-30 19:17:00 -0700 | [diff] [blame] | 30 | $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar : $(deps) $(isodeps) |
Colin Cross | a48b567 | 2019-10-21 18:31:07 +0000 | [diff] [blame] | 31 | # The copy rule for loganalysis is in tools/loganalysis/Android.mk |
| 32 | $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar : $(HOST_OUT)/tradefed/loganalysis.jar |
| 33 | |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 34 | ####################################################### |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 35 | |
| 36 | # Create a simple alias to build all the TF-related targets |
| 37 | # Note that this is incompatible with `make dist`. If you want to make |
| 38 | # the distribution, you must run `tapas` with the individual target names. |
mikehoran | c80dc53 | 2017-11-14 14:30:06 -0800 | [diff] [blame] | 39 | .PHONY: tradefed-core |
Joseph Murphy | b927bf6 | 2019-09-30 19:17:00 -0700 | [diff] [blame] | 40 | tradefed-core: tradefed tradefed-isolation atest_tradefed.sh tradefed-contrib tf-contrib-tests script_help.sh tradefed.sh |
mikehoran | c80dc53 | 2017-11-14 14:30:06 -0800 | [diff] [blame] | 41 | |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 42 | .PHONY: tradefed-all |
Julien Desprez | 9036ca6 | 2019-07-01 09:25:38 -0700 | [diff] [blame] | 43 | tradefed-all: tradefed-core tradefed-tests tradefed_win loganalysis-tests |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 44 | |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 45 | ######################################################## |
Omari Stephens | 06bcef1 | 2015-05-06 16:26:49 -0700 | [diff] [blame] | 46 | # Zip up the built files and dist it as tradefed.zip |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 47 | |
Joseph Murphy | b927bf6 | 2019-09-30 19:17:00 -0700 | [diff] [blame] | 48 | tradefed_dist_host_jars := tradefed tradefed-tests loganalysis loganalysis-tests tf-remote-client tradefed-contrib tf-contrib-tests tradefed-isolation |
Julien Desprez | 9036ca6 | 2019-07-01 09:25:38 -0700 | [diff] [blame] | 49 | tradefed_dist_host_exes := tradefed.sh tradefed_win.bat script_help.sh run_tf_cmd.sh atest_tradefed.sh |
David Hu | 6fb582f | 2012-12-19 18:49:19 -0800 | [diff] [blame] | 50 | tradefed_dist_test_apks := TradeFedUiTestApp TradeFedTestApp DeviceSetupUtil |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 51 | |
Dan Willemsen | c133acc | 2019-01-23 21:48:58 -0800 | [diff] [blame] | 52 | # Generate a src:dest list of copies to perform. |
| 53 | # The source should always be an intermediate / source location, not the |
| 54 | # installed location, as that will force installation, and cause this zip to be |
| 55 | # regenerated too often during incremental builds. |
| 56 | tradefed_dist_copy_pairs := $(foreach m, $(tradefed_dist_host_jars), $(call intermediates-dir-for,JAVA_LIBRARIES,$(m),HOST,COMMON)/javalib.jar:$(m).jar) |
| 57 | tradefed_dist_copy_pairs += $(foreach m, $(tradefed_dist_host_exes), $(LOCAL_PATH)/$(m):$(m)) |
| 58 | tradefed_dist_copy_pairs += $(foreach m, $(tradefed_dist_test_apks), $(call intermediates-dir-for,APPS,$(m))/package.apk:$(m).apk) |
| 59 | |
| 60 | tradefed_dist_host_jars := |
| 61 | tradefed_dist_host_exes := |
| 62 | tradefed_dist_test_apks := |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 63 | |
| 64 | tradefed_dist_intermediates := $(call intermediates-dir-for,PACKAGING,tradefed_dist,HOST,COMMON) |
| 65 | tradefed_dist_zip := $(tradefed_dist_intermediates)/tradefed.zip |
Dan Willemsen | c133acc | 2019-01-23 21:48:58 -0800 | [diff] [blame] | 66 | $(tradefed_dist_zip) : PRIVATE_COPY_PAIRS := $(tradefed_dist_copy_pairs) |
| 67 | $(tradefed_dist_zip) : $(SOONG_ZIP) $(foreach f,$(tradefed_dist_copy_pairs),$(call word-colon,1,$(f))) |
| 68 | rm -rf $(dir $@)/tmp && mkdir -p $(dir $@)/tmp |
| 69 | $(foreach f,$(PRIVATE_COPY_PAIRS), \ |
| 70 | cp -f $(call word-colon,1,$(f)) $(dir $@)/tmp/$(call word-colon,2,$(f)) &&) true |
| 71 | echo $(BUILD_NUMBER_FROM_FILE) > $(dir $@)/tmp/version.txt |
| 72 | $(SOONG_ZIP) -o $@ -C $(dir $@)/tmp -f $(dir $@)/tmp/version.txt \ |
| 73 | $(foreach f,$(PRIVATE_COPY_PAIRS),-f $(dir $@)/tmp/$(call word-colon,2,$(f))) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 74 | |
Julien Desprez | c4ae1de | 2018-09-05 10:51:31 -0700 | [diff] [blame] | 75 | $(call dist-for-goals, tradefed, $(tradefed_dist_zip)) |
Dan Willemsen | c133acc | 2019-01-23 21:48:58 -0800 | [diff] [blame] | 76 | |
| 77 | tradefed_dist_copy_pairs := |
| 78 | tradefed_dist_intermediates := |
| 79 | tradefed_dist_zip := |
| 80 | |
| 81 | # Build all sub-directories |
| 82 | include $(call all-makefiles-under,$(LOCAL_PATH)) |