blob: 92ea872f04fcf47bb3ee037476a8f13ddb12c65e [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",
Orion Hodsonca1b80b2019-01-28 11:35:16 +000019 defaults: ["libdexfile_static_defaults"],
Eric Holkfaefd4f2018-10-11 16:25:57 -070020 header_libs: [
21 "libbase_headers",
22 ],
Eric Holkdbc36e22018-09-20 12:03:10 -070023 shared_libs: [
Eric Holkfaefd4f2018-10-11 16:25:57 -070024 "libbase",
Eric Holkdbc36e22018-09-20 12:03:10 -070025 "slicer",
26 ],
Eric Holk3cbf1762018-12-13 16:04:56 -080027 static_libs: [
28 "libtinyxml2",
Eric Holkb377e512018-12-21 17:25:38 -080029 "liblog",
30 "libutils",
31 "libziparchive",
Eric Holk3cbf1762018-12-13 16:04:56 -080032 ],
Eric Holkb377e512018-12-21 17:25:38 -080033 cppflags: ["-std=c++17"],
34 target: {
35 android: {
36 shared_libs: [
37 "libandroidfw",
38 ],
39 },
40 host: {
41 static_libs: [
42 "libandroidfw",
43 ],
44 },
45 },
Eric Holkdbc36e22018-09-20 12:03:10 -070046}
47
Eric Holkbf30e312019-01-14 10:25:40 -080048cc_library_static {
Eric Holkc4239ac2018-09-05 10:43:31 -070049 name: "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070050 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070051 srcs: [
Eric Holkb377e512018-12-21 17:25:38 -080052 "apk_layout_compiler.cc",
Eric Holkdbc36e22018-09-20 12:03:10 -070053 "dex_builder.cc",
Eric Holk42734572018-12-17 15:46:18 -080054 "dex_layout_compiler.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070055 "java_lang_builder.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080056 "tinyxml_layout_parser.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070057 "util.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080058 "layout_validation.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070059 ],
Eric Holkbf30e312019-01-14 10:25:40 -080060 host_supported: true,
Eric Holkc4239ac2018-09-05 10:43:31 -070061}
62
Eric Holkbf30e312019-01-14 10:25:40 -080063cc_binary {
Eric Holkc4239ac2018-09-05 10:43:31 -070064 name: "viewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070065 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070066 srcs: [
67 "main.cc",
68 ],
69 static_libs: [
Eric Holkc4239ac2018-09-05 10:43:31 -070070 "libgflags",
71 "libviewcompiler",
72 ],
Eric Holkbf30e312019-01-14 10:25:40 -080073 host_supported: true
Eric Holkc4239ac2018-09-05 10:43:31 -070074}
75
76cc_test_host {
77 name: "view-compiler-tests",
Eric Holkdbc36e22018-09-20 12:03:10 -070078 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070079 srcs: [
Eric Holkdbc36e22018-09-20 12:03:10 -070080 "dex_builder_test.cc",
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}