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) |
Julien Desprez | 71489f3 | 2017-03-03 12:46:34 +0000 | [diff] [blame] | 18 | # Module to compile protos for tradefed |
| 19 | LOCAL_MODULE := tradefed-protos |
| 20 | LOCAL_SRC_FILES := $(call all-proto-files-under, proto) |
| 21 | LOCAL_JAVA_LIBRARIES := host-libprotobuf-java-full |
| 22 | LOCAL_SOURCE_FILES_ALL_GENERATED := true |
| 23 | LOCAL_MODULE_TAGS := optional |
| 24 | |
| 25 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 26 | |
| 27 | include $(CLEAR_VARS) |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 28 | |
| 29 | # Only compile source java files in this lib. |
Julien Desprez | 71489f3 | 2017-03-03 12:46:34 +0000 | [diff] [blame] | 30 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 31 | |
Brett Chabot | e278a5b | 2010-06-01 16:20:14 -0700 | [diff] [blame] | 32 | LOCAL_JAVA_RESOURCE_DIRS := res |
| 33 | |
Guang Zhu | 040a43a | 2012-01-25 14:38:16 -0800 | [diff] [blame] | 34 | LOCAL_JAVACFLAGS += -g -Xlint |
Kevin Cheng | 75b65bd | 2017-04-06 16:18:43 -0700 | [diff] [blame] | 35 | -include tools/tradefederation/core/error_prone_rules.mk |
Guang Zhu | c5637f7 | 2011-07-24 13:15:24 -0700 | [diff] [blame] | 36 | |
Brett Chabot | 0aebe55 | 2010-09-13 14:26:46 -0700 | [diff] [blame] | 37 | LOCAL_MODULE := tradefed |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 38 | |
Brett Chabot | 36d4f87 | 2010-09-15 18:28:27 -0700 | [diff] [blame] | 39 | LOCAL_MODULE_TAGS := optional |
Guang Zhu | 8f607b1 | 2017-04-07 11:17:28 -0700 | [diff] [blame] | 40 | LOCAL_STATIC_JAVA_LIBRARIES := junit-host kxml2-2.3.0 jline-1.0 tf-remote-client commons-compress-prebuilt host-libprotobuf-java-full tradefed-protos |
Brett Chabot | fee380c | 2013-02-01 15:25:08 -0800 | [diff] [blame] | 41 | # emmalib is only a runtime dependency if generating code coverage reporters, |
| 42 | # not a compile time dependency |
Guang Zhu | 8f607b1 | 2017-04-07 11:17:28 -0700 | [diff] [blame] | 43 | LOCAL_JAVA_LIBRARIES := emmalib jack-jacoco-reporter loganalysis tools-common-prebuilt |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 44 | |
Julien Desprez | af73ee4 | 2015-12-11 14:03:29 +0000 | [diff] [blame] | 45 | LOCAL_JAR_MANIFEST := MANIFEST.mf |
| 46 | |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 47 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 48 | |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 49 | # makefile rules to copy jars to HOST_OUT/tradefed |
| 50 | # so tradefed.sh can automatically add to classpath |
| 51 | DEST_JAR := $(HOST_OUT)/tradefed/$(LOCAL_MODULE).jar |
| 52 | $(DEST_JAR): $(LOCAL_BUILT_MODULE) |
| 53 | $(copy-file-to-new-target) |
| 54 | |
Allen Hair | a913532 | 2016-08-15 17:41:09 -0700 | [diff] [blame] | 55 | $(HOST_OUT)/tradefed/%.jar : $(HOST_OUT_JAVA_LIBRARIES)/%.jar |
| 56 | $(copy-file-to-new-target) |
| 57 | |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 58 | # this dependency ensure the above rule will be executed if jar is built |
| 59 | $(LOCAL_INSTALLED_MODULE) : $(DEST_JAR) |
Allen Hair | a913532 | 2016-08-15 17:41:09 -0700 | [diff] [blame] | 60 | $(LOCAL_INSTALLED_MODULE) : $(foreach m, $(LOCAL_JAVA_LIBRARIES), $(HOST_OUT)/tradefed/$(m).jar) |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 61 | |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 62 | ####################################################### |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 63 | # intentionally skipping CLEAR_VARS |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 64 | # Enable the build process to generate javadoc |
Ying Wang | d786e24 | 2014-07-07 16:48:21 -0700 | [diff] [blame] | 65 | # We need to reference symbols in the jar built above. |
Billy Lamberta | bb7685c | 2017-02-24 11:12:32 -0800 | [diff] [blame] | 66 | |
| 67 | # ==== docs for legacy sac app engine |
| 68 | #LOCAL_MODULE = tradefed-sac-deprecated |
Omari Stephens | d62c471 | 2015-07-24 16:45:15 -0700 | [diff] [blame] | 69 | LOCAL_JAVA_LIBRARIES += tradefed |
| 70 | LOCAL_IS_HOST_MODULE:=true |
| 71 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 72 | LOCAL_ADDITIONAL_DEPENDENCIES := tradefed |
| 73 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sac |
| 74 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 75 | -package \ |
| 76 | -toroot / \ |
| 77 | -hdf android.whichdoc online \ |
| 78 | -hdf sac true \ |
| 79 | -hdf devices true \ |
Omari Stephens | aabdc0b | 2015-08-14 18:43:03 -0700 | [diff] [blame] | 80 | -showAnnotationOverridesVisibility \ |
Omari Stephens | d62c471 | 2015-07-24 16:45:15 -0700 | [diff] [blame] | 81 | -showAnnotation com.android.tradefed.config.OptionClass \ |
| 82 | -showAnnotation com.android.tradefed.config.Option \ |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 83 | |
Omari Stephens | d62c471 | 2015-07-24 16:45:15 -0700 | [diff] [blame] | 84 | include $(BUILD_DROIDDOC) |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 85 | |
Billy Lamberta | bb7685c | 2017-02-24 11:12:32 -0800 | [diff] [blame] | 86 | # ==== docs for the web (on the devsite app engine server) |
| 87 | LOCAL_MODULE = tradefed-ds |
| 88 | LOCAL_JAVA_LIBRARIES += tradefed |
| 89 | LOCAL_IS_HOST_MODULE := true |
| 90 | LOCAL_MODULE_CLASS := JAVA_LIBRARIES |
| 91 | LOCAL_ADDITIONAL_DEPENDENCIES := tradefed libcore/Docs.mk |
| 92 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := external/doclava/res/assets/templates-sdk |
| 93 | LOCAL_DROIDDOC_OPTIONS := \ |
| 94 | -hdf sac true \ |
| 95 | -hdf devices true \ |
| 96 | -hdf android.whichdoc online \ |
| 97 | -hdf css.path /reference/assets/css/doclava-devsite.css \ |
| 98 | -hdf book.root toc \ |
| 99 | -yaml _toc.yaml \ |
| 100 | -apidocsdir reference/tradefed/ \ |
| 101 | -werror \ |
| 102 | -package \ |
| 103 | -devsite \ |
| 104 | |
| 105 | include $(BUILD_DROIDDOC) |
| 106 | |
Omari Stephens | 966291b | 2013-03-06 21:09:21 -0800 | [diff] [blame] | 107 | ####################################################### |
Omari Stephens | 6aeef7c | 2011-10-19 17:14:47 -0700 | [diff] [blame] | 108 | include $(CLEAR_VARS) |
| 109 | |
| 110 | # Create a simple alias to build all the TF-related targets |
| 111 | # Note that this is incompatible with `make dist`. If you want to make |
| 112 | # the distribution, you must run `tapas` with the individual target names. |
| 113 | .PHONY: tradefed-all |
Omari Stephens | 6e3c34d | 2015-04-14 18:40:33 -0700 | [diff] [blame] | 114 | 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] | 115 | |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 116 | # ==================================== |
| 117 | include $(CLEAR_VARS) |
| 118 | # copy tradefed.sh script to host dir |
| 119 | |
| 120 | LOCAL_MODULE_TAGS := optional |
| 121 | |
Tsu Chiang Chuang | 3f22417 | 2016-05-12 12:33:43 -0700 | [diff] [blame] | 122 | LOCAL_PREBUILT_EXECUTABLES := tradefed.sh tradefed_win.bat script_help.sh verify.sh run_tf_cmd.sh |
Brett Chabot | 4bd67d5 | 2011-02-07 11:54:37 -0800 | [diff] [blame] | 123 | include $(BUILD_HOST_PREBUILT) |
| 124 | |
Brett Chabot | f72f44c | 2010-01-27 11:09:46 -0800 | [diff] [blame] | 125 | # Build all sub-directories |
| 126 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 127 | |
| 128 | ######################################################## |
Omari Stephens | 06bcef1 | 2015-05-06 16:26:49 -0700 | [diff] [blame] | 129 | # Zip up the built files and dist it as tradefed.zip |
| 130 | ifneq (,$(filter tradefed tradefed-all, $(TARGET_BUILD_APPS))) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 131 | |
Guang Zhu | 7f90749 | 2017-01-06 12:02:58 -0800 | [diff] [blame] | 132 | tradefed_dist_host_jars := tradefed tradefed-tests tf-prod-tests emmalib jack-jacoco-reporter loganalysis loganalysis-tests tf-remote-client |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 133 | tradefed_dist_host_jar_files := $(foreach m, $(tradefed_dist_host_jars), $(HOST_OUT_JAVA_LIBRARIES)/$(m).jar) |
| 134 | |
Tsu Chiang Chuang | 3f22417 | 2016-05-12 12:33:43 -0700 | [diff] [blame] | 135 | tradefed_dist_host_exes := tradefed.sh tradefed_win.bat script_help.sh verify.sh run_tf_cmd.sh |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 136 | tradefed_dist_host_exe_files := $(foreach m, $(tradefed_dist_host_exes), $(BUILD_OUT_EXECUTABLES)/$(m)) |
| 137 | |
David Hu | 6fb582f | 2012-12-19 18:49:19 -0800 | [diff] [blame] | 138 | tradefed_dist_test_apks := TradeFedUiTestApp TradeFedTestApp DeviceSetupUtil |
Ying Wang | 0f9b11c | 2014-07-21 14:03:11 -0700 | [diff] [blame] | 139 | 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] | 140 | |
| 141 | tradefed_dist_files := \ |
| 142 | $(tradefed_dist_host_jar_files) \ |
| 143 | $(tradefed_dist_test_apk_files) \ |
Brett Chabot | fee380c | 2013-02-01 15:25:08 -0800 | [diff] [blame] | 144 | $(tradefed_dist_host_exe_files) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 145 | |
| 146 | tradefed_dist_intermediates := $(call intermediates-dir-for,PACKAGING,tradefed_dist,HOST,COMMON) |
| 147 | tradefed_dist_zip := $(tradefed_dist_intermediates)/tradefed.zip |
| 148 | $(tradefed_dist_zip) : $(tradefed_dist_files) |
| 149 | @echo "Package: $@" |
| 150 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 151 | $(hide) cp -f $^ $(dir $@) |
| 152 | $(hide) cd $(dir $@) && zip -q $(notdir $@) $(notdir $^) |
| 153 | |
Colin Cross | 2919790 | 2015-10-05 13:19:12 -0700 | [diff] [blame] | 154 | $(call dist-for-goals, apps_only, $(tradefed_dist_zip)) |
Omari Stephens | 64043d8 | 2012-01-27 18:14:56 -0800 | [diff] [blame] | 155 | |
| 156 | endif # tradefed in $(TARGET_BUILD_APPS) |