blob: 82056e9a33fe5c093e49c79df5ac8ddfc400a2d1 [file] [log] [blame]
Eric Holkc4239ac2018-09-05 10:43:31 -07001//
2// Copyright (C) 2018 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
Eric Holkdbc36e22018-09-20 12:03:10 -070017cc_defaults {
18 name: "viewcompiler_defaults",
Eric Holkfaefd4f2018-10-11 16:25:57 -070019 header_libs: [
20 "libbase_headers",
21 ],
Eric Holkdbc36e22018-09-20 12:03:10 -070022 shared_libs: [
Eric Holkfaefd4f2018-10-11 16:25:57 -070023 "libbase",
Eric Holkdbc36e22018-09-20 12:03:10 -070024 "libdexfile",
25 "slicer",
26 ],
Eric Holk3cbf1762018-12-13 16:04:56 -080027 static_libs: [
28 "libtinyxml2",
29 ],
Eric Holkdbc36e22018-09-20 12:03:10 -070030}
31
Eric Holkc4239ac2018-09-05 10:43:31 -070032cc_library_host_static {
33 name: "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070034 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070035 srcs: [
Eric Holkdbc36e22018-09-20 12:03:10 -070036 "dex_builder.cc",
Eric Holk42734572018-12-17 15:46:18 -080037 "dex_layout_compiler.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070038 "java_lang_builder.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080039 "tinyxml_layout_parser.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070040 "util.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080041 "layout_validation.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070042 ],
Eric Holkc4239ac2018-09-05 10:43:31 -070043}
44
45cc_binary_host {
46 name: "viewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070047 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070048 srcs: [
49 "main.cc",
50 ],
51 static_libs: [
Eric Holkc4239ac2018-09-05 10:43:31 -070052 "libgflags",
53 "libviewcompiler",
54 ],
55}
56
57cc_test_host {
58 name: "view-compiler-tests",
Eric Holkdbc36e22018-09-20 12:03:10 -070059 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070060 srcs: [
Eric Holkdbc36e22018-09-20 12:03:10 -070061 "dex_builder_test.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080062 "layout_validation_test.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070063 "util_test.cc",
64 ],
65 static_libs: [
66 "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070067 ],
Eric Holkfaefd4f2018-10-11 16:25:57 -070068 test_suites: ["general-tests"],
Eric Holkc4239ac2018-09-05 10:43:31 -070069}
Eric Holkd683f9f2018-10-26 16:08:09 -070070
71cc_binary_host {
72 name: "dex_testcase_generator",
73 defaults: ["viewcompiler_defaults"],
74 srcs: ["dex_testcase_generator.cc"],
75 static_libs: [
76 "libviewcompiler",
77 ],
78}
79
80genrule {
81 name: "generate_dex_testcases",
82 tools: [":dex_testcase_generator"],
83 cmd: "$(location :dex_testcase_generator) $(genDir)",
84 out: [
85 "simple.dex",
86 "trivial.dex",
87 ],
88}