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) |
| 16 | |
| 17 | include $(CLEAR_VARS) |
| 18 | |
| 19 | # Only compile source java files in this lib. |
| 20 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 21 | |
Brett Chabot | e278a5b | 2010-06-01 16:20:14 -0700 | [diff] [blame] | 22 | LOCAL_JAVA_RESOURCE_DIRS := res |
| 23 | |
Guang Zhu | 040a43a | 2012-01-25 14:38:16 -0800 | [diff] [blame] | 24 | LOCAL_JAVACFLAGS += -g -Xlint |
Guang Zhu | c5637f7 | 2011-07-24 13:15:24 -0700 | [diff] [blame] | 25 | |
Brett Chabot | 0aebe55 | 2010-09-13 14:26:46 -0700 | [diff] [blame] | 26 | LOCAL_MODULE := tradefed |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 27 | |
Brett Chabot | 36d4f87 | 2010-09-15 18:28:27 -0700 | [diff] [blame] | 28 | LOCAL_MODULE_TAGS := optional |
Brett Chabot | 6ce689e | 2014-03-11 13:12:21 -0700 | [diff] [blame] | 29 | LOCAL_STATIC_JAVA_LIBRARIES := junit kxml2-2.3.0 jline-1.0 tf-remote-client |
Brett Chabot | fee380c | 2013-02-01 15:25:08 -0800 | [diff] [blame] | 30 | # emmalib is only a runtime dependency if generating code coverage reporters, |
| 31 | # not a compile time dependency |
Brett Chabot | 030e843 | 2014-09-24 19:22:39 -0700 | [diff] [blame] | 32 | LOCAL_JAVA_LIBRARIES := emmalib tools-common-prebuilt |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 33 | |
| 34 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 35 | |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 36 | # makefile rules to copy jars to HOST_OUT/tradefed |
| 37 | # so tradefed.sh can automatically add to classpath |
| 38 | DEST_JAR := $(HOST_OUT)/tradefed/$(LOCAL_MODULE).jar |
| 39 | $(DEST_JAR): $(LOCAL_BUILT_MODULE) |
| 40 | $(copy-file-to-new-target) |
| 41 | |
| 42 | # this dependency ensure the above rule will be executed if jar is built |
| 43 | $(LOCAL_INSTALLED_MODULE) : $(DEST_JAR) |
| 44 | |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 45 | ####################################################### |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 46 | # intentionally skipping CLEAR_VARS |
| 47 | |
| 48 | # Enable the build process to generate javadoc |
Ying Wang | d786e24 | 2014-07-07 16:48:21 -0700 | [diff] [blame] | 49 | # We need to reference symbols in the jar built above. |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 50 | |
Omari Stephens | 38309a1 | 2015-07-24 16:24:26 -0700 | [diff] [blame] | 51 | ### temporarily disable docs builds until they build across all product types |
| 52 | ### LOCAL_JAVA_LIBRARIES += tradefed |
| 53 | ### LOCAL_IS_HOST_MODULE:=true |
| 54 | ### LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 55 | ### LOCAL_ADDITIONAL_DEPENDENCIES := tradefed |
| 56 | ### LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sac |
| 57 | ### LOCAL_DROIDDOC_OPTIONS:= \ |
| 58 | ### -package \ |
| 59 | ### -toroot / \ |
| 60 | ### -hdf android.whichdoc online \ |
| 61 | ### -hdf sac true \ |
| 62 | ### -hdf devices true \ |
| 63 | ### -showAnnotation com.android.tradefed.config.OptionClass \ |
| 64 | ### -showAnnotation com.android.tradefed.config.Option \ |
| 65 | ### |
| 66 | ### include $(BUILD_DROIDDOC) |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 67 | |
| 68 | ####################################################### |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 69 | include $(CLEAR_VARS) |
| 70 | |
| 71 | # Create a simple alias to build all the TF-related targets |
| 72 | # Note that this is incompatible with `make dist`. If you want to make |
| 73 | # the distribution, you must run `tapas` with the individual target names. |
| 74 | .PHONY: tradefed-all |
Omari Stephens | 6e3c34d | 2015-04-14 18:40:33 -0700 | [diff] [blame] | 75 | tradefed-all: tradefed tradefed-tests tf-prod-tests tf-prod-metatests tradefed_win script_help verify |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 76 | |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 77 | # ==================================== |
| 78 | include $(CLEAR_VARS) |
| 79 | # copy tradefed.sh script to host dir |
| 80 | |
| 81 | LOCAL_MODULE_TAGS := optional |
| 82 | |
Omari Stephens | 6e3c34d | 2015-04-14 18:40:33 -0700 | [diff] [blame] | 83 | LOCAL_PREBUILT_EXECUTABLES := tradefed.sh tradefed_win.bat script_help.sh verify.sh |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 84 | include $(BUILD_HOST_PREBUILT) |
| 85 | |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 86 | # Build all sub-directories |
| 87 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 88 | |
| 89 | ######################################################## |
Omari Stephens | 06bcef1 | 2015-05-06 16:26:49 -0700 | [diff] [blame] | 90 | # Zip up the built files and dist it as tradefed.zip |
| 91 | ifneq (,$(filter tradefed tradefed-all, $(TARGET_BUILD_APPS))) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 92 | |
Brett Chabot | 030e843 | 2014-09-24 19:22:39 -0700 | [diff] [blame] | 93 | tradefed_dist_host_jars := tradefed tradefed-tests tf-prod-tests emmalib loganalysis loganalysis-tests tf-remote-client |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 94 | tradefed_dist_host_jar_files := $(foreach m, $(tradefed_dist_host_jars), $(HOST_OUT_JAVA_LIBRARIES)/$(m).jar) |
| 95 | |
Omari Stephens | 6e3c34d | 2015-04-14 18:40:33 -0700 | [diff] [blame] | 96 | tradefed_dist_host_exes := tradefed.sh tradefed_win.bat script_help.sh verify.sh |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 97 | tradefed_dist_host_exe_files := $(foreach m, $(tradefed_dist_host_exes), $(BUILD_OUT_EXECUTABLES)/$(m)) |
| 98 | |
David Hu | 6fb582f | 2012-12-19 18:49:19 -0800 | [diff] [blame] | 99 | tradefed_dist_test_apks := TradeFedUiTestApp TradeFedTestApp DeviceSetupUtil |
Ying Wang | 0f9b11c | 2014-07-21 14:03:11 -0700 | [diff] [blame] | 100 | tradefed_dist_test_apk_files := $(foreach m, $(tradefed_dist_test_apks), $(TARGET_OUT_DATA_APPS)/$(m)/$(m).apk) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 101 | |
| 102 | tradefed_dist_files := \ |
| 103 | $(tradefed_dist_host_jar_files) \ |
| 104 | $(tradefed_dist_test_apk_files) \ |
Brett Chabot | fee380c | 2013-02-01 15:25:08 -0800 | [diff] [blame] | 105 | $(tradefed_dist_host_exe_files) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 106 | |
| 107 | tradefed_dist_intermediates := $(call intermediates-dir-for,PACKAGING,tradefed_dist,HOST,COMMON) |
| 108 | tradefed_dist_zip := $(tradefed_dist_intermediates)/tradefed.zip |
| 109 | $(tradefed_dist_zip) : $(tradefed_dist_files) |
| 110 | @echo "Package: $@" |
| 111 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 112 | $(hide) cp -f $^ $(dir $@) |
| 113 | $(hide) cd $(dir $@) && zip -q $(notdir $@) $(notdir $^) |
| 114 | |
| 115 | .PHONY: tradefed_dist |
| 116 | tradefed_dist : $(tradefed_dist_zip) |
| 117 | |
| 118 | $(call dist-for-goals, tradefed_dist, $(tradefed_dist_zip)) |
| 119 | dist: tradefed_dist |
| 120 | |
| 121 | endif # tradefed in $(TARGET_BUILD_APPS) |