summaryrefslogtreecommitdiff
path: root/tools/aapt2/cmd/Compile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/cmd/Compile.cpp')
-rw-r--r--tools/aapt2/cmd/Compile.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/aapt2/cmd/Compile.cpp b/tools/aapt2/cmd/Compile.cpp
index 21719705838d..32686538c10d 100644
--- a/tools/aapt2/cmd/Compile.cpp
+++ b/tools/aapt2/cmd/Compile.cpp
@@ -630,6 +630,12 @@ class CompileContext : public IAaptContext {
return 0;
}
+ const std::set<std::string>& GetSplitNameDependencies() override {
+ UNIMPLEMENTED(FATAL) << "No Split Name Dependencies be needed in compile phase";
+ static std::set<std::string> empty;
+ return empty;
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(CompileContext);
@@ -735,7 +741,6 @@ int CompileCommand::Action(const std::vector<std::string>& args) {
}
std::unique_ptr<io::IFileCollection> file_collection;
- std::unique_ptr<IArchiveWriter> archive_writer;
// Collect the resources files to compile
if (options_.res_dir && options_.res_zip) {
@@ -756,8 +761,6 @@ int CompileCommand::Action(const std::vector<std::string>& args) {
context.GetDiagnostics()->Error(DiagMessage(options_.res_dir.value()) << err);
return 1;
}
-
- archive_writer = CreateZipFileArchiveWriter(context.GetDiagnostics(), options_.output_path);
} else if (options_.res_zip) {
if (!args.empty()) {
context.GetDiagnostics()->Error(DiagMessage() << "files given but --zip specified");
@@ -772,8 +775,6 @@ int CompileCommand::Action(const std::vector<std::string>& args) {
context.GetDiagnostics()->Error(DiagMessage(options_.res_zip.value()) << err);
return 1;
}
-
- archive_writer = CreateZipFileArchiveWriter(context.GetDiagnostics(), options_.output_path);
} else {
auto collection = util::make_unique<io::FileCollection>();
@@ -786,7 +787,14 @@ int CompileCommand::Action(const std::vector<std::string>& args) {
}
file_collection = std::move(collection);
+ }
+
+ std::unique_ptr<IArchiveWriter> archive_writer;
+ file::FileType output_file_type = file::GetFileType(options_.output_path);
+ if (output_file_type == file::FileType::kDirectory) {
archive_writer = CreateDirectoryArchiveWriter(context.GetDiagnostics(), options_.output_path);
+ } else {
+ archive_writer = CreateZipFileArchiveWriter(context.GetDiagnostics(), options_.output_path);
}
if (!archive_writer) {