blob: 68db56d58b166cf8d8aac25293ee258c57e96297 [file] [log] [blame]
Dan Willemsend3eac262017-09-08 22:47:47 -07001//
2// Copyright (C) 2014 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
17// ==========================================================
18// Setup some common variables for the different build
19// targets here.
20// ==========================================================
21
Bob Badour8a6a2bc2021-02-12 17:07:05 -080022package {
23 default_applicable_licenses: ["frameworks_base_tools_aapt_license"],
24}
25
26// Added automatically by a large-scale-change
27// See: http://go/android-license-faq
28license {
29 name: "frameworks_base_tools_aapt_license",
30 visibility: [":__subpackages__"],
31 license_kinds: [
32 "SPDX-license-identifier-Apache-2.0",
33 ],
34 license_text: [
35 "NOTICE",
36 ],
37}
38
Dan Willemsend3eac262017-09-08 22:47:47 -070039cc_defaults {
40 name: "aapt_defaults",
41
42 static_libs: [
43 "libandroidfw",
44 "libpng",
45 "libutils",
46 "liblog",
47 "libcutils",
48 "libexpat",
49 "libziparchive",
50 "libbase",
51 "libz",
52 ],
Dan Willemsend3eac262017-09-08 22:47:47 -070053
Tomasz Wasilczyk804e8192023-08-23 02:22:53 +000054 whole_static_libs: [
55 "libandroidfw_pathutils",
56 ],
57
Dan Willemsend3eac262017-09-08 22:47:47 -070058 cflags: [
59 "-Wall",
60 "-Werror",
61 ],
62
63 target: {
64 windows: {
65 enabled: true,
66 },
67 },
Dan Willemsend3eac262017-09-08 22:47:47 -070068}
69
70// ==========================================================
71// Build the host static library: libaapt
72// ==========================================================
73cc_library_host_static {
74 name: "libaapt",
75 defaults: ["aapt_defaults"],
76 target: {
77 darwin: {
78 cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
79 },
80 },
81 cflags: [
82 "-Wno-format-y2k",
83 "-DSTATIC_ANDROIDFW_FOR_TOOLS",
84 ],
85
86 srcs: [
87 "AaptAssets.cpp",
88 "AaptConfig.cpp",
89 "AaptUtil.cpp",
90 "AaptXml.cpp",
91 "ApkBuilder.cpp",
92 "Command.cpp",
93 "CrunchCache.cpp",
94 "FileFinder.cpp",
95 "Images.cpp",
96 "Package.cpp",
97 "pseudolocalize.cpp",
98 "Resource.cpp",
99 "ResourceFilter.cpp",
100 "ResourceIdCache.cpp",
101 "ResourceTable.cpp",
102 "SourcePos.cpp",
103 "StringPool.cpp",
Elliott Hughes338698e2021-07-13 17:15:19 -0700104 "Utils.cpp",
Dan Willemsend3eac262017-09-08 22:47:47 -0700105 "WorkQueue.cpp",
106 "XMLNode.cpp",
107 "ZipEntry.cpp",
108 "ZipFile.cpp",
109 ],
110}
111
112// ==========================================================
Dan Willemsen5d129352018-08-29 17:22:14 -0700113// Build the host executable: aapt
114// ==========================================================
115cc_binary_host {
116 name: "aapt",
117 defaults: ["aapt_defaults"],
118 srcs: ["Main.cpp"],
119 use_version_lib: true,
120 static_libs: ["libaapt"],
Ryan Mitchellc3d69322021-05-04 07:42:46 -0700121 dist: {
122 targets: ["aapt2_artifacts"],
123 },
Dan Willemsen5d129352018-08-29 17:22:14 -0700124}
125
126// ==========================================================
Dan Willemsend3eac262017-09-08 22:47:47 -0700127// Build the host tests: libaapt_tests
128// ==========================================================
129cc_test_host {
130 name: "libaapt_tests",
131 defaults: ["aapt_defaults"],
132 srcs: [
133 "tests/AaptConfig_test.cpp",
134 "tests/AaptGroupEntry_test.cpp",
135 "tests/Pseudolocales_test.cpp",
136 "tests/ResourceFilter_test.cpp",
137 "tests/ResourceTable_test.cpp",
138 ],
139 static_libs: ["libaapt"],
140}