• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2018 Google Inc. All rights reserved.
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: ["art_license"],
17}
18
19// --- ahat.jar ----------------
20java_binary_host {
21    name: "ahat",
22    visibility: [
23        "//libcore/metrictests/memory/host",
24    ],
25    wrapper: "ahat.sh",
26    srcs: ["src/main/**/*.java"],
27    manifest: "etc/ahat.mf",
28    java_resources: ["etc/style.css"],
29    // Use a relaxed version to allow distribution against older runtimes.
30    java_version: "11",
31    javacflags: ["-Xdoclint:all/protected"],
32}
33
34// --- ahat-test-dump.jar --------------
35java_test_helper_library {
36    name: "ahat-test-dump",
37    srcs: ["src/test-dump/**/*.java"],
38    sdk_version: "core_platform",
39    optimize: {
40        obfuscate: true,
41        enabled: true,
42        proguard_flags_files: ["etc/test-dump.pro"],
43    },
44}
45
46// --- ahat-ri-test-dump.jar -------
47java_test_helper_library {
48    host_supported: true,
49    device_supported: false,
50    name: "ahat-ri-test-dump",
51    srcs: ["src/ri-test-dump/**/*.java"],
52}
53
54java_binary_host {
55    name: "ahat-ri-test-dump-bin",
56    static_libs: ["ahat-ri-test-dump"],
57    main_class: "Main",
58}
59
60cc_library_shared {
61    name: "libahat-test-jni",
62    srcs: ["src/test/jni/**/*.cpp"],
63    header_libs: ["jni_headers"],
64    host_supported: true,
65}
66
67java_genrule {
68    name: "ahat-test-dump-gen",
69    srcs: [
70        "ahat-test-dump-gen.sh.in",
71        ":ahat-test-dump",
72    ],
73    out: ["ahat-test-dump-gen.sh"],
74    cmd: "sed -e s=@AHAT_TEST_DUMP_JAR@=$(location :ahat-test-dump)= $(location ahat-test-dump-gen.sh.in) > $(out)",
75}
76
77// Run ahat-ri-test-dump to generate ri-test-dump.hprof
78genrule {
79    name: "ahat_ri_test_dump_hprof",
80    out: ["ri-test-dump.hprof"],
81    tools: ["ahat-ri-test-dump-bin"],
82    cmd: "$(location ahat-ri-test-dump-bin) $(out)",
83}
84
85// To run these tests, use: atest ahat-tests --host
86java_test_host {
87    name: "ahat-tests",
88    srcs: ["src/test/**/*.java"],
89    manifest: "etc/ahat-tests.mf",
90    java_resources: [
91        ":ahat_ri_test_dump_hprof",
92        ":ahat-tests-res",
93    ],
94    static_libs: [
95        "ahat",
96        "junit-host",
97    ],
98    test_options: {
99        unit_test: true,
100    },
101    test_suites: ["general-tests"],
102}
103