From 1ef0fa9d7242b1926543bc49e35905d1be02a781 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 15 Aug 2017 21:32:49 -0700 Subject: [PATCH] AAPT2: Fixup namespace implementation A few pieces were missing in the namespace mangling implementation. Namespace aware libraries now work, along with R class generation. Bug: 64706588 Test: make AaptTestNamespace_App Change-Id: I12f78d6aa909e782c0faf7ceaa36058f2e6c864a --- tools/aapt2/NameMangler.h | 7 +- tools/aapt2/ResourceParser.cpp | 29 +-- tools/aapt2/cmd/Link.cpp | 179 +++++++------- tools/aapt2/compile/InlineXmlFormatParser.cpp | 6 +- .../NamespaceTest/Android.mk | 2 + .../NamespaceTest/App/Android.mk | 29 +++ .../NamespaceTest/App/AndroidManifest.xml | 30 +++ .../App/res/layout/activity_main.xml | 29 +++ .../NamespaceTest/App/res/values/values.xml | 29 +++ .../aapt/namespace/app/MainActivity.java | 34 +++ .../NamespaceTest/LibOne/Android.mk | 28 +++ .../NamespaceTest/LibOne/AndroidManifest.xml | 21 ++ .../LibOne/res/values/values.xml | 28 +++ .../NamespaceTest/LibTwo/Android.mk | 29 +++ .../NamespaceTest/LibTwo/AndroidManifest.xml | 21 ++ .../LibTwo/res/values/values.xml | 27 +++ .../aapt/namespace/libtwo/TextView.java | 53 +++++ .../StaticLibTest/Android.mk | 2 + .../{AppOne => StaticLibTest/App}/Android.mk | 6 +- .../App}/AndroidManifest.xml | 0 .../App}/assets/subdir/subsubdir/test.txt | 0 .../App}/assets/test.txt | 0 .../App}/assets2/new.txt | 0 .../App}/assets2/test.txt | 0 .../App}/res/drawable/cheap_transparency.png | Bin .../App}/res/drawable/complex.9.png | Bin .../App}/res/drawable/icon.png | Bin .../App}/res/drawable/image.xml | 0 .../App}/res/drawable/outline_8x8.9.png | Bin .../round_rect_off_center_outline_32x16.9.png | Bin .../drawable/round_rect_outline_32x16.9.png | Bin .../App}/res/drawable/test.9.png | Bin .../App}/res/drawable/transparent_3x3.9.png | Bin .../transparent_optical_bounds_3x3.9.png | Bin .../App}/res/drawable/white_3x3.9.png | Bin .../drawable/white_optical_bounds_3x3.9.png | Bin .../App}/res/font/myfont-italic.ttf | 0 .../App}/res/font/myfont-normal.ttf | 0 .../App}/res/font/myfont.xml | 0 .../App}/res/layout-v21/main.xml | 1 - .../App}/res/layout/main.xml | 1 - .../App}/res/layout/special.xml | 0 .../App}/res/navigation/home.xml | 0 .../App}/res/raw/test.txt | 0 .../App}/res/transition/transition_set.xml | 0 .../App}/res/values-v4/styles.xml | 0 .../App}/res/values/colors.xml | 0 .../App}/res/values/styles.xml | 2 +- .../App}/res/values/test.xml | 0 .../src/com/android/aapt/app/one/AppOne.java | 0 .../LibOne}/Android.mk | 4 +- .../LibOne}/AndroidManifest.xml | 0 .../LibOne}/res/layout/layout.xml | 0 .../LibOne}/res/values/values.xml | 0 .../aapt/staticlib/one/StaticLibOne.java | 0 .../LibTwo}/Android.mk | 4 +- .../LibTwo}/AndroidManifest.xml | 0 .../LibTwo}/res/drawable/vector.xml | 0 .../LibTwo}/res/layout/layout_two.xml | 0 .../LibTwo}/res/values/values.xml | 0 .../aapt/staticlib/two/StaticLibTwo.java | 0 tools/aapt2/java/JavaClassGenerator.cpp | 5 +- tools/aapt2/link/Linkers.h | 88 +++---- tools/aapt2/link/ReferenceLinker.cpp | 218 ++++++++++-------- tools/aapt2/link/ReferenceLinker.h | 83 +++---- tools/aapt2/link/ReferenceLinker_test.cpp | 31 ++- tools/aapt2/link/TableMerger.cpp | 96 +++----- tools/aapt2/link/TableMerger.h | 82 ++----- tools/aapt2/link/XmlReferenceLinker.cpp | 56 +++-- tools/aapt2/xml/XmlDom.cpp | 12 +- tools/aapt2/xml/XmlDom.h | 3 +- tools/aapt2/xml/XmlDom_test.cpp | 18 +- tools/aapt2/xml/XmlPullParser.cpp | 7 +- tools/aapt2/xml/XmlPullParser.h | 3 +- tools/aapt2/xml/XmlUtil.cpp | 10 +- tools/aapt2/xml/XmlUtil.h | 15 +- 76 files changed, 822 insertions(+), 506 deletions(-) create mode 100644 tools/aapt2/integration-tests/NamespaceTest/Android.mk create mode 100644 tools/aapt2/integration-tests/NamespaceTest/App/Android.mk create mode 100644 tools/aapt2/integration-tests/NamespaceTest/App/AndroidManifest.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/App/res/layout/activity_main.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/App/res/values/values.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/App/src/com/android/aapt/namespace/app/MainActivity.java create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibOne/AndroidManifest.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibOne/res/values/values.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibTwo/AndroidManifest.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibTwo/res/values/values.xml create mode 100644 tools/aapt2/integration-tests/NamespaceTest/LibTwo/src/com/android/aapt/namespace/libtwo/TextView.java create mode 100644 tools/aapt2/integration-tests/StaticLibTest/Android.mk rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/Android.mk (90%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/AndroidManifest.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/assets/subdir/subsubdir/test.txt (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/assets/test.txt (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/assets2/new.txt (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/assets2/test.txt (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/cheap_transparency.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/complex.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/icon.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/image.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/outline_8x8.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/round_rect_off_center_outline_32x16.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/round_rect_outline_32x16.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/test.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/transparent_3x3.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/transparent_optical_bounds_3x3.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/white_3x3.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/drawable/white_optical_bounds_3x3.9.png (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/font/myfont-italic.ttf (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/font/myfont-normal.ttf (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/font/myfont.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/layout-v21/main.xml (91%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/layout/main.xml (94%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/layout/special.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/navigation/home.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/raw/test.txt (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/transition/transition_set.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/values-v4/styles.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/values/colors.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/values/styles.xml (95%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/res/values/test.xml (100%) rename tools/aapt2/integration-tests/{AppOne => StaticLibTest/App}/src/com/android/aapt/app/one/AppOne.java (100%) rename tools/aapt2/integration-tests/{StaticLibOne => StaticLibTest/LibOne}/Android.mk (87%) rename tools/aapt2/integration-tests/{StaticLibOne => StaticLibTest/LibOne}/AndroidManifest.xml (100%) rename tools/aapt2/integration-tests/{StaticLibOne => StaticLibTest/LibOne}/res/layout/layout.xml (100%) rename tools/aapt2/integration-tests/{StaticLibOne => StaticLibTest/LibOne}/res/values/values.xml (100%) rename tools/aapt2/integration-tests/{StaticLibOne => StaticLibTest/LibOne}/src/com/android/aapt/staticlib/one/StaticLibOne.java (100%) rename tools/aapt2/integration-tests/{StaticLibTwo => StaticLibTest/LibTwo}/Android.mk (89%) rename tools/aapt2/integration-tests/{StaticLibTwo => StaticLibTest/LibTwo}/AndroidManifest.xml (100%) rename tools/aapt2/integration-tests/{StaticLibTwo => StaticLibTest/LibTwo}/res/drawable/vector.xml (100%) rename tools/aapt2/integration-tests/{StaticLibTwo => StaticLibTest/LibTwo}/res/layout/layout_two.xml (100%) rename tools/aapt2/integration-tests/{StaticLibTwo => StaticLibTest/LibTwo}/res/values/values.xml (100%) rename tools/aapt2/integration-tests/{StaticLibTwo => StaticLibTest/LibTwo}/src/com/android/aapt/staticlib/two/StaticLibTwo.java (100%) diff --git a/tools/aapt2/NameMangler.h b/tools/aapt2/NameMangler.h index 1305a4cf0710c..f1aad29a5c58a 100644 --- a/tools/aapt2/NameMangler.h +++ b/tools/aapt2/NameMangler.h @@ -69,8 +69,7 @@ class NameMangler { * The mangled name should contain symbols that are illegal to define in XML, * so that there will never be name mangling collisions. */ - static std::string MangleEntry(const std::string& package, - const std::string& name) { + static std::string MangleEntry(const std::string& package, const std::string& name) { return package + "$" + name; } @@ -86,8 +85,8 @@ class NameMangler { } out_package->assign(out_name->data(), pivot); - out_name->assign(out_name->data() + pivot + 1, - out_name->size() - (pivot + 1)); + std::string new_name = out_name->substr(pivot + 1); + *out_name = std::move(new_name); return true; } diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp index a5783a532e230..8f85d4fcd5a8d 100644 --- a/tools/aapt2/ResourceParser.cpp +++ b/tools/aapt2/ResourceParser.cpp @@ -605,7 +605,7 @@ std::unique_ptr ResourceParser::ParseXml(xml::XmlPullParser* parser, if (processed_item) { // Fix up the reference. if (Reference* ref = ValueCast(processed_item.get())) { - TransformReferenceFromNamespace(parser, "", ref); + ResolvePackage(parser, ref); } return processed_item; } @@ -1074,15 +1074,13 @@ bool ResourceParser::ParseStyleItem(xml::XmlPullParser* parser, Style* style) { return false; } - Maybe maybe_key = - ResourceUtils::ParseXmlAttributeName(maybe_name.value()); + Maybe maybe_key = ResourceUtils::ParseXmlAttributeName(maybe_name.value()); if (!maybe_key) { - diag_->Error(DiagMessage(source) << "invalid attribute name '" - << maybe_name.value() << "'"); + diag_->Error(DiagMessage(source) << "invalid attribute name '" << maybe_name.value() << "'"); return false; } - TransformReferenceFromNamespace(parser, "", &maybe_key.value()); + ResolvePackage(parser, &maybe_key.value()); maybe_key.value().SetSource(source); std::unique_ptr value = ParseXml(parser, 0, kAllowRawString); @@ -1091,8 +1089,7 @@ bool ResourceParser::ParseStyleItem(xml::XmlPullParser* parser, Style* style) { return false; } - style->entries.push_back( - Style::Entry{std::move(maybe_key.value()), std::move(value)}); + style->entries.push_back(Style::Entry{std::move(maybe_key.value()), std::move(value)}); return true; } @@ -1104,21 +1101,18 @@ bool ResourceParser::ParseStyle(const ResourceType type, xml::XmlPullParser* par Maybe maybe_parent = xml::FindAttribute(parser, "parent"); if (maybe_parent) { - // If the parent is empty, we don't have a parent, but we also don't infer - // either. + // If the parent is empty, we don't have a parent, but we also don't infer either. if (!maybe_parent.value().empty()) { std::string err_str; - style->parent = ResourceUtils::ParseStyleParentReference( - maybe_parent.value(), &err_str); + style->parent = ResourceUtils::ParseStyleParentReference(maybe_parent.value(), &err_str); if (!style->parent) { diag_->Error(DiagMessage(out_resource->source) << err_str); return false; } - // Transform the namespace prefix to the actual package name, and mark the - // reference as + // Transform the namespace prefix to the actual package name, and mark the reference as // private if appropriate. - TransformReferenceFromNamespace(parser, "", &style->parent.value()); + ResolvePackage(parser, &style->parent.value()); } } else { @@ -1127,8 +1121,7 @@ bool ResourceParser::ParseStyle(const ResourceType type, xml::XmlPullParser* par size_t pos = style_name.find_last_of(u'.'); if (pos != std::string::npos) { style->parent_inferred = true; - style->parent = Reference( - ResourceName({}, ResourceType::kStyle, style_name.substr(0, pos))); + style->parent = Reference(ResourceName({}, ResourceType::kStyle, style_name.substr(0, pos))); } } @@ -1373,7 +1366,7 @@ bool ResourceParser::ParseDeclareStyleable(xml::XmlPullParser* parser, } Reference& child_ref = maybe_ref.value(); - xml::TransformReferenceFromNamespace(parser, "", &child_ref); + xml::ResolvePackage(parser, &child_ref); // Create the ParsedResource that will add the attribute to the table. ParsedResource child_resource; diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp index 35ab3c6515d18..88e2dc212b0ec 100644 --- a/tools/aapt2/cmd/Link.cpp +++ b/tools/aapt2/cmd/Link.cpp @@ -457,7 +457,8 @@ std::vector> ResourceFileFlattener::LinkAndVer const Source& src = doc->file.source; if (context_->IsVerbose()) { - context_->GetDiagnostics()->Note(DiagMessage() << "linking " << src.path); + context_->GetDiagnostics()->Note(DiagMessage() + << "linking " << src.path << " (" << doc->file.name << ")"); } XmlReferenceLinker xml_linker; @@ -505,6 +506,8 @@ bool ResourceFileFlattener::Flatten(ResourceTable* table, IArchiveWriter* archiv std::map, FileOperation> config_sorted_files; for (auto& pkg : table->packages) { + CHECK(!pkg->name.empty()) << "Packages must have names when being linked"; + for (auto& type : pkg->types) { // Sort by config and name, so that we get better locality in the zip file. config_sorted_files.clear(); @@ -701,7 +704,7 @@ class LinkCommand { util::make_unique(); for (const std::string& path : options_.include_paths) { if (context_->IsVerbose()) { - context_->GetDiagnostics()->Note(DiagMessage(path) << "loading include path"); + context_->GetDiagnostics()->Note(DiagMessage() << "including " << path); } // First try to load the file as a static lib. @@ -819,11 +822,9 @@ class LinkCommand { return app_info; } - /** - * Precondition: ResourceTable doesn't have any IDs assigned yet, nor is it linked. - * Postcondition: ResourceTable has only one package left. All others are - * stripped, or there is an error and false is returned. - */ + // Precondition: ResourceTable doesn't have any IDs assigned yet, nor is it linked. + // Postcondition: ResourceTable has only one package left. All others are + // stripped, or there is an error and false is returned. bool VerifyNoExternalPackages() { auto is_ext_package_func = [&](const std::unique_ptr& pkg) -> bool { return context_->GetCompilationPackage() != pkg->name || !pkg->id || @@ -965,10 +966,94 @@ class LinkCommand { context_->GetDiagnostics()->Error(DiagMessage() << "failed writing to '" << out_path << "': " << android::base::SystemErrorCodeToString(errno)); + return false; } return true; } + bool GenerateJavaClasses() { + // The set of packages whose R class to call in the main classes onResourcesLoaded callback. + std::vector packages_to_callback; + + JavaClassGeneratorOptions template_options; + template_options.types = JavaClassGeneratorOptions::SymbolTypes::kAll; + template_options.javadoc_annotations = options_.javadoc_annotations; + + if (context_->GetPackageType() == PackageType::kStaticLib || options_.generate_non_final_ids) { + template_options.use_final = false; + } + + if (context_->GetPackageType() == PackageType::kSharedLib) { + template_options.use_final = false; + template_options.rewrite_callback_options = OnResourcesLoadedCallbackOptions{}; + } + + const StringPiece actual_package = context_->GetCompilationPackage(); + StringPiece output_package = context_->GetCompilationPackage(); + if (options_.custom_java_package) { + // Override the output java package to the custom one. + output_package = options_.custom_java_package.value(); + } + + // Generate the private symbols if required. + if (options_.private_symbols) { + packages_to_callback.push_back(options_.private_symbols.value()); + + // If we defined a private symbols package, we only emit Public symbols + // to the original package, and private and public symbols to the private package. + JavaClassGeneratorOptions options = template_options; + options.types = JavaClassGeneratorOptions::SymbolTypes::kPublicPrivate; + if (!WriteJavaFile(&final_table_, actual_package, options_.private_symbols.value(), + options)) { + return false; + } + } + + // Generate copies of the original package R class but with different package names. + // This is to support non-namespaced builds. + for (const std::string& extra_package : options_.extra_java_packages) { + packages_to_callback.push_back(extra_package); + + JavaClassGeneratorOptions options = template_options; + options.types = JavaClassGeneratorOptions::SymbolTypes::kAll; + if (!WriteJavaFile(&final_table_, actual_package, extra_package, options)) { + return false; + } + } + + // Generate R classes for each package that was merged (static library). + // Use the actual package's resources only. + for (const std::string& package : table_merger_->merged_packages()) { + packages_to_callback.push_back(package); + + JavaClassGeneratorOptions options = template_options; + options.types = JavaClassGeneratorOptions::SymbolTypes::kAll; + if (!WriteJavaFile(&final_table_, package, package, options)) { + return false; + } + } + + // Generate the main public R class. + JavaClassGeneratorOptions options = template_options; + + // Only generate public symbols if we have a private package. + if (options_.private_symbols) { + options.types = JavaClassGeneratorOptions::SymbolTypes::kPublic; + } + + if (options.rewrite_callback_options) { + options.rewrite_callback_options.value().packages_to_callback = + std::move(packages_to_callback); + } + + if (!WriteJavaFile(&final_table_, actual_package, output_package, options, + options_.generate_text_symbols_path)) { + return false; + } + + return true; + } + bool WriteManifestJavaFile(xml::XmlResource* manifest_xml) { if (!options_.generate_java_class_path) { return true; @@ -1097,15 +1182,17 @@ class LinkCommand { bool result; if (options_.no_static_lib_packages) { - // Merge all resources as if they were in the compilation package. This is - // the old behavior of aapt. + // Merge all resources as if they were in the compilation package. This is the old behavior + // of aapt. - // Add the package to the set of --extra-packages so we emit an R.java for - // each library package. + // Add the package to the set of --extra-packages so we emit an R.java for each library + // package. if (!pkg->name.empty()) { options_.extra_java_packages.insert(pkg->name); } + // Clear the package name, so as to make the resources look like they are coming from the + // local package. pkg->name = ""; if (override) { result = table_merger_->MergeOverlay(Source(input), table.get(), collection.get()); @@ -1673,8 +1760,7 @@ class LinkCommand { bool error = false; { - // AndroidManifest.xml has no resource name, but the CallSite is built - // from the name + // AndroidManifest.xml has no resource name, but the CallSite is built from the name // (aka, which package the AndroidManifest.xml is coming from). // So we give it a package name so it can see local resources. manifest_xml->file.name.package = context_->GetCompilationPackage(); @@ -1727,72 +1813,7 @@ class LinkCommand { } if (options_.generate_java_class_path) { - // The set of packages whose R class to call in the main classes - // onResourcesLoaded callback. - std::vector packages_to_callback; - - JavaClassGeneratorOptions template_options; - template_options.types = JavaClassGeneratorOptions::SymbolTypes::kAll; - template_options.javadoc_annotations = options_.javadoc_annotations; - - if (context_->GetPackageType() == PackageType::kStaticLib || - options_.generate_non_final_ids) { - template_options.use_final = false; - } - - if (context_->GetPackageType() == PackageType::kSharedLib) { - template_options.use_final = false; - template_options.rewrite_callback_options = OnResourcesLoadedCallbackOptions{}; - } - - const StringPiece actual_package = context_->GetCompilationPackage(); - StringPiece output_package = context_->GetCompilationPackage(); - if (options_.custom_java_package) { - // Override the output java package to the custom one. - output_package = options_.custom_java_package.value(); - } - - // Generate the private symbols if required. - if (options_.private_symbols) { - packages_to_callback.push_back(options_.private_symbols.value()); - - // If we defined a private symbols package, we only emit Public symbols - // to the original package, and private and public symbols to the - // private package. - JavaClassGeneratorOptions options = template_options; - options.types = JavaClassGeneratorOptions::SymbolTypes::kPublicPrivate; - if (!WriteJavaFile(&final_table_, actual_package, options_.private_symbols.value(), - options)) { - return 1; - } - } - - // Generate all the symbols for all extra packages. - for (const std::string& extra_package : options_.extra_java_packages) { - packages_to_callback.push_back(extra_package); - - JavaClassGeneratorOptions options = template_options; - options.types = JavaClassGeneratorOptions::SymbolTypes::kAll; - if (!WriteJavaFile(&final_table_, actual_package, extra_package, options)) { - return 1; - } - } - - // Generate the main public R class. - JavaClassGeneratorOptions options = template_options; - - // Only generate public symbols if we have a private package. - if (options_.private_symbols) { - options.types = JavaClassGeneratorOptions::SymbolTypes::kPublic; - } - - if (options.rewrite_callback_options) { - options.rewrite_callback_options.value().packages_to_callback = - std::move(packages_to_callback); - } - - if (!WriteJavaFile(&final_table_, actual_package, output_package, options, - options_.generate_text_symbols_path)) { + if (!GenerateJavaClasses()) { return 1; } } diff --git a/tools/aapt2/compile/InlineXmlFormatParser.cpp b/tools/aapt2/compile/InlineXmlFormatParser.cpp index 857cdd5365a0c..a17926067a0b5 100644 --- a/tools/aapt2/compile/InlineXmlFormatParser.cpp +++ b/tools/aapt2/compile/InlineXmlFormatParser.cpp @@ -69,10 +69,10 @@ class Visitor : public xml::PackageAwareVisitor { // Use an empty string for the compilation package because we don't want to default to // the local package if the user specified name="style" or something. This should just // be the default namespace. - Maybe maybe_pkg = TransformPackageAlias(name.package, {}); + Maybe maybe_pkg = TransformPackageAlias(name.package); if (!maybe_pkg) { - context_->GetDiagnostics()->Error(DiagMessage(src) << "invalid namespace prefix '" - << name.package << "'"); + context_->GetDiagnostics()->Error(DiagMessage(src) + << "invalid namespace prefix '" << name.package << "'"); error_ = true; return; } diff --git a/tools/aapt2/integration-tests/NamespaceTest/Android.mk b/tools/aapt2/integration-tests/NamespaceTest/Android.mk new file mode 100644 index 0000000000000..6361f9b8ae7d7 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/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/NamespaceTest/App/Android.mk b/tools/aapt2/integration-tests/NamespaceTest/App/Android.mk new file mode 100644 index 0000000000000..6ed07b0c5c731 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/App/Android.mk @@ -0,0 +1,29 @@ +# +# Copyright (C) 2017 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_AAPT_NAMESPACES := true +LOCAL_PACKAGE_NAME := AaptTestNamespace_App +LOCAL_MODULE_TAGS := tests +LOCAL_SRC_FILES := $(call all-java-files-under,src) +LOCAL_STATIC_ANDROID_LIBRARIES := \ + AaptTestNamespace_LibOne \ + AaptTestNamespace_LibTwo +LOCAL_AAPT_FLAGS := -v +include $(BUILD_PACKAGE) diff --git a/tools/aapt2/integration-tests/NamespaceTest/App/AndroidManifest.xml b/tools/aapt2/integration-tests/NamespaceTest/App/AndroidManifest.xml new file mode 100644 index 0000000000000..6398a83ea1d26 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/App/AndroidManifest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + diff --git a/tools/aapt2/integration-tests/NamespaceTest/App/res/layout/activity_main.xml b/tools/aapt2/integration-tests/NamespaceTest/App/res/layout/activity_main.xml new file mode 100644 index 0000000000000..19bfd942a5bdc --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/App/res/layout/activity_main.xml @@ -0,0 +1,29 @@ + + + + + + \ No newline at end of file diff --git a/tools/aapt2/integration-tests/NamespaceTest/App/res/values/values.xml b/tools/aapt2/integration-tests/NamespaceTest/App/res/values/values.xml new file mode 100644 index 0000000000000..1b80d95428811 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/App/res/values/values.xml @@ -0,0 +1,29 @@ + + + + + Namespace App + true + + + \ No newline at end of file diff --git a/tools/aapt2/integration-tests/NamespaceTest/App/src/com/android/aapt/namespace/app/MainActivity.java b/tools/aapt2/integration-tests/NamespaceTest/App/src/com/android/aapt/namespace/app/MainActivity.java new file mode 100644 index 0000000000000..fcb4c3c12f816 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/App/src/com/android/aapt/namespace/app/MainActivity.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2017 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. + */ +package com.android.aapt.namespace.app; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.Toast; + +public class MainActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + com.android.aapt.namespace.libtwo.TextView tv = findViewById(R.id.textview); + + + + Toast.makeText(this, tv.getTextViewAttr(), Toast.LENGTH_LONG).show(); + } +} diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk b/tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk new file mode 100644 index 0000000000000..b1cac68dae7aa --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2017 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_AAPT_NAMESPACES := true +LOCAL_MODULE := AaptTestNamespace_LibOne +LOCAL_MODULE_TAGS := tests +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +# We need this to retain the R.java generated for this library. +LOCAL_JAR_EXCLUDE_FILES := none +include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibOne/AndroidManifest.xml b/tools/aapt2/integration-tests/NamespaceTest/LibOne/AndroidManifest.xml new file mode 100644 index 0000000000000..70b4b226624bc --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibOne/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibOne/res/values/values.xml b/tools/aapt2/integration-tests/NamespaceTest/LibOne/res/values/values.xml new file mode 100644 index 0000000000000..d2dcea0c0b1e4 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibOne/res/values/values.xml @@ -0,0 +1,28 @@ + + + + + + LibOne\'s textview_text string! + + + + + + + \ No newline at end of file diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk new file mode 100644 index 0000000000000..dc16d1bbb420d --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk @@ -0,0 +1,29 @@ +# +# Copyright (C) 2017 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_AAPT_NAMESPACES := true +LOCAL_MODULE := AaptTestNamespace_LibTwo +LOCAL_MODULE_TAGS := tests +LOCAL_SRC_FILES := $(call all-java-files-under,src) +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +# We need this to retain the R.java generated for this library. +LOCAL_JAR_EXCLUDE_FILES := none +include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibTwo/AndroidManifest.xml b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/AndroidManifest.xml new file mode 100644 index 0000000000000..32944a9b8f0b4 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibTwo/res/values/values.xml b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/res/values/values.xml new file mode 100644 index 0000000000000..0c5f5d8d55e00 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/res/values/values.xml @@ -0,0 +1,27 @@ + + + + + + LibTwo\'s public string! + + + + + + + + \ No newline at end of file diff --git a/tools/aapt2/integration-tests/NamespaceTest/LibTwo/src/com/android/aapt/namespace/libtwo/TextView.java b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/src/com/android/aapt/namespace/libtwo/TextView.java new file mode 100644 index 0000000000000..0f8024e587979 --- /dev/null +++ b/tools/aapt2/integration-tests/NamespaceTest/LibTwo/src/com/android/aapt/namespace/libtwo/TextView.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 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. + */ +package com.android.aapt.namespace.libtwo; + +import android.content.Context; +import android.content.res.TypedArray; +import android.util.AttributeSet; + +public class TextView extends android.widget.TextView { + + private String mTextViewAttr; + + public TextView(Context context) { + this(context, null); + } + + public TextView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public TextView(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public TextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + + final TypedArray ta = context.getTheme().obtainStyledAttributes(attrs, R.styleable.TextView, + 0, 0); + try { + mTextViewAttr = ta.getString(R.styleable.TextView_textview_attr); + } finally { + ta.recycle(); + } + } + + public String getTextViewAttr() { + return mTextViewAttr; + } +} diff --git a/tools/aapt2/integration-tests/StaticLibTest/Android.mk b/tools/aapt2/integration-tests/StaticLibTest/Android.mk new file mode 100644 index 0000000000000..6361f9b8ae7d7 --- /dev/null +++ b/tools/aapt2/integration-tests/StaticLibTest/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/StaticLibTest/App/Android.mk similarity index 90% rename from tools/aapt2/integration-tests/AppOne/Android.mk rename to tools/aapt2/integration-tests/StaticLibTest/App/Android.mk index 38bd5b5e32750..4d0c01d565a58 100644 --- a/tools/aapt2/integration-tests/AppOne/Android.mk +++ b/tools/aapt2/integration-tests/StaticLibTest/App/Android.mk @@ -18,12 +18,12 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_USE_AAPT2 := true -LOCAL_PACKAGE_NAME := AaptTestAppOne +LOCAL_PACKAGE_NAME := AaptTestStaticLib_App LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets $(LOCAL_PATH)/assets2 LOCAL_STATIC_ANDROID_LIBRARIES := \ - AaptTestStaticLibOne \ - AaptTestStaticLibTwo + AaptTestStaticLib_LibOne \ + AaptTestStaticLib_LibTwo LOCAL_AAPT_FLAGS := --no-version-vectors --no-version-transitions include $(BUILD_PACKAGE) diff --git a/tools/aapt2/integration-tests/AppOne/AndroidManifest.xml b/tools/aapt2/integration-tests/StaticLibTest/App/AndroidManifest.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/AndroidManifest.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/AndroidManifest.xml diff --git a/tools/aapt2/integration-tests/AppOne/assets/subdir/subsubdir/test.txt b/tools/aapt2/integration-tests/StaticLibTest/App/assets/subdir/subsubdir/test.txt similarity index 100% rename from tools/aapt2/integration-tests/AppOne/assets/subdir/subsubdir/test.txt rename to tools/aapt2/integration-tests/StaticLibTest/App/assets/subdir/subsubdir/test.txt diff --git a/tools/aapt2/integration-tests/AppOne/assets/test.txt b/tools/aapt2/integration-tests/StaticLibTest/App/assets/test.txt similarity index 100% rename from tools/aapt2/integration-tests/AppOne/assets/test.txt rename to tools/aapt2/integration-tests/StaticLibTest/App/assets/test.txt diff --git a/tools/aapt2/integration-tests/AppOne/assets2/new.txt b/tools/aapt2/integration-tests/StaticLibTest/App/assets2/new.txt similarity index 100% rename from tools/aapt2/integration-tests/AppOne/assets2/new.txt rename to tools/aapt2/integration-tests/StaticLibTest/App/assets2/new.txt diff --git a/tools/aapt2/integration-tests/AppOne/assets2/test.txt b/tools/aapt2/integration-tests/StaticLibTest/App/assets2/test.txt similarity index 100% rename from tools/aapt2/integration-tests/AppOne/assets2/test.txt rename to tools/aapt2/integration-tests/StaticLibTest/App/assets2/test.txt diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/cheap_transparency.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/cheap_transparency.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/cheap_transparency.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/cheap_transparency.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/complex.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/complex.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/complex.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/complex.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/icon.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/icon.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/icon.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/icon.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/image.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/image.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/image.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/image.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/outline_8x8.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/outline_8x8.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/outline_8x8.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/outline_8x8.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/round_rect_off_center_outline_32x16.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/round_rect_off_center_outline_32x16.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/round_rect_off_center_outline_32x16.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/round_rect_off_center_outline_32x16.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/round_rect_outline_32x16.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/round_rect_outline_32x16.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/round_rect_outline_32x16.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/round_rect_outline_32x16.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/test.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/test.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/test.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/test.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/transparent_3x3.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/transparent_3x3.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/transparent_3x3.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/transparent_3x3.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/transparent_optical_bounds_3x3.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/transparent_optical_bounds_3x3.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/transparent_optical_bounds_3x3.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/transparent_optical_bounds_3x3.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/white_3x3.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/white_3x3.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/white_3x3.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/white_3x3.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/drawable/white_optical_bounds_3x3.9.png b/tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/white_optical_bounds_3x3.9.png similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/drawable/white_optical_bounds_3x3.9.png rename to tools/aapt2/integration-tests/StaticLibTest/App/res/drawable/white_optical_bounds_3x3.9.png diff --git a/tools/aapt2/integration-tests/AppOne/res/font/myfont-italic.ttf b/tools/aapt2/integration-tests/StaticLibTest/App/res/font/myfont-italic.ttf similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/font/myfont-italic.ttf rename to tools/aapt2/integration-tests/StaticLibTest/App/res/font/myfont-italic.ttf diff --git a/tools/aapt2/integration-tests/AppOne/res/font/myfont-normal.ttf b/tools/aapt2/integration-tests/StaticLibTest/App/res/font/myfont-normal.ttf similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/font/myfont-normal.ttf rename to tools/aapt2/integration-tests/StaticLibTest/App/res/font/myfont-normal.ttf diff --git a/tools/aapt2/integration-tests/AppOne/res/font/myfont.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/font/myfont.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/font/myfont.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/font/myfont.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/layout-v21/main.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/layout-v21/main.xml similarity index 91% rename from tools/aapt2/integration-tests/AppOne/res/layout-v21/main.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/layout-v21/main.xml index 9f5a4a85cbcfc..724bfe4a9536f 100644 --- a/tools/aapt2/integration-tests/AppOne/res/layout-v21/main.xml +++ b/tools/aapt2/integration-tests/StaticLibTest/App/res/layout-v21/main.xml @@ -15,7 +15,6 @@ --> diff --git a/tools/aapt2/integration-tests/AppOne/res/layout/main.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/layout/main.xml similarity index 94% rename from tools/aapt2/integration-tests/AppOne/res/layout/main.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/layout/main.xml index ab1a251a7d563..aaa884bf7084a 100644 --- a/tools/aapt2/integration-tests/AppOne/res/layout/main.xml +++ b/tools/aapt2/integration-tests/StaticLibTest/App/res/layout/main.xml @@ -15,7 +15,6 @@ --> diff --git a/tools/aapt2/integration-tests/AppOne/res/layout/special.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/layout/special.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/layout/special.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/layout/special.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/navigation/home.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/navigation/home.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/navigation/home.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/navigation/home.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/raw/test.txt b/tools/aapt2/integration-tests/StaticLibTest/App/res/raw/test.txt similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/raw/test.txt rename to tools/aapt2/integration-tests/StaticLibTest/App/res/raw/test.txt diff --git a/tools/aapt2/integration-tests/AppOne/res/transition/transition_set.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/transition/transition_set.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/transition/transition_set.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/transition/transition_set.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/values-v4/styles.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/values-v4/styles.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/values-v4/styles.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/values-v4/styles.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/values/colors.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/values/colors.xml similarity index 100% rename from tools/aapt2/integration-tests/AppOne/res/values/colors.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/values/colors.xml diff --git a/tools/aapt2/integration-tests/AppOne/res/values/styles.xml b/tools/aapt2/integration-tests/StaticLibTest/App/res/values/styles.xml similarity index 95% rename from tools/aapt2/integration-tests/AppOne/res/values/styles.xml rename to tools/aapt2/integration-tests/StaticLibTest/App/res/values/styles.xml index 19d96c0809db1..a088e5d0e1a20 100644 --- a/tools/aapt2/integration-tests/AppOne/res/values/styles.xml +++ b/tools/aapt2/integration-tests/StaticLibTest/App/res/values/styles.xml @@ -14,7 +14,7 @@ limitations under the License. --> - +