Andreas Gampe | d6c02c8 | 2018-05-14 10:52:06 -0700 | [diff] [blame] | 1 | // Copyright 2018 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 | // Set of error prone rules to ensure code quality |
| 16 | // PackageLocation check requires the androidCompatible=false otherwise it does not do anything. |
| 17 | java_defaults { |
| 18 | name: "tradefed_errorprone_defaults", |
| 19 | errorprone: { |
| 20 | javacflags: [ |
| 21 | "-XDandroidCompatible=false", |
| 22 | "-Xep:ArrayToString:ERROR", |
| 23 | "-Xep:BoxedPrimitiveConstructor:ERROR", |
| 24 | "-Xep:ConstantField:ERROR", |
| 25 | "-Xep:DeadException:ERROR", |
| 26 | "-Xep:EqualsIncompatibleType:ERROR", |
Julien Desprez | e2fb5aa | 2019-03-26 10:49:01 -0700 | [diff] [blame] | 27 | "-Xep:ExtendingJUnitAssert:ERROR", |
Andreas Gampe | d6c02c8 | 2018-05-14 10:52:06 -0700 | [diff] [blame] | 28 | "-Xep:FormatString:ERROR", |
| 29 | "-Xep:GetClassOnClass:ERROR", |
| 30 | "-Xep:IdentityBinaryExpression:ERROR", |
| 31 | "-Xep:JUnit3TestNotRun:ERROR", |
Julien Desprez | f9e8c28 | 2019-12-03 15:56:59 -0800 | [diff] [blame] | 32 | "-Xep:JUnit4TestNotRun:ERROR", |
Andreas Gampe | d6c02c8 | 2018-05-14 10:52:06 -0700 | [diff] [blame] | 33 | "-Xep:JUnit4ClassUsedInJUnit3:ERROR", |
| 34 | "-Xep:JUnitAmbiguousTestClass:ERROR", |
| 35 | "-Xep:MissingFail:ERROR", |
| 36 | "-Xep:MissingOverride:ERROR", |
Julien Desprez | e2fb5aa | 2019-03-26 10:49:01 -0700 | [diff] [blame] | 37 | "-Xep:ModifiedButNotUsed:ERROR", |
Andreas Gampe | d6c02c8 | 2018-05-14 10:52:06 -0700 | [diff] [blame] | 38 | "-Xep:MustBeClosedChecker:ERROR", |
| 39 | "-Xep:Overrides:ERROR", |
| 40 | "-Xep:PackageLocation:ERROR", |
Julien Desprez | e2fb5aa | 2019-03-26 10:49:01 -0700 | [diff] [blame] | 41 | "-Xep:ParameterName:ERROR", |
Andreas Gampe | d6c02c8 | 2018-05-14 10:52:06 -0700 | [diff] [blame] | 42 | "-Xep:ReferenceEquality:ERROR", |
| 43 | "-Xep:RemoveUnusedImports:ERROR", |
| 44 | "-Xep:ReturnValueIgnored:ERROR", |
| 45 | "-Xep:SelfEquals:ERROR", |
| 46 | "-Xep:SizeGreaterThanOrEqualsZero:ERROR", |
| 47 | "-Xep:TryFailThrowable:ERROR", |
| 48 | ], |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | java_defaults { |
| 53 | name: "tradefed_defaults", |
| 54 | defaults: [ "tradefed_errorprone_defaults" ], |
| 55 | javacflags: [ |
| 56 | "-g", |
| 57 | "-Xlint", |
| 58 | ], |
| 59 | } |
| 60 | |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 61 | java_library_host { |
| 62 | name: "tradefed-protos", |
| 63 | srcs: ["proto/**/*.proto"], |
| 64 | libs: [ |
| 65 | "libprotobuf-java-full", |
| 66 | ], |
| 67 | proto: { |
| 68 | include_dirs: ["external/protobuf/src"], |
| 69 | type: "full", |
| 70 | }, |
| 71 | static_libs: [ |
| 72 | "platformprotos", |
Julien Desprez | f7f52e8 | 2019-05-24 13:33:10 -0700 | [diff] [blame] | 73 | "asuite_proto_java", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 74 | ], |
| 75 | } |
| 76 | |
Julien Desprez | e96a292 | 2019-07-12 17:21:16 -0700 | [diff] [blame] | 77 | // Main Target to build tradefed jar |
Colin Cross | a48b567 | 2019-10-21 18:31:07 +0000 | [diff] [blame] | 78 | java_library_host { |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 79 | name: "tradefed", |
| 80 | defaults: ["tradefed_defaults"], |
Julien Desprez | e96a292 | 2019-07-12 17:21:16 -0700 | [diff] [blame] | 81 | java_resource_dirs: [ |
| 82 | "res", |
| 83 | ], |
| 84 | static_libs: [ |
Julien Desprez | 8f41e99 | 2019-07-15 11:43:55 -0700 | [diff] [blame] | 85 | "tradefed-lib-core", |
Julien Desprez | e96a292 | 2019-07-12 17:21:16 -0700 | [diff] [blame] | 86 | "tradefed-test-framework", |
| 87 | ], |
| 88 | manifest: "MANIFEST.mf", |
| 89 | } |
| 90 | |
| 91 | java_library_host { |
Julien Desprez | 8f41e99 | 2019-07-15 11:43:55 -0700 | [diff] [blame] | 92 | name: "tradefed-lib-core", |
Julien Desprez | e96a292 | 2019-07-12 17:21:16 -0700 | [diff] [blame] | 93 | defaults: ["tradefed_defaults"], |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 94 | srcs: [ |
| 95 | "src/**/*.java", |
Julien Desprez | 11b062a | 2019-06-17 13:25:01 -0700 | [diff] [blame] | 96 | "global_configuration/**/*.java", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 97 | ], |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 98 | static_libs: [ |
Julien Desprez | 813ef6f | 2019-05-29 13:03:22 -0700 | [diff] [blame] | 99 | "tradefed-common-util", |
Julien Desprez | 59583c3 | 2019-06-10 18:51:55 -0700 | [diff] [blame] | 100 | "tradefed-clearcut-client", |
Julien Desprez | 0b6e772 | 2019-06-17 14:55:17 -0700 | [diff] [blame] | 101 | "tradefed-result-interfaces", |
| 102 | "tradefed-device-build-interfaces", |
Julien Desprez | e96a292 | 2019-07-12 17:21:16 -0700 | [diff] [blame] | 103 | "tradefed-invocation-interfaces", |
Julien Desprez | 9597b09 | 2019-06-11 00:15:48 +0000 | [diff] [blame] | 104 | "protobuf-java-util-prebuilt-jar", |
Daniel Peykov | e304789 | 2018-11-01 13:08:35 -0700 | [diff] [blame] | 105 | "aoa-helper", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 106 | "error_prone_annotations-2.0.18", |
| 107 | "google-api-java-client-min-repackaged", |
Julien Desprez | 512e39d | 2018-11-09 11:02:21 -0800 | [diff] [blame] | 108 | "google-api-services-compute", |
Xing Dai | 83562b7 | 2019-01-02 12:13:10 -0800 | [diff] [blame] | 109 | "google-api-services-storage", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 110 | "gson-prebuilt-jar", |
| 111 | "guice", |
Oliver Nguyen | d15cc75 | 2018-11-02 15:44:45 -0700 | [diff] [blame] | 112 | "jacoco-cli", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 113 | "jline-1.0", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 114 | "junit-params", |
| 115 | "kxml2-2.3.0", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 116 | "libprotobuf-java-full", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 117 | "platform-test-annotations", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 118 | "tf-remote-client", |
| 119 | "tradefed-protos", |
Joseph Murphy | b927bf6 | 2019-09-30 19:17:00 -0700 | [diff] [blame] | 120 | "tradefed-isolation-protos", |
| 121 | "tradefed-lite", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 122 | ], |
| 123 | libs: [ |
| 124 | "loganalysis", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 125 | ], |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Tor Norbye | e748482 | 2018-12-26 15:03:01 -0800 | [diff] [blame] | 128 | // Turn off various doclava warnings when generating |
| 129 | // the docs. These are the same warnings that are |
| 130 | // turned off in frameworks/base, plus error 101 |
| 131 | // which is necessary here because tradefed is |
| 132 | // referencing bootclasspath classes that are not |
| 133 | // feed to metalava when generating the stubs. |
| 134 | tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " |
| 135 | |
Nan Zhang | 8e4593b | 2018-09-18 21:07:24 -0700 | [diff] [blame] | 136 | droidstubs_host { |
| 137 | name: "tradefed-doc-stubs", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 138 | srcs: [ |
| 139 | "src/**/*.java", |
| 140 | ], |
| 141 | libs: [ |
| 142 | "loganalysis", |
| 143 | "tradefed", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 144 | ], |
Tor Norbye | e748482 | 2018-12-26 15:03:01 -0800 | [diff] [blame] | 145 | args: tradefed_docs_only_args + "--package", |
Nan Zhang | 8e4593b | 2018-09-18 21:07:24 -0700 | [diff] [blame] | 146 | create_doc_stubs: true, |
| 147 | } |
| 148 | |
| 149 | droiddoc_host { |
| 150 | name: "tradefed-docs", |
| 151 | srcs: [ |
| 152 | ":tradefed-doc-stubs", |
| 153 | ], |
Tor Norbye | e748482 | 2018-12-26 15:03:01 -0800 | [diff] [blame] | 154 | libs: [ |
| 155 | "loganalysis", |
| 156 | "tradefed", |
Tor Norbye | e748482 | 2018-12-26 15:03:01 -0800 | [diff] [blame] | 157 | ], |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 158 | custom_template: "droiddoc-templates-sdk", |
| 159 | hdf: [ |
| 160 | "sac true", |
| 161 | "devices true", |
| 162 | "android.whichdoc online", |
| 163 | "css.path /reference/assets/css/doclava-devsite.css", |
| 164 | "book.root toc", |
| 165 | "book.path /_book.yaml", |
| 166 | ], |
Tor Norbye | e748482 | 2018-12-26 15:03:01 -0800 | [diff] [blame] | 167 | args: tradefed_docs_only_args + |
| 168 | "-yaml _book.yaml " + |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 169 | "-apidocsdir reference/tradefed/ " + |
| 170 | "-werror " + |
| 171 | "-package " + |
| 172 | "-devsite ", |
| 173 | create_stubs: false, |
| 174 | } |
Colin Cross | 47d81f4 | 2019-10-18 15:45:27 -0700 | [diff] [blame] | 175 | |
| 176 | sh_binary_host { |
| 177 | name: "tradefed.sh", |
| 178 | src: "tradefed.sh", |
| 179 | } |
| 180 | |
| 181 | sh_binary_host { |
| 182 | name: "tradefed_win", |
| 183 | src: "tradefed_win.bat", |
| 184 | } |
| 185 | |
| 186 | sh_binary_host { |
yangbill | 634c38d | 2019-10-28 12:06:32 +0800 | [diff] [blame] | 187 | name: "script_help.sh", |
Colin Cross | 47d81f4 | 2019-10-18 15:45:27 -0700 | [diff] [blame] | 188 | src: "script_help.sh", |
| 189 | } |
| 190 | |
| 191 | sh_binary_host { |
yangbill | 634c38d | 2019-10-28 12:06:32 +0800 | [diff] [blame] | 192 | name: "run_tf_cmd.sh", |
Colin Cross | 47d81f4 | 2019-10-18 15:45:27 -0700 | [diff] [blame] | 193 | src: "run_tf_cmd.sh", |
| 194 | } |
| 195 | |
| 196 | sh_binary_host { |
yangbill | 634c38d | 2019-10-28 12:06:32 +0800 | [diff] [blame] | 197 | name: "atest_tradefed.sh", |
Colin Cross | 47d81f4 | 2019-10-18 15:45:27 -0700 | [diff] [blame] | 198 | src: "atest_tradefed.sh", |
| 199 | } |