diff --git a/tools/aapt2/Android.mk b/tools/aapt2/Android.mk index f9d35aba86d2e..57a769221a8f8 100644 --- a/tools/aapt2/Android.mk +++ b/tools/aapt2/Android.mk @@ -13,15 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -# This tool is prebuilt if we're doing an app-only build. -ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),) +LOCAL_PATH:= $(call my-dir) # ========================================================== # Setup some common variables for the different build # targets here. # ========================================================== -LOCAL_PATH:= $(call my-dir) main := Main.cpp sources := \ @@ -192,4 +189,6 @@ LOCAL_C_INCLUDES += $(protoIncludes) include $(BUILD_HOST_EXECUTABLE) -endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK +ifeq ($(ONE_SHOT_MAKEFILE),) +include $(call all-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/tools/aapt2/compile/Compile.cpp b/tools/aapt2/compile/Compile.cpp index 5f9719e61a9a0..2452a1d294101 100644 --- a/tools/aapt2/compile/Compile.cpp +++ b/tools/aapt2/compile/Compile.cpp @@ -422,10 +422,6 @@ static bool compileFile(IAaptContext* context, const CompileOptions& options, } class CompileContext : public IAaptContext { -private: - StdErrDiagnostics mDiagnostics; - bool mVerbose = false; - public: void setVerbose(bool val) { mVerbose = val; @@ -444,18 +440,24 @@ public: return nullptr; } - StringPiece16 getCompilationPackage() override { - return {}; + const std::u16string& getCompilationPackage() override { + static std::u16string empty; + return empty; } uint8_t getPackageId() override { return 0x0; } - ISymbolTable* getExternalSymbols() override { + SymbolTable* getExternalSymbols() override { abort(); return nullptr; } + +private: + StdErrDiagnostics mDiagnostics; + bool mVerbose = false; + }; /** diff --git a/tools/aapt2/data/AndroidManifest.xml b/tools/aapt2/data/AndroidManifest.xml deleted file mode 100644 index d3b2fbe515aef..0000000000000 --- a/tools/aapt2/data/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/tools/aapt2/data/Makefile b/tools/aapt2/data/Makefile deleted file mode 100644 index 37012decdf05e..0000000000000 --- a/tools/aapt2/data/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -## -# Environment dependent variables -## - -AAPT := aapt2 -ZIPALIGN := zipalign -f 4 -FRAMEWORK := ../../../../../out/target/common/obj/APPS/framework-res_intermediates/package-export.apk - -## -# Project depenedent variables -## - -LOCAL_PACKAGE := com.android.app -LOCAL_RESOURCE_DIR := res -LOCAL_LIBS := lib/out/package.apk -LOCAL_OUT := out -LOCAL_GEN := out/gen -LOCAL_PROGUARD := out/proguard.rule - -## -# AAPT2 custom rules. -## - -PRIVATE_R_FILE := $(LOCAL_GEN)/$(subst .,/,$(LOCAL_PACKAGE))/R.java -$(info PRIVATE_R_FILE = $(PRIVATE_R_FILE)) - -# Eg: framework.apk, etc. -PRIVATE_INCLUDES := $(FRAMEWORK) -$(info PRIVATE_INCLUDES = $(PRIVATE_INCLUDES)) - -# Eg: res/drawable/icon.png, res/values/styles.xml -PRIVATE_RESOURCES := $(shell find $(LOCAL_RESOURCE_DIR) -mindepth 1 -maxdepth 2 -type f) -$(info PRIVATE_RESOURCES = $(PRIVATE_RESOURCES)) - -PRIVATE_RESOURCE_OBJECTS := $(subst /,_,$(patsubst $(LOCAL_RESOURCE_DIR)/%,%,$(filter $(LOCAL_RESOURCE_DIR)/values%,$(PRIVATE_RESOURCES)))) -PRIVATE_RESOURCE_OBJECTS := $(addprefix $(LOCAL_OUT)/,$(PRIVATE_RESOURCE_OBJECTS:.xml=.arsc.flat)) -$(info PRIVATE_RESOURCE_OBJECTS = $(PRIVATE_RESOURCE_OBJECTS)) - -PRIVATE_FILE_OBJECTS := $(subst /,_,$(patsubst $(LOCAL_RESOURCE_DIR)/%,%,$(filter-out $(LOCAL_RESOURCE_DIR)/values%,$(PRIVATE_RESOURCES)))) -PRIVATE_FILE_OBJECTS := $(addprefix $(LOCAL_OUT)/,$(addsuffix .flat,$(PRIVATE_FILE_OBJECTS))) -$(info PRIVATE_FILE_OBJECTS = $(PRIVATE_FILE_OBJECTS)) - -.SECONDEXPANSION: - -$(LOCAL_OUT)/%.arsc.flat: $(LOCAL_RESOURCE_DIR)/$$(subst _,/,%).xml - $(AAPT) compile -o $(LOCAL_OUT) $< - -$(LOCAL_OUT)/%.flat: $(LOCAL_RESOURCE_DIR)/$$(subst _,/,%) - $(AAPT) compile -o $(LOCAL_OUT) $< - -$(LOCAL_PROGUARD) $(LOCAL_OUT)/package.apk: AndroidManifest.xml -$(PRIVATE_R_FILE) $(LOCAL_PROGUARD) $(LOCAL_OUT)/package.apk: $(PRIVATE_FILE_OBJECTS) $(PRIVATE_RESOURCE_OBJECTS) - $(AAPT) link -o $(LOCAL_OUT)/package.apk --manifest AndroidManifest.xml --java $(LOCAL_GEN) --proguard $(LOCAL_PROGUARD) -I $(PRIVATE_INCLUDES) $(filter-out AndroidManifest.xml,$^) -v - -# Create the out directory if needed. -dummy := $(shell test -d $(LOCAL_OUT) || mkdir -p $(LOCAL_OUT)) - -.PHONY: all -all: $(LOCAL_OUT)/package.apk $(LOCAL_PROGUARD) $(PRIVATE_R_FILE) - -.DEFAULT_GOAL := all diff --git a/tools/aapt2/data/lib/AndroidManifest.xml b/tools/aapt2/data/lib/AndroidManifest.xml deleted file mode 100644 index 08b468ee62296..0000000000000 --- a/tools/aapt2/data/lib/AndroidManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/tools/aapt2/data/lib/Makefile b/tools/aapt2/data/lib/Makefile deleted file mode 100644 index 741be9a0e75a8..0000000000000 --- a/tools/aapt2/data/lib/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -## -# Environment dependent variables -## - -AAPT := aapt2 -ZIPALIGN := zipalign -f 4 -FRAMEWORK := ../../../../../../out/target/common/obj/APPS/framework-res_intermediates/package-export.apk - -## -# Project depenedent variables -## - -LOCAL_PACKAGE := android.appcompat -LOCAL_RESOURCE_DIR := res -LOCAL_OUT := out -LOCAL_GEN := out/gen - -## -# AAPT2 custom rules. -## - -PRIVATE_APK_UNALIGNED := $(LOCAL_OUT)/package-unaligned.apk -PRIVATE_APK_ALIGNED := $(LOCAL_OUT)/package.apk - -# Eg: framework.apk, etc. -PRIVATE_LIBS := $(FRAMEWORK) -$(info PRIVATE_LIBS = $(PRIVATE_LIBS)) - -# Eg: gen/com/android/app/R.java -PRIVATE_R_JAVA := $(LOCAL_GEN)/$(subst .,/,$(LOCAL_PACKAGE))/R.java -$(info PRIVATE_R_JAVA = $(PRIVATE_R_JAVA)) - -# Eg: res/drawable/icon.png, res/values/styles.xml -PRIVATE_RESOURCES := $(shell find $(LOCAL_RESOURCE_DIR) -mindepth 1 -maxdepth 2 -type f) -$(info PRIVATE_RESOURCES = $(PRIVATE_RESOURCES)) - -# Eg: drawable, values, layouts -PRIVATE_RESOURCE_TYPES := \ - $(patsubst $(LOCAL_RESOURCE_DIR)/%/,%,$(sort $(dir $(PRIVATE_RESOURCES)))) -$(info PRIVATE_RESOURCE_TYPES = $(PRIVATE_RESOURCE_TYPES)) - -# Eg: out/values-v4.apk, out/drawable-xhdpi.apk -PRIVATE_INTERMEDIATE_TABLES := $(patsubst %,$(LOCAL_OUT)/%.apk,$(PRIVATE_RESOURCE_TYPES)) -$(info PRIVATE_INTERMEDIATE_TABLES = $(PRIVATE_INTERMEDIATE_TABLES)) - -# Generates rules for collect phase. -# $1: Resource type (values-v4) -# returns: out/values-v4.apk: res/values-v4/styles.xml res/values-v4/colors.xml -define make-collect-rule -$(LOCAL_OUT)/$1.apk: $(filter $(LOCAL_RESOURCE_DIR)/$1/%,$(PRIVATE_RESOURCES)) - $(AAPT) compile -o $$@ $$^ -endef - -# Collect: out/values-v4.apk <- res/values-v4/styles.xml res/values-v4/colors.xml -$(foreach d,$(PRIVATE_RESOURCE_TYPES),$(eval $(call make-collect-rule,$d))) - -# Link: out/package-unaligned.apk <- out/values-v4.apk out/drawable-v4.apk -$(PRIVATE_APK_UNALIGNED): $(PRIVATE_INTERMEDIATE_TABLES) $(PRIVATE_LIBS) AndroidManifest.xml - $(AAPT) link --manifest AndroidManifest.xml $(addprefix -I ,$(PRIVATE_LIBS)) --java $(LOCAL_GEN) -o $@ $(PRIVATE_INTERMEDIATE_TABLES) --static-lib - -# R.java: gen/com/android/app/R.java <- out/resources.arsc -# No action since R.java is generated when out/resources.arsc is. -$(PRIVATE_R_JAVA): $(PRIVATE_APK_UNALIGNED) - -# Assemble: zip out/resources.arsc AndroidManifest.xml and res/**/* -$(PRIVATE_APK_ALIGNED): $(PRIVATE_APK_UNALIGNED) - $(ZIPALIGN) $< $@ - -# Create the out directory if needed. -dummy := $(shell test -d $(LOCAL_OUT) || mkdir -p $(LOCAL_OUT)) - -.PHONY: java -java: $(PRIVATE_R_JAVA) - -.PHONY: assemble -assemble: $(PRIVATE_APK_ALIGNED) - -.PHONY: all -all: assemble java - -.DEFAULT_GOAL := all diff --git a/tools/aapt2/data/lib/res/layout/main.xml b/tools/aapt2/data/lib/res/layout/main.xml deleted file mode 100644 index 187ed2d75da3e..0000000000000 --- a/tools/aapt2/data/lib/res/layout/main.xml +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/tools/aapt2/data/lib/res/raw/hello.txt b/tools/aapt2/data/lib/res/raw/hello.txt deleted file mode 100644 index 44fc22bebb398..0000000000000 --- a/tools/aapt2/data/lib/res/raw/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Oh howdy there diff --git a/tools/aapt2/data/lib/res/values/styles.xml b/tools/aapt2/data/lib/res/values/styles.xml deleted file mode 100644 index 4ce6333940631..0000000000000 --- a/tools/aapt2/data/lib/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - true - diff --git a/tools/aapt2/data/res/drawable/image.xml b/tools/aapt2/data/res/drawable/image.xml deleted file mode 100644 index 9b387390ea82f..0000000000000 --- a/tools/aapt2/data/res/drawable/image.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tools/aapt2/data/res/layout-v21/main.xml b/tools/aapt2/data/res/layout-v21/main.xml deleted file mode 100644 index 959b349bfaffd..0000000000000 --- a/tools/aapt2/data/res/layout-v21/main.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/tools/aapt2/data/res/values-v4/styles.xml b/tools/aapt2/data/res/values-v4/styles.xml deleted file mode 100644 index 979a82a06df9f..0000000000000 --- a/tools/aapt2/data/res/values-v4/styles.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/tools/aapt2/data/res/values/colors.xml b/tools/aapt2/data/res/values/colors.xml deleted file mode 100644 index 89db5fb3ec45f..0000000000000 --- a/tools/aapt2/data/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #f44336 - #b71c1c - #fdd835 - diff --git a/tools/aapt2/data/res/values/test.xml b/tools/aapt2/data/res/values/test.xml deleted file mode 100644 index d7ab1c8ddde99..0000000000000 --- a/tools/aapt2/data/res/values/test.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Hey guys! My name is Adam. How are you? - - @android:string/ok - - - - - - - - diff --git a/tools/aapt2/data/resources.arsc b/tools/aapt2/data/resources.arsc deleted file mode 100644 index 6a416df0a96f3..0000000000000 Binary files a/tools/aapt2/data/resources.arsc and /dev/null differ diff --git a/tools/aapt2/data/resources_base.arsc b/tools/aapt2/data/resources_base.arsc deleted file mode 100644 index f9d06107b0e0f..0000000000000 Binary files a/tools/aapt2/data/resources_base.arsc and /dev/null differ diff --git a/tools/aapt2/data/resources_hdpi.arsc b/tools/aapt2/data/resources_hdpi.arsc deleted file mode 100644 index 97232a3317ba5..0000000000000 Binary files a/tools/aapt2/data/resources_hdpi.arsc and /dev/null differ diff --git a/tools/aapt2/dump/Dump.cpp b/tools/aapt2/dump/Dump.cpp index ad7de0ab2fbdd..56b9f9a3e0816 100644 --- a/tools/aapt2/dump/Dump.cpp +++ b/tools/aapt2/dump/Dump.cpp @@ -17,6 +17,7 @@ #include "Debug.h" #include "Diagnostics.h" #include "Flags.h" +#include "io/ZipArchive.h" #include "process/IResourceTableConsumer.h" #include "proto/ProtoSerialize.h" #include "util/Files.h" @@ -56,6 +57,35 @@ void dumpCompiledTable(const pb::ResourceTable& pbTable, const Source& source, void tryDumpFile(IAaptContext* context, const std::string& filePath) { std::string err; + std::unique_ptr zip = io::ZipFileCollection::create(filePath, &err); + if (zip) { + io::IFile* file = zip->findFile("resources.arsc.flat"); + if (file) { + std::unique_ptr data = file->openAsData(); + if (!data) { + context->getDiagnostics()->error(DiagMessage(filePath) + << "failed to open resources.arsc.flat"); + return; + } + + pb::ResourceTable pbTable; + if (!pbTable.ParseFromArray(data->data(), data->size())) { + context->getDiagnostics()->error(DiagMessage(filePath) + << "invalid resources.arsc.flat"); + return; + } + + std::unique_ptr table = deserializeTableFromPb( + pbTable, Source(filePath), context->getDiagnostics()); + if (table) { + DebugPrintTableOptions debugPrintTableOptions; + debugPrintTableOptions.showSources = true; + Debug::printTable(table.get(), debugPrintTableOptions); + } + } + return; + } + Maybe file = file::mmapPath(filePath, &err); if (!file) { context->getDiagnostics()->error(DiagMessage(filePath) << err); @@ -90,15 +120,16 @@ public: return nullptr; } - StringPiece16 getCompilationPackage() override { - return {}; + const std::u16string& getCompilationPackage() override { + static std::u16string empty; + return empty; } uint8_t getPackageId() override { return 0; } - ISymbolTable* getExternalSymbols() override { + SymbolTable* getExternalSymbols() override { abort(); return nullptr; } diff --git a/tools/aapt2/flatten/XmlFlattener.cpp b/tools/aapt2/flatten/XmlFlattener.cpp index 8219462f8a739..3eac6331aaa25 100644 --- a/tools/aapt2/flatten/XmlFlattener.cpp +++ b/tools/aapt2/flatten/XmlFlattener.cpp @@ -144,9 +144,9 @@ struct XmlFlattenerVisitor : public xml::Visitor { } static bool cmpXmlAttributeById(const xml::Attribute* a, const xml::Attribute* b) { - if (a->compiledAttribute) { - if (b->compiledAttribute) { - return a->compiledAttribute.value().id < b->compiledAttribute.value().id; + if (a->compiledAttribute && a->compiledAttribute.value().id) { + if (b->compiledAttribute && b->compiledAttribute.value().id) { + return a->compiledAttribute.value().id.value() < b->compiledAttribute.value().id.value(); } return true; } else if (!b->compiledAttribute) { @@ -167,8 +167,8 @@ struct XmlFlattenerVisitor : public xml::Visitor { // Filter the attributes. for (xml::Attribute& attr : node->attributes) { - if (mOptions.maxSdkLevel && attr.compiledAttribute) { - size_t sdkLevel = findAttributeSdkLevel(attr.compiledAttribute.value().id); + if (mOptions.maxSdkLevel && attr.compiledAttribute && attr.compiledAttribute.value().id) { + size_t sdkLevel = findAttributeSdkLevel(attr.compiledAttribute.value().id.value()); if (sdkLevel > mOptions.maxSdkLevel.value()) { continue; } @@ -191,8 +191,8 @@ struct XmlFlattenerVisitor : public xml::Visitor { uint16_t attributeIndex = 1; for (const xml::Attribute* xmlAttr : mFilteredAttrs) { // Assign the indices for specific attributes. - if (xmlAttr->compiledAttribute && - xmlAttr->compiledAttribute.value().id == kIdAttr) { + if (xmlAttr->compiledAttribute && xmlAttr->compiledAttribute.value().id && + xmlAttr->compiledAttribute.value().id.value() == kIdAttr) { flatElem->idIndex = util::hostToDevice16(attributeIndex); } else if (xmlAttr->namespaceUri.empty()) { if (xmlAttr->name == u"class") { @@ -208,7 +208,7 @@ struct XmlFlattenerVisitor : public xml::Visitor { flatAttr->rawValue.index = util::hostToDevice32(-1); - if (!xmlAttr->compiledAttribute) { + if (!xmlAttr->compiledAttribute || !xmlAttr->compiledAttribute.value().id) { // The attribute has no associated ResourceID, so the string order doesn't matter. addString(xmlAttr->name, kLowPriority, &flatAttr->name); } else { @@ -221,17 +221,17 @@ struct XmlFlattenerVisitor : public xml::Visitor { // Lookup the StringPool for this package and make the reference there. const xml::AaptAttribute& aaptAttr = xmlAttr->compiledAttribute.value(); - StringPool::Ref nameRef = mPackagePools[aaptAttr.id.packageId()].makeRef( - xmlAttr->name, StringPool::Context{ aaptAttr.id.id }); + StringPool::Ref nameRef = mPackagePools[aaptAttr.id.value().packageId()].makeRef( + xmlAttr->name, StringPool::Context{ aaptAttr.id.value().id }); // Add it to the list of strings to flatten. addString(nameRef, &flatAttr->name); + } - if (mOptions.keepRawValues) { - // Keep raw values (this is for static libraries). - // TODO(with a smarter inflater for binary XML, we can do without this). - addString(xmlAttr->value, kLowPriority, &flatAttr->rawValue); - } + if (mOptions.keepRawValues || !xmlAttr->compiledValue) { + // Keep raw values if the value is not compiled or + // if we're building a static library (need symbols). + addString(xmlAttr->value, kLowPriority, &flatAttr->rawValue); } if (xmlAttr->compiledValue) { @@ -240,7 +240,6 @@ struct XmlFlattenerVisitor : public xml::Visitor { } else { // Flatten as a regular string type. flatAttr->typedValue.dataType = android::Res_value::TYPE_STRING; - addString(xmlAttr->value, kLowPriority, &flatAttr->rawValue); addString(xmlAttr->value, kLowPriority, (ResStringPool_ref*) &flatAttr->typedValue.data); } diff --git a/tools/aapt2/flatten/XmlFlattener_test.cpp b/tools/aapt2/flatten/XmlFlattener_test.cpp index 8648879273288..fef5ca38fd654 100644 --- a/tools/aapt2/flatten/XmlFlattener_test.cpp +++ b/tools/aapt2/flatten/XmlFlattener_test.cpp @@ -32,7 +32,7 @@ public: mContext = test::ContextBuilder() .setCompilationPackage(u"com.app.test") .setNameManglerPolicy(NameManglerPolicy{ u"com.app.test" }) - .setSymbolTable(test::StaticSymbolTableBuilder() + .addSymbolSource(test::StaticSymbolSourceBuilder() .addSymbol(u"@android:attr/id", ResourceId(0x010100d0), test::AttributeBuilder().build()) .addSymbol(u"@com.app.test:id/id", ResourceId(0x7f020000)) diff --git a/tools/aapt2/integration-tests/Android.mk b/tools/aapt2/integration-tests/Android.mk new file mode 100644 index 0000000000000..6361f9b8ae7d7 --- /dev/null +++ b/tools/aapt2/integration-tests/Android.mk @@ -0,0 +1,2 @@ +LOCAL_PATH := $(call my-dir) +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/tools/aapt2/integration-tests/AppOne/Android.mk b/tools/aapt2/integration-tests/AppOne/Android.mk new file mode 100644 index 0000000000000..859cc8cbf4e53 --- /dev/null +++ b/tools/aapt2/integration-tests/AppOne/Android.mk @@ -0,0 +1,27 @@ +# +# Copyright (C) 2016 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. +# + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_USE_AAPT2 := true +LOCAL_PACKAGE_NAME := AaptTestAppOne +LOCAL_MODULE_TAGS := tests +LOCAL_SRC_FILES := $(call all-java-files-under,src) +LOCAL_STATIC_ANDROID_LIBRARIES := \ + AaptTestStaticLibOne \ + AaptTestStaticLibTwo +include $(BUILD_PACKAGE) diff --git a/tools/aapt2/integration-tests/AppOne/AndroidManifest.xml b/tools/aapt2/integration-tests/AppOne/AndroidManifest.xml new file mode 100644 index 0000000000000..b6d8f2d1b748e --- /dev/null +++ b/tools/aapt2/integration-tests/AppOne/AndroidManifest.xml @@ -0,0 +1,17 @@ + + + + diff --git a/tools/aapt2/integration-tests/AppOne/core b/tools/aapt2/integration-tests/AppOne/core new file mode 100644 index 0000000000000..a9ae9768e5d66 Binary files /dev/null and b/tools/aapt2/integration-tests/AppOne/core differ diff --git a/tools/aapt2/data/res/drawable/icon.png b/tools/aapt2/integration-tests/AppOne/res/drawable/icon.png similarity index 100% rename from tools/aapt2/data/res/drawable/icon.png rename to tools/aapt2/integration-tests/AppOne/res/drawable/icon.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/image.xml b/tools/aapt2/integration-tests/AppOne/res/drawable/image.xml new file mode 100644 index 0000000000000..6132a75d85d04 --- /dev/null +++ b/tools/aapt2/integration-tests/AppOne/res/drawable/image.xml @@ -0,0 +1,17 @@ + + + + diff --git a/tools/aapt2/data/res/drawable/test.9.png b/tools/aapt2/integration-tests/AppOne/res/drawable/test.9.png similarity index 100% rename from tools/aapt2/data/res/drawable/test.9.png rename to tools/aapt2/integration-tests/AppOne/res/drawable/test.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/layout-v21/main.xml b/tools/aapt2/integration-tests/AppOne/res/layout-v21/main.xml new file mode 100644 index 0000000000000..9f5a4a85cbcfc --- /dev/null +++ b/tools/aapt2/integration-tests/AppOne/res/layout-v21/main.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/tools/aapt2/data/res/layout/main.xml b/tools/aapt2/integration-tests/AppOne/res/layout/main.xml similarity index 55% rename from tools/aapt2/data/res/layout/main.xml rename to tools/aapt2/integration-tests/AppOne/res/layout/main.xml index 8a5e9e8ee58df..ab1a251a7d563 100644 --- a/tools/aapt2/data/res/layout/main.xml +++ b/tools/aapt2/integration-tests/AppOne/res/layout/main.xml @@ -1,4 +1,19 @@ + + + + + + + diff --git a/tools/aapt2/integration-tests/AppOne/res/values/colors.xml b/tools/aapt2/integration-tests/AppOne/res/values/colors.xml new file mode 100644 index 0000000000000..4df5077051d2a --- /dev/null +++ b/tools/aapt2/integration-tests/AppOne/res/values/colors.xml @@ -0,0 +1,21 @@ + + + + + #f44336 + #b71c1c + #fdd835 + diff --git a/tools/aapt2/data/res/values/styles.xml b/tools/aapt2/integration-tests/AppOne/res/values/styles.xml similarity index 59% rename from tools/aapt2/data/res/values/styles.xml rename to tools/aapt2/integration-tests/AppOne/res/values/styles.xml index 2bbdad1bcbf1e..f05845cfab285 100644 --- a/tools/aapt2/data/res/values/styles.xml +++ b/tools/aapt2/integration-tests/AppOne/res/values/styles.xml @@ -1,4 +1,19 @@ + +