blob: a26d5e2f16e431a7c361efc1a7916408c44eca1f [file] [log] [blame]
// Copyright 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
java_library_host {
name: "tradefed-protos",
// Restrict visibility to only those targets that need to access it.
visibility: [
"//tools/tradefederation/core/clearcut_client",
"//tools/tradefederation/core/common_util",
"//tools/tradefederation/core/device_build_interfaces",
"//tools/tradefederation/core/invocation_interfaces",
"//tools/tradefederation/core/test_result_interfaces",
],
srcs: ["proto/**/*.proto"],
libs: [
"libprotobuf-java-full",
],
proto: {
include_dirs: ["external/protobuf/src"],
type: "full",
},
}
java_genrule_host {
name: "lab-resource-grpc-gen",
srcs: [
"proto/monitoring/server/lab_resource.proto",
],
tools: [
"aprotoc",
"protoc-gen-grpc-java-plugin",
"soong_zip",
],
cmd: "$(location aprotoc) -Iexternal/protobuf/src" +
" -Itools/tradefederation/core/proto/monitoring/server" +
" --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-java-plugin) $(in)" +
" --grpc_out=$(genDir) && $(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
out: ["tradefed-grpc.srcjar"],
}
java_genrule_host {
name: "tf-feature-grpc-gen",
srcs: [
"proto/feature/tradefed_service.proto",
],
tools: [
"aprotoc",
"protoc-gen-grpc-java-plugin",
"soong_zip",
],
cmd: "$(location aprotoc) -Iexternal/protobuf/src" +
" -Itools/tradefederation/core/proto/feature" +
" --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-java-plugin) $(in)" +
" --grpc_out=$(genDir) && $(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)",
out: ["tradefed-service-grpc.srcjar"],
}
java_library_host {
name: "tradefed-service-grpc-lib",
visibility: [
"//tools/tradefederation/core",
],
srcs: [
":tf-feature-grpc-gen",
],
static_libs: [
"grpc-java",
"grpc-java-netty-shaded",
"libprotobuf-java-full",
"tradefed-protos",
"javax-annotation-api-prebuilt-host-jar",
"guava",
"opencensus-java-api",
],
}
// Main Target to build tradefed jar
java_library_host {
name: "tradefed",
defaults: ["tradefed_defaults"],
java_resource_dirs: [
"res",
],
static_libs: [
"tradefed-lib-core",
"tradefed-test-framework",
],
manifest: "MANIFEST.mf",
}
// Tradefed build target without the test framework statically linked
java_library_host {
name: "tradefed-no-fwk",
defaults: ["tradefed_defaults"],
java_resource_dirs: [
"res",
],
static_libs: [
"tradefed-lib-core",
],
libs: [
"tradefed-test-framework",
],
manifest: "MANIFEST.mf",
}
java_library_host {
name: "tradefed-lib-core",
visibility: [
"//tools/tradefederation/core/test_framework",
],
defaults: ["tradefed_defaults"],
srcs: [
"src/**/*.java",
"global_configuration/**/*.java",
":lab-resource-grpc-gen",
],
static_libs: [
"tradefed-common-util",
"tradefed-clearcut-client",
"tradefed-result-interfaces",
"tradefed-device-build-interfaces",
"tradefed-invocation-interfaces",
"tradefed-service-grpc-lib",
"protobuf-java-util-prebuilt-jar",
"aoa-helper",
"error_prone_annotations-2.0.18",
"google-api-java-client-assembly",
"auto_value_annotations",
"google-api-services-compute",
"google-api-services-storage",
"gson-prebuilt-jar",
"guice",
"jacoco-cli",
"jline",
"junit-params",
"kxml2-2.3.0",
"libprotobuf-java-full",
// TODO(b/1859290570: Delete platform-test-annotations dep
"platform-test-annotations",
"snakeyaml",
"tf-remote-client",
"tradefed-protos",
"tradefed-isolation-protos",
"tradefed-lite",
"guava",
"guava-testlib",
"grpc-java",
"grpc-java-testing",
"grpc-java-netty-shaded",
"javax-annotation-api-prebuilt-host-jar",
"opencensus-java-api",
"opencensus-java-contrib-grpc-metrics",
],
libs: [
"loganalysis",
],
}
// Turn off various doclava warnings when generating
// the docs. These are the same warnings that are
// turned off in frameworks/base, plus error 101
// which is necessary here because tradefed is
// referencing bootclasspath classes that are not
// feed to metalava when generating the stubs.
tradefed_docs_only_args = " -hide 101 -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 "
tradefed_doc_stubs_args = " -hide UnresolvedLink -hide HiddenSuperclass " +
"-hide DeprecationMismatch -hide RequiresPermission " +
"-hide BroadcastBehavior -hide SdkConstant -hide Todo "
droidstubs_host {
name: "tradefed-doc-stubs",
srcs: [
"src/**/*.java",
],
libs: [
"loganalysis",
"tradefed",
],
args: tradefed_doc_stubs_args + "--package",
create_doc_stubs: true,
}
droiddoc_host {
name: "tradefed-docs",
srcs: [
":tradefed-doc-stubs",
],
libs: [
"loganalysis",
"tradefed",
],
custom_template: "droiddoc-templates-sdk",
hdf: [
"sac true",
"devices true",
"android.whichdoc online",
"css.path /reference/assets/css/doclava-devsite.css",
"book.root toc",
"book.path /_book.yaml",
],
args: tradefed_docs_only_args +
"-yaml _book.yaml " +
"-apidocsdir reference/tradefed/ " +
"-werror " +
"-package " +
"-devsite ",
}
sh_binary_host {
name: "tradefed.sh",
src: "tradefed.sh",
}
sh_binary_host {
name: "tradefed_win",
src: "tradefed_win.bat",
}
sh_binary_host {
name: "script_help.sh",
src: "script_help.sh",
}
sh_binary_host {
name: "run_tf_cmd.sh",
src: "run_tf_cmd.sh",
}