blob: a594e5bf0ce151235b9825684e6590e1ada88cdb [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
22cc_defaults {
23 name: "aapt_defaults",
24
25 static_libs: [
26 "libandroidfw",
27 "libpng",
28 "libutils",
29 "liblog",
30 "libcutils",
31 "libexpat",
32 "libziparchive",
33 "libbase",
34 "libz",
35 ],
36 group_static_libs: true,
37
38 cflags: [
39 "-Wall",
40 "-Werror",
41 ],
42
43 target: {
44 windows: {
45 enabled: true,
46 },
47 },
48
49 // This tool is prebuilt if we're doing an app-only build.
50 product_variables: {
51 pdk: {
52 enabled: false,
53 },
54 unbundled_build: {
55 enabled: false,
56 },
57 },
58}
59
60// ==========================================================
61// Build the host static library: libaapt
62// ==========================================================
63cc_library_host_static {
64 name: "libaapt",
65 defaults: ["aapt_defaults"],
66 target: {
67 darwin: {
68 cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
69 },
70 },
71 cflags: [
72 "-Wno-format-y2k",
73 "-DSTATIC_ANDROIDFW_FOR_TOOLS",
74 ],
75
76 srcs: [
77 "AaptAssets.cpp",
78 "AaptConfig.cpp",
79 "AaptUtil.cpp",
80 "AaptXml.cpp",
81 "ApkBuilder.cpp",
82 "Command.cpp",
83 "CrunchCache.cpp",
84 "FileFinder.cpp",
85 "Images.cpp",
86 "Package.cpp",
87 "pseudolocalize.cpp",
88 "Resource.cpp",
89 "ResourceFilter.cpp",
90 "ResourceIdCache.cpp",
91 "ResourceTable.cpp",
92 "SourcePos.cpp",
93 "StringPool.cpp",
94 "WorkQueue.cpp",
95 "XMLNode.cpp",
96 "ZipEntry.cpp",
97 "ZipFile.cpp",
98 ],
99}
100
101// ==========================================================
Dan Willemsen5d129352018-08-29 17:22:14 -0700102// Build the host executable: aapt
103// ==========================================================
104cc_binary_host {
105 name: "aapt",
106 defaults: ["aapt_defaults"],
107 srcs: ["Main.cpp"],
108 use_version_lib: true,
109 static_libs: ["libaapt"],
110}
111
112// ==========================================================
Dan Willemsend3eac262017-09-08 22:47:47 -0700113// Build the host tests: libaapt_tests
114// ==========================================================
115cc_test_host {
116 name: "libaapt_tests",
117 defaults: ["aapt_defaults"],
118 srcs: [
119 "tests/AaptConfig_test.cpp",
120 "tests/AaptGroupEntry_test.cpp",
121 "tests/Pseudolocales_test.cpp",
122 "tests/ResourceFilter_test.cpp",
123 "tests/ResourceTable_test.cpp",
124 ],
125 static_libs: ["libaapt"],
126}