blob: 7cc233b2439efdbbc4ce757f55e65a4c6187702e [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 "slicer",
25 ],
Eric Holk3cbf1762018-12-13 16:04:56 -080026 static_libs: [
Steven Moreland598bda82019-09-18 12:58:11 -070027 "libcutils",
Eric Holk3cbf1762018-12-13 16:04:56 -080028 "libtinyxml2",
Eric Holkb377e512018-12-21 17:25:38 -080029 "liblog",
30 "libutils",
31 "libziparchive",
Orion Hodson59d07202019-10-31 15:25:33 +000032 "libz",
Eric Holk3cbf1762018-12-13 16:04:56 -080033 ],
Eric Holkb377e512018-12-21 17:25:38 -080034 cppflags: ["-std=c++17"],
35 target: {
36 android: {
37 shared_libs: [
38 "libandroidfw",
39 ],
40 },
41 host: {
42 static_libs: [
43 "libandroidfw",
44 ],
45 },
46 },
Eric Holkdbc36e22018-09-20 12:03:10 -070047}
48
Eric Holkbf30e312019-01-14 10:25:40 -080049cc_library_static {
Eric Holkc4239ac2018-09-05 10:43:31 -070050 name: "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070051 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070052 srcs: [
Eric Holkb377e512018-12-21 17:25:38 -080053 "apk_layout_compiler.cc",
Eric Holkdbc36e22018-09-20 12:03:10 -070054 "dex_builder.cc",
Eric Holk42734572018-12-17 15:46:18 -080055 "dex_layout_compiler.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070056 "java_lang_builder.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080057 "tinyxml_layout_parser.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070058 "util.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080059 "layout_validation.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070060 ],
Eric Holkbf30e312019-01-14 10:25:40 -080061 host_supported: true,
Eric Holkc4239ac2018-09-05 10:43:31 -070062}
63
Eric Holkbf30e312019-01-14 10:25:40 -080064cc_binary {
Eric Holkc4239ac2018-09-05 10:43:31 -070065 name: "viewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070066 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070067 srcs: [
68 "main.cc",
69 ],
70 static_libs: [
Eric Holkc4239ac2018-09-05 10:43:31 -070071 "libgflags",
72 "libviewcompiler",
73 ],
Eric Holkbf30e312019-01-14 10:25:40 -080074 host_supported: true
Eric Holkc4239ac2018-09-05 10:43:31 -070075}
76
77cc_test_host {
78 name: "view-compiler-tests",
Eric Holkdbc36e22018-09-20 12:03:10 -070079 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070080 srcs: [
Eric Holk3cbf1762018-12-13 16:04:56 -080081 "layout_validation_test.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070082 "util_test.cc",
83 ],
84 static_libs: [
85 "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070086 ],
Eric Holkfaefd4f2018-10-11 16:25:57 -070087 test_suites: ["general-tests"],
Eric Holkc4239ac2018-09-05 10:43:31 -070088}
Eric Holkd683f9f2018-10-26 16:08:09 -070089
90cc_binary_host {
91 name: "dex_testcase_generator",
92 defaults: ["viewcompiler_defaults"],
93 srcs: ["dex_testcase_generator.cc"],
94 static_libs: [
95 "libviewcompiler",
96 ],
97}
98
99genrule {
100 name: "generate_dex_testcases",
101 tools: [":dex_testcase_generator"],
102 cmd: "$(location :dex_testcase_generator) $(genDir)",
103 out: [
104 "simple.dex",
105 "trivial.dex",
106 ],
107}