Add "dumpapi.no_license" to omit license in dumps
A new property to control license header in dumps is added to
aidl_interface module.
When set to true, --dumpapi dumps without license headers.
This can be useful to avoid merge conflicts for projects which should
work with older AIDL compiler.
Bug: 179449077
Test: m test-piece-4-update-api (with no_license:true)
Change-Id: I0e72ee90085e643caa681214639f8c1f6fcde8f3
diff --git a/aidl_dumpapi.cpp b/aidl_dumpapi.cpp
index 6364929..06eb089 100644
--- a/aidl_dumpapi.cpp
+++ b/aidl_dumpapi.cpp
@@ -170,8 +170,10 @@
for (const auto& type : doc.DefinedTypes()) {
unique_ptr<CodeWriter> writer =
io_delegate.GetCodeWriter(GetApiDumpPathFor(*type, options));
- // dump doc comments (license) as well for each type
- DumpComments(*writer, doc.GetComments());
+ if (!options.DumpNoLicense()) {
+ // dump doc comments (license) as well for each type
+ DumpComments(*writer, doc.GetComments());
+ }
(*writer) << kPreamble;
if (!type->GetPackage().empty()) {
(*writer) << "package " << type->GetPackage() << ";\n";