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", |
| 27 | "-Xep:FormatString:ERROR", |
| 28 | "-Xep:GetClassOnClass:ERROR", |
| 29 | "-Xep:IdentityBinaryExpression:ERROR", |
| 30 | "-Xep:JUnit3TestNotRun:ERROR", |
| 31 | "-Xep:JUnit4ClassUsedInJUnit3:ERROR", |
| 32 | "-Xep:JUnitAmbiguousTestClass:ERROR", |
| 33 | "-Xep:MissingFail:ERROR", |
| 34 | "-Xep:MissingOverride:ERROR", |
| 35 | "-Xep:MustBeClosedChecker:ERROR", |
| 36 | "-Xep:Overrides:ERROR", |
| 37 | "-Xep:PackageLocation:ERROR", |
| 38 | "-Xep:ReferenceEquality:ERROR", |
| 39 | "-Xep:RemoveUnusedImports:ERROR", |
| 40 | "-Xep:ReturnValueIgnored:ERROR", |
| 41 | "-Xep:SelfEquals:ERROR", |
| 42 | "-Xep:SizeGreaterThanOrEqualsZero:ERROR", |
| 43 | "-Xep:TryFailThrowable:ERROR", |
| 44 | ], |
| 45 | }, |
| 46 | } |
| 47 | |
| 48 | java_defaults { |
| 49 | name: "tradefed_defaults", |
| 50 | defaults: [ "tradefed_errorprone_defaults" ], |
| 51 | javacflags: [ |
| 52 | "-g", |
| 53 | "-Xlint", |
| 54 | ], |
| 55 | } |
| 56 | |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 57 | java_library_host { |
| 58 | name: "tradefed-protos", |
| 59 | srcs: ["proto/**/*.proto"], |
| 60 | libs: [ |
| 61 | "libprotobuf-java-full", |
| 62 | ], |
| 63 | proto: { |
| 64 | include_dirs: ["external/protobuf/src"], |
| 65 | type: "full", |
| 66 | }, |
| 67 | static_libs: [ |
| 68 | "platformprotos", |
| 69 | ], |
| 70 | } |
| 71 | |
| 72 | java_library_host { |
| 73 | name: "tradefed", |
| 74 | defaults: ["tradefed_defaults"], |
| 75 | srcs: [ |
| 76 | "src/**/*.java", |
| 77 | ], |
| 78 | java_resource_dirs: [ |
| 79 | "res", |
| 80 | ], |
| 81 | openjdk9: { |
| 82 | javacflags: [ |
Nan Zhang | bc2ca02 | 2018-07-23 17:46:34 -0700 | [diff] [blame] | 83 | "--add-modules=java.xml.bind", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 84 | ], |
| 85 | }, |
| 86 | static_libs: [ |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 87 | "commons-compress-prebuilt", |
| 88 | "error_prone_annotations-2.0.18", |
| 89 | "google-api-java-client-min-repackaged", |
| 90 | "gson-prebuilt-jar", |
| 91 | "guice", |
| 92 | "jline-1.0", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 93 | "junit", |
| 94 | "junit-params", |
| 95 | "kxml2-2.3.0", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 96 | "libprotobuf-java-full", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 97 | "longevity-host-lib", |
gopinath | 515dd2e | 2018-10-25 15:47:37 -0700 | [diff] [blame] | 98 | "perfetto_config-full", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 99 | "platform-test-annotations", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 100 | "tf-remote-client", |
Julien Desprez | 97ee999 | 2018-11-01 16:17:36 -0700 | [diff] [blame] | 101 | "tradefed-grpc-lib-1.0.1", |
Julien Desprez | 251ec57 | 2018-11-01 11:15:48 -0700 | [diff] [blame] | 102 | "tradefed-protos", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 103 | ], |
| 104 | libs: [ |
| 105 | "loganalysis", |
| 106 | "tools-common-prebuilt", |
| 107 | ], |
| 108 | manifest: "MANIFEST.mf", |
| 109 | } |
| 110 | |
Julien Desprez | 97ee999 | 2018-11-01 16:17:36 -0700 | [diff] [blame] | 111 | // Use 1.0.1 version of GRPC to be compatible of current guava version |
| 112 | java_library_host { |
| 113 | name: "tradefed-grpc-lib-1.0.1", |
| 114 | srcs: [ |
| 115 | "proto-gen/**/*.java", |
| 116 | ], |
| 117 | libs: [ |
| 118 | "tradefed-protos", |
| 119 | "guava", |
| 120 | ], |
Tobias Thierer | 12dca90 | 2018-11-05 15:21:12 +0000 | [diff] [blame^] | 121 | openjdk9: { |
| 122 | javacflags: [ |
| 123 | "--add-modules=java.xml.ws.annotation", |
| 124 | ], |
| 125 | }, |
Julien Desprez | 97ee999 | 2018-11-01 16:17:36 -0700 | [diff] [blame] | 126 | static_libs: [ |
| 127 | "grpc-java-context-1.0.1", |
| 128 | "grpc-java-core-1.0.1", |
| 129 | "grpc-java-netty-1.0.1", |
| 130 | "grpc-java-protobuf-1.0.1", |
| 131 | "grpc-java-protobuf-lite-1.0.1", |
| 132 | "grpc-java-stub-1.0.1", |
| 133 | "netty-buffer-java-4.1.3.Final", |
| 134 | "netty-codec-java-4.1.3.Final", |
| 135 | "netty-codec-http2-java-4.1.3.Final", |
| 136 | "netty-common-java-4.1.3.Final", |
| 137 | "netty-handler-java-4.1.3.Final", |
| 138 | "netty-resolver-java-4.1.3.Final", |
| 139 | "netty-transport-java-4.1.3.Final", |
| 140 | ] |
| 141 | } |
| 142 | |
Nan Zhang | 8e4593b | 2018-09-18 21:07:24 -0700 | [diff] [blame] | 143 | droidstubs_host { |
| 144 | name: "tradefed-doc-stubs", |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 145 | srcs: [ |
| 146 | "src/**/*.java", |
| 147 | ], |
| 148 | libs: [ |
| 149 | "loganalysis", |
| 150 | "tradefed", |
| 151 | "tools-common-prebuilt", |
| 152 | ], |
Nan Zhang | 8e4593b | 2018-09-18 21:07:24 -0700 | [diff] [blame] | 153 | args: "--package", |
| 154 | create_doc_stubs: true, |
| 155 | } |
| 156 | |
| 157 | droiddoc_host { |
| 158 | name: "tradefed-docs", |
| 159 | srcs: [ |
| 160 | ":tradefed-doc-stubs", |
| 161 | ], |
Nan Zhang | d4bde95 | 2018-07-18 16:58:43 -0700 | [diff] [blame] | 162 | custom_template: "droiddoc-templates-sdk", |
| 163 | hdf: [ |
| 164 | "sac true", |
| 165 | "devices true", |
| 166 | "android.whichdoc online", |
| 167 | "css.path /reference/assets/css/doclava-devsite.css", |
| 168 | "book.root toc", |
| 169 | "book.path /_book.yaml", |
| 170 | ], |
| 171 | args: "-yaml _book.yaml " + |
| 172 | "-apidocsdir reference/tradefed/ " + |
| 173 | "-werror " + |
| 174 | "-package " + |
| 175 | "-devsite ", |
| 176 | create_stubs: false, |
| 177 | } |