• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2016 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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19java_defaults {
20    name: "CompilationTestCases_defaults",
21    srcs: ["src/**/*.java"],
22    data: [
23        ":StatusCheckerApp",
24    ],
25    java_resource_dirs: ["assets/"],
26    java_resources: [
27        ":AppUsedByOtherApp",
28        ":AppUsedByOtherApp_1_dm",
29        ":AppUsedByOtherApp_2_prof",
30        ":AppUsingOtherApp",
31        ":CtsCompilationApp",
32        ":CtsCompilationApp_profile",
33        ":CtsCompilationApp_dm",
34    ],
35    libs: [
36        "cts-tradefed",
37        "tradefed",
38        "compatibility-host-util",
39        "guava",
40        "truth-prebuilt",
41    ],
42}
43
44java_test_host {
45    name: "CtsCompilationTestCases",
46    defaults: ["CompilationTestCases_defaults"],
47    // tag this module as a cts test artifact
48    test_suites: [
49        "cts",
50        "general-tests",
51    ],
52    test_config: "CtsCompilationTestCases.xml",
53}
54
55java_test_host {
56    name: "CompilationTestCases",
57    defaults: ["CompilationTestCases_defaults"],
58    test_suites: [
59        "general-tests",
60    ],
61    test_config: "CompilationTestCases.xml",
62}
63
64// Generates a binary profile from a text profile for an APK.
65// The first input must be the text profile.
66// The second input must be the APK.
67genrule_defaults {
68    name: "profile_defaults",
69    tools: ["profman"],
70    cmd: "inputs=($(in)) && " +
71        "$(location profman) " +
72        "--create-profile-from=$${inputs[0]} " +
73        "--apk=$${inputs[1]} " +
74        "--dex-location=base.apk " +
75        "--reference-profile-file=$(out)",
76}
77
78// Generates a DM file from a binary profile.
79// The input must be the binary profile.
80genrule_defaults {
81    name: "dm_defaults",
82    tools: ["soong_zip"],
83    cmd: "cp $(in) $(genDir)/primary.prof && " +
84        "$(location soong_zip) " +
85        "-j -f $(genDir)/primary.prof " +
86        "-o $(out)",
87}
88
89genrule {
90    name: "CtsCompilationApp_profile",
91    defaults: ["profile_defaults"],
92    srcs: [
93        "assets/primary.prof.txt",
94        ":CtsCompilationApp",
95    ],
96    out: ["CtsCompilationApp.prof"],
97}
98
99genrule {
100    name: "CtsCompilationApp_dm",
101    defaults: ["dm_defaults"],
102    srcs: [
103        ":CtsCompilationApp_profile",
104    ],
105    out: ["CtsCompilationApp.dm"],
106}
107
108genrule {
109    name: "AppUsedByOtherApp_1_prof",
110    defaults: ["profile_defaults"],
111    srcs: [
112        "assets/app_used_by_other_app_1.prof.txt",
113        ":AppUsedByOtherApp",
114    ],
115    out: ["AppUsedByOtherApp_1.prof"],
116}
117
118genrule {
119    name: "AppUsedByOtherApp_1_dm",
120    defaults: ["dm_defaults"],
121    srcs: [
122        ":AppUsedByOtherApp_1_prof",
123    ],
124    out: ["AppUsedByOtherApp_1.dm"],
125}
126
127genrule {
128    name: "AppUsedByOtherApp_2_prof",
129    defaults: ["profile_defaults"],
130    srcs: [
131        "assets/app_used_by_other_app_2.prof.txt",
132        ":AppUsedByOtherApp",
133    ],
134    out: ["AppUsedByOtherApp_2.prof"],
135}
136