Verify the locale format within a localeConfig file
Leverage the existing mechanism for validating the locale format to verify whether the locale format of the compiled localeConfig file follows the BCP47 reqular expressions
Bug: 208943132
Test: 1. atest aapt2_tests
2. Build the app bundle with the local aapt2 in the Android Studio
a. Make sure the app can be built pass with AGP 7.3.0-alpha06.
b. Make sure the app can be built pass by using the local aapt2 with gradle: set the android.aapt2FromMavenOverride=<path> variable in gradle.properties.
c. Revove the property above in gradle.properties then apply AGP 7.3.0-alpha07. Make sure the appt2 shows error(AAPT: error: failed to load XML file: No such file or directory) when building the app.
d. Add the locale aapt2 with gradle: set the android.aapt2FromMavenOverride=<path> variable in gradle.properties. Make sure the app can be built pass.
Change-Id: Ifa4b9123d36f9c2d450fdf16e1f52963962d7d81
diff --git a/tools/aapt2/test/Fixture.cpp b/tools/aapt2/test/Fixture.cpp
index ff8b368..dbc0e36 100644
--- a/tools/aapt2/test/Fixture.cpp
+++ b/tools/aapt2/test/Fixture.cpp
@@ -105,9 +105,9 @@
}
// Link against the android SDK
- std::string android_sdk = file::BuildPath({android::base::GetExecutableDirectory(),
- "integration-tests", "CommandTests",
- "android-28.jar"});
+ std::string android_sdk =
+ file::BuildPath({android::base::GetExecutableDirectory(), "integration-tests", "CommandTests",
+ "android-33.jar"});
link_args.insert(link_args.end(), {"-I", android_sdk});
return LinkCommand(diag).Execute(link_args, &std::cerr) == 0;
@@ -121,9 +121,9 @@
}
// Link against the android SDK
- std::string android_sdk = file::BuildPath({android::base::GetExecutableDirectory(),
- "integration-tests", "CommandTests",
- "android-28.jar"});
+ std::string android_sdk =
+ file::BuildPath({android::base::GetExecutableDirectory(), "integration-tests", "CommandTests",
+ "android-33.jar"});
link_args.insert(link_args.end(), {"-I", android_sdk});
// Add the files from the compiled resources directory to the link file arguments