blob: 91cec554d7cd43884cb76e2e06863f58a8114f10 [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 Holkc4239ac2018-09-05 10:43:31 -070037 "java_lang_builder.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080038 "tinyxml_layout_parser.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070039 "util.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080040 "layout_validation.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070041 ],
Eric Holkc4239ac2018-09-05 10:43:31 -070042}
43
44cc_binary_host {
45 name: "viewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070046 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070047 srcs: [
48 "main.cc",
49 ],
50 static_libs: [
Eric Holkc4239ac2018-09-05 10:43:31 -070051 "libgflags",
52 "libviewcompiler",
53 ],
54}
55
56cc_test_host {
57 name: "view-compiler-tests",
Eric Holkdbc36e22018-09-20 12:03:10 -070058 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070059 srcs: [
Eric Holkdbc36e22018-09-20 12:03:10 -070060 "dex_builder_test.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080061 "layout_validation_test.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070062 "util_test.cc",
63 ],
64 static_libs: [
65 "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070066 ],
Eric Holkfaefd4f2018-10-11 16:25:57 -070067 test_suites: ["general-tests"],
Eric Holkc4239ac2018-09-05 10:43:31 -070068}
Eric Holkd683f9f2018-10-26 16:08:09 -070069
70cc_binary_host {
71 name: "dex_testcase_generator",
72 defaults: ["viewcompiler_defaults"],
73 srcs: ["dex_testcase_generator.cc"],
74 static_libs: [
75 "libviewcompiler",
76 ],
77}
78
79genrule {
80 name: "generate_dex_testcases",
81 tools: [":dex_testcase_generator"],
82 cmd: "$(location :dex_testcase_generator) $(genDir)",
83 out: [
84 "simple.dex",
85 "trivial.dex",
86 ],
87}