1//
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// ==========================================================
102// Build the host tests: libaapt_tests
103// ==========================================================
104cc_test_host {
105    name: "libaapt_tests",
106    defaults: ["aapt_defaults"],
107    srcs: [
108        "tests/AaptConfig_test.cpp",
109        "tests/AaptGroupEntry_test.cpp",
110        "tests/Pseudolocales_test.cpp",
111        "tests/ResourceFilter_test.cpp",
112        "tests/ResourceTable_test.cpp",
113    ],
114    static_libs: ["libaapt"],
115}
116