blob: 90239212f66515ec03e0c25c1b0492edb58e6d1f [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
Bob Badour8a6a2bc2021-02-12 17:07:05 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "frameworks_base_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["frameworks_base_license"],
24}
25
Eric Holkdbc36e22018-09-20 12:03:10 -070026cc_defaults {
27 name: "viewcompiler_defaults",
Eric Holkfaefd4f2018-10-11 16:25:57 -070028 header_libs: [
29 "libbase_headers",
30 ],
Eric Holkdbc36e22018-09-20 12:03:10 -070031 shared_libs: [
Eric Holkfaefd4f2018-10-11 16:25:57 -070032 "libbase",
Eric Holkdbc36e22018-09-20 12:03:10 -070033 "slicer",
34 ],
Eric Holk3cbf1762018-12-13 16:04:56 -080035 static_libs: [
Steven Moreland598bda82019-09-18 12:58:11 -070036 "libcutils",
Eric Holk3cbf1762018-12-13 16:04:56 -080037 "libtinyxml2",
Eric Holkb377e512018-12-21 17:25:38 -080038 "liblog",
39 "libutils",
40 "libziparchive",
Orion Hodson59d07202019-10-31 15:25:33 +000041 "libz",
Eric Holk3cbf1762018-12-13 16:04:56 -080042 ],
Eric Holkb377e512018-12-21 17:25:38 -080043 cppflags: ["-std=c++17"],
44 target: {
45 android: {
46 shared_libs: [
47 "libandroidfw",
48 ],
49 },
50 host: {
51 static_libs: [
52 "libandroidfw",
53 ],
54 },
55 },
Eric Holkdbc36e22018-09-20 12:03:10 -070056}
57
Eric Holkbf30e312019-01-14 10:25:40 -080058cc_library_static {
Eric Holkc4239ac2018-09-05 10:43:31 -070059 name: "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070060 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070061 srcs: [
Eric Holkb377e512018-12-21 17:25:38 -080062 "apk_layout_compiler.cc",
Eric Holkdbc36e22018-09-20 12:03:10 -070063 "dex_builder.cc",
Eric Holk42734572018-12-17 15:46:18 -080064 "dex_layout_compiler.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070065 "java_lang_builder.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080066 "tinyxml_layout_parser.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070067 "util.cc",
Eric Holk3cbf1762018-12-13 16:04:56 -080068 "layout_validation.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070069 ],
Eric Holkbf30e312019-01-14 10:25:40 -080070 host_supported: true,
Eric Holkc4239ac2018-09-05 10:43:31 -070071}
72
Eric Holkbf30e312019-01-14 10:25:40 -080073cc_binary {
Eric Holkc4239ac2018-09-05 10:43:31 -070074 name: "viewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070075 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070076 srcs: [
77 "main.cc",
78 ],
79 static_libs: [
Eric Holkc4239ac2018-09-05 10:43:31 -070080 "libgflags",
81 "libviewcompiler",
82 ],
Eric Holkbf30e312019-01-14 10:25:40 -080083 host_supported: true
Eric Holkc4239ac2018-09-05 10:43:31 -070084}
85
86cc_test_host {
87 name: "view-compiler-tests",
Eric Holkdbc36e22018-09-20 12:03:10 -070088 defaults: ["viewcompiler_defaults"],
Eric Holkc4239ac2018-09-05 10:43:31 -070089 srcs: [
Eric Holk3cbf1762018-12-13 16:04:56 -080090 "layout_validation_test.cc",
Eric Holkc4239ac2018-09-05 10:43:31 -070091 "util_test.cc",
92 ],
93 static_libs: [
94 "libviewcompiler",
Eric Holkdbc36e22018-09-20 12:03:10 -070095 ],
Eric Holkc4239ac2018-09-05 10:43:31 -070096}
Eric Holkd683f9f2018-10-26 16:08:09 -070097
98cc_binary_host {
99 name: "dex_testcase_generator",
100 defaults: ["viewcompiler_defaults"],
101 srcs: ["dex_testcase_generator.cc"],
102 static_libs: [
103 "libviewcompiler",
104 ],
105}
106
107genrule {
108 name: "generate_dex_testcases",
109 tools: [":dex_testcase_generator"],
110 cmd: "$(location :dex_testcase_generator) $(genDir)",
111 out: [
112 "simple.dex",
113 "trivial.dex",
114 ],
115}