Guang Zhu d6630f5fa7 enable aapt for unbundled builds
It was available for unbundled builds when the build rules were in mk form and aapt2 is enabled for unbundled, so there's not a strong reason why aapt should be disabled for unbundled build

Change-Id: I6589eafbe8d2e423c9ac925b3614763fa6a511ac
Fixes: 217747798
Test: local compile
2022-03-02 20:40:45 +00:00

136 lines
3.4 KiB
Plaintext

//
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ==========================================================
// Setup some common variables for the different build
// targets here.
// ==========================================================
package {
default_applicable_licenses: ["frameworks_base_tools_aapt_license"],
}
// Added automatically by a large-scale-change
// See: http://go/android-license-faq
license {
name: "frameworks_base_tools_aapt_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
],
license_text: [
"NOTICE",
],
}
cc_defaults {
name: "aapt_defaults",
static_libs: [
"libandroidfw",
"libpng",
"libutils",
"liblog",
"libcutils",
"libexpat",
"libziparchive",
"libbase",
"libz",
],
cflags: [
"-Wall",
"-Werror",
],
target: {
windows: {
enabled: true,
},
},
}
// ==========================================================
// Build the host static library: libaapt
// ==========================================================
cc_library_host_static {
name: "libaapt",
defaults: ["aapt_defaults"],
target: {
darwin: {
cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
},
},
cflags: [
"-Wno-format-y2k",
"-DSTATIC_ANDROIDFW_FOR_TOOLS",
],
srcs: [
"AaptAssets.cpp",
"AaptConfig.cpp",
"AaptUtil.cpp",
"AaptXml.cpp",
"ApkBuilder.cpp",
"Command.cpp",
"CrunchCache.cpp",
"FileFinder.cpp",
"Images.cpp",
"Package.cpp",
"pseudolocalize.cpp",
"Resource.cpp",
"ResourceFilter.cpp",
"ResourceIdCache.cpp",
"ResourceTable.cpp",
"SourcePos.cpp",
"StringPool.cpp",
"WorkQueue.cpp",
"XMLNode.cpp",
"ZipEntry.cpp",
"ZipFile.cpp",
],
}
// ==========================================================
// Build the host executable: aapt
// ==========================================================
cc_binary_host {
name: "aapt",
defaults: ["aapt_defaults"],
srcs: ["Main.cpp"],
use_version_lib: true,
static_libs: ["libaapt"],
dist: {
targets: ["aapt2_artifacts"],
},
}
// ==========================================================
// Build the host tests: libaapt_tests
// ==========================================================
cc_test_host {
name: "libaapt_tests",
defaults: ["aapt_defaults"],
srcs: [
"tests/AaptConfig_test.cpp",
"tests/AaptGroupEntry_test.cpp",
"tests/Pseudolocales_test.cpp",
"tests/ResourceFilter_test.cpp",
"tests/ResourceTable_test.cpp",
],
static_libs: ["libaapt"],
}