2017-01-12 14:24:31 -05:00
|
|
|
//
|
2017-02-21 14:22:30 -08:00
|
|
|
// Copyright (C) 2017 The Android Open Source Project
|
2017-01-12 14:24:31 -05:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
|
|
|
toolSources = [
|
|
|
|
"compile/Compile.cpp",
|
|
|
|
"diff/Diff.cpp",
|
|
|
|
"dump/Dump.cpp",
|
|
|
|
"link/Link.cpp",
|
2017-02-21 14:22:30 -08:00
|
|
|
"optimize/Optimize.cpp",
|
2017-01-12 14:24:31 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "aapt_defaults",
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
],
|
|
|
|
cppflags: [
|
|
|
|
"-Wno-missing-field-initializers",
|
|
|
|
"-fno-exceptions",
|
|
|
|
"-fno-rtti",
|
|
|
|
],
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
cflags: ["-Wno-maybe-uninitialized"],
|
|
|
|
static_libs: ["libz"],
|
|
|
|
},
|
|
|
|
darwin: {
|
|
|
|
cflags: ["-D_DARWIN_UNLIMITED_STREAMS"],
|
|
|
|
host_ldlibs: ["-lz"],
|
|
|
|
},
|
|
|
|
linux: {
|
|
|
|
host_ldlibs: ["-lz"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
static_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libutils",
|
|
|
|
"liblog",
|
|
|
|
"libcutils",
|
|
|
|
"libexpat",
|
|
|
|
"libziparchive",
|
|
|
|
"libpng",
|
|
|
|
"libbase",
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
],
|
|
|
|
group_static_libs: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==========================================================
|
|
|
|
// NOTE: Do not add any shared libraries.
|
|
|
|
// AAPT2 is built to run on many environments
|
|
|
|
// that may not have the required dependencies.
|
|
|
|
// ==========================================================
|
|
|
|
|
|
|
|
// ==========================================================
|
|
|
|
// Build the host static library: aapt2
|
|
|
|
// ==========================================================
|
|
|
|
cc_library_host_static {
|
|
|
|
name: "libaapt2",
|
|
|
|
srcs: [
|
|
|
|
"compile/IdAssigner.cpp",
|
|
|
|
"compile/InlineXmlFormatParser.cpp",
|
|
|
|
"compile/NinePatch.cpp",
|
|
|
|
"compile/Png.cpp",
|
|
|
|
"compile/PngChunkFilter.cpp",
|
|
|
|
"compile/PngCrunch.cpp",
|
|
|
|
"compile/PseudolocaleGenerator.cpp",
|
|
|
|
"compile/Pseudolocalizer.cpp",
|
|
|
|
"compile/XmlIdCollector.cpp",
|
|
|
|
"filter/ConfigFilter.cpp",
|
|
|
|
"flatten/Archive.cpp",
|
|
|
|
"flatten/TableFlattener.cpp",
|
|
|
|
"flatten/XmlFlattener.cpp",
|
2017-03-14 18:52:13 -07:00
|
|
|
"io/BigBufferStreams.cpp",
|
2017-01-12 14:24:31 -05:00
|
|
|
"io/File.cpp",
|
|
|
|
"io/FileSystem.cpp",
|
|
|
|
"io/Io.cpp",
|
|
|
|
"io/ZipArchive.cpp",
|
|
|
|
"link/AutoVersioner.cpp",
|
|
|
|
"link/ManifestFixer.cpp",
|
|
|
|
"link/ProductFilter.cpp",
|
|
|
|
"link/PrivateAttributeMover.cpp",
|
|
|
|
"link/ReferenceLinker.cpp",
|
|
|
|
"link/TableMerger.cpp",
|
|
|
|
"link/XmlNamespaceRemover.cpp",
|
|
|
|
"link/XmlReferenceLinker.cpp",
|
2017-02-21 14:22:30 -08:00
|
|
|
"optimize/ResourceDeduper.cpp",
|
|
|
|
"optimize/VersionCollapser.cpp",
|
2017-01-12 14:24:31 -05:00
|
|
|
"process/SymbolTable.cpp",
|
|
|
|
"proto/ProtoHelpers.cpp",
|
|
|
|
"proto/TableProtoDeserializer.cpp",
|
|
|
|
"proto/TableProtoSerializer.cpp",
|
|
|
|
"split/TableSplitter.cpp",
|
|
|
|
"unflatten/BinaryResourceParser.cpp",
|
|
|
|
"unflatten/ResChunkPullParser.cpp",
|
|
|
|
"util/BigBuffer.cpp",
|
|
|
|
"util/Files.cpp",
|
|
|
|
"util/Util.cpp",
|
|
|
|
"ConfigDescription.cpp",
|
|
|
|
"Debug.cpp",
|
|
|
|
"DominatorTree.cpp",
|
|
|
|
"Flags.cpp",
|
|
|
|
"java/AnnotationProcessor.cpp",
|
|
|
|
"java/ClassDefinition.cpp",
|
|
|
|
"java/JavaClassGenerator.cpp",
|
|
|
|
"java/ManifestClassGenerator.cpp",
|
|
|
|
"java/ProguardRules.cpp",
|
2017-02-01 00:29:25 +00:00
|
|
|
"LoadedApk.cpp",
|
2017-01-12 14:24:31 -05:00
|
|
|
"Locale.cpp",
|
|
|
|
"Resource.cpp",
|
|
|
|
"ResourceParser.cpp",
|
|
|
|
"ResourceTable.cpp",
|
|
|
|
"ResourceUtils.cpp",
|
|
|
|
"ResourceValues.cpp",
|
|
|
|
"SdkConstants.cpp",
|
|
|
|
"StringPool.cpp",
|
|
|
|
"xml/XmlActionExecutor.cpp",
|
|
|
|
"xml/XmlDom.cpp",
|
|
|
|
"xml/XmlPullParser.cpp",
|
|
|
|
"xml/XmlUtil.cpp",
|
|
|
|
"Format.proto",
|
|
|
|
],
|
|
|
|
proto: {
|
|
|
|
export_proto_headers: true,
|
|
|
|
},
|
|
|
|
defaults: ["aapt_defaults"],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==========================================================
|
|
|
|
// Build the host shared library: aapt2_jni
|
|
|
|
// ==========================================================
|
|
|
|
cc_library_host_shared {
|
|
|
|
name: "libaapt2_jni",
|
|
|
|
srcs: toolSources + ["jni/aapt2_jni.cpp"],
|
|
|
|
static_libs: ["libaapt2"],
|
|
|
|
defaults: ["aapt_defaults"],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==========================================================
|
|
|
|
// Build the host tests: aapt2_tests
|
|
|
|
// ==========================================================
|
|
|
|
cc_test_host {
|
|
|
|
name: "aapt2_tests",
|
|
|
|
srcs: ["**/*_test.cpp"],
|
|
|
|
static_libs: ["libaapt2"],
|
|
|
|
defaults: ["aapt_defaults"],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==========================================================
|
|
|
|
// Build the host executable: aapt2
|
|
|
|
// ==========================================================
|
|
|
|
cc_binary_host {
|
|
|
|
name: "aapt2",
|
|
|
|
srcs: ["Main.cpp"] + toolSources,
|
|
|
|
static_libs: ["libaapt2"],
|
|
|
|
defaults: ["aapt_defaults"],
|
|
|
|
}
|