1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// This file contains all the build target that we expect tests writers
18// to need to build tests.
19
20package {
21    default_applicable_licenses: ["Android-Apache-2.0"],
22}
23
24java_import_host {
25    name: "tradefed",
26    jars: [
27        ":platformprotos", // Should be first to force using protos from the branch
28        ":tradefed-prebuilt",
29    ],
30    installable: true,
31}
32
33// Target used for backward compatibility with suites
34java_import_host {
35    name: "tradefed-no-fwk",
36    jars: [":tradefed-prebuilt"],
37    installable: true,
38}
39
40java_import_host {
41    name: "loganalysis",
42    jars: [":loganalysis-prebuilt"],
43    installable: true,
44}
45
46// Targets for test suites
47java_import_host {
48    name: "compatibility-tradefed",
49    jars: [":compatibility-tradefed-prebuilt"],
50    installable: true,
51}
52
53java_import_host {
54    name: "compatibility-host-util",
55    jars: [":compatibility-host-util-prebuilt"],
56    installable: true,
57}
58
59java_genrule_host {
60    name: "prebuilt_tradefed_zip",
61    tools: ["soong_zip"],
62    srcs: [
63        ":tradefed",
64        ":tradefed_dist_artifacts",
65        ":compatibility-tradefed-prebuilt",
66        ":compatibility-host-util-prebuilt",
67    ],
68    out: ["tradefed.zip"],
69    cmd: "mkdir -p $(genDir)/tmp && " +
70        "cp -f $(in) $(genDir)/tmp && " +
71        "$(location soong_zip) -o $(out) -C $(genDir)/tmp -D $(genDir)/tmp",
72}
73
74// This is workaround to get the prebuilt tradefed.zip
75prebuilt_etc_host {
76    name: "prebuilt_etc_tradefed_zip",
77    src: ":prebuilt_tradefed_zip",
78    filename: "tradefed.zip",
79}
80