AAPT2: Few tweaks to get shared-libraries working

Test: manual (building shared support library demo)
Change-Id: I4730645aa92ba1893baf67ffe35fbd4aac0f8e46
This commit is contained in:
Adam Lesinski
2017-02-22 19:29:29 -08:00
parent 9a53d03104
commit b5dc4bd49a
12 changed files with 132 additions and 71 deletions

View File

@@ -533,9 +533,14 @@ bool JavaClassGenerator::Generate(const StringPiece& package_name_to_generate,
std::unique_ptr<MethodDefinition> rewrite_method;
// Generate an onResourcesLoaded() callback if requested.
if (options_.generate_rewrite_callback) {
if (options_.rewrite_callback_options) {
rewrite_method =
util::make_unique<MethodDefinition>("public static void onResourcesLoaded(int p)");
for (const std::string& package_to_callback :
options_.rewrite_callback_options.value().packages_to_callback) {
rewrite_method->AppendStatement(
StringPrintf("%s.R.onResourcesLoaded(p);", package_to_callback.data()));
}
}
for (const auto& package : table_->packages) {