Add new dependency generation option to aidl.
The SDK build system does not provide an output file
and instead uses the -o<FOLDER> option and lets aidl figure
out the intermediary folders that represents the packages,
and the filename based on the input file (and its package).
Because of this the -d<FILE> option to generate a dependency
file is not convenient.
Instead the new option, -a (no parameters), automatically generate
a dependency files next to the output file.
Also, when compiling parcelable aidl files, without the -b option,
a dependency file is still generated. This is used by the SDK build
system since it cannot parse the file separately and instead tries
to compile every .aidl file.
The generation of this dependency file (which shows no output) allows
to know when any type of aidl file has been compiled.
Change-Id: If81dc7e1e0a780592c94d1850a1d1b094d6e7908
diff --git a/tools/aidl/options.cpp b/tools/aidl/options.cpp
index 0aa7db2..7b2daeb 100644
--- a/tools/aidl/options.cpp
+++ b/tools/aidl/options.cpp
@@ -15,6 +15,7 @@
"OPTIONS:\n"
" -I<DIR> search path for import statements.\n"
" -d<FILE> generate dependency file.\n"
+ " -a generate dependency file next to the output file with the name based on the input file.\n"
" -p<FILE> file created by --preprocess to import.\n"
" -o<FOLDER> base output folder for generated files.\n"
" -b fail when trying to compile a parcelable.\n"
@@ -49,6 +50,7 @@
options->task = COMPILE_AIDL;
options->failOnParcelable = false;
+ options->autoDepFile = false;
// OPTIONS
while (i < argc) {
@@ -73,6 +75,9 @@
return usage();
}
}
+ else if (s[1] == 'a') {
+ options->autoDepFile = true;
+ }
else if (s[1] == 'p') {
if (len > 2) {
options->preprocessedFiles.push_back(s+2);