Match src paths with aidl package name

In order for the build system to track updates to the header files
during incremental builds, always specify the src files using the same
path as the package for C++ compilations.

Also writes out the three interface headers from parcelables so that we
can always expect the same output files from all *.aidl files. This is
the same workaround used by StructuredParcelables.

Bug: 112114177
Bug: 111362593
Test: treehugger
Change-Id: I0b78f92fa0e77c67c3a92d8e281f0905336dd050
diff --git a/generate_cpp.cpp b/generate_cpp.cpp
index 9d2a1fb..a43033e 100644
--- a/generate_cpp.cpp
+++ b/generate_cpp.cpp
@@ -1214,10 +1214,26 @@
   return true;
 }
 
-bool GenerateCppParcelDeclaration(const std::string& filename, const IoDelegate& io_delegate) {
-  CodeWriterPtr code_writer = io_delegate.GetCodeWriter(filename);
-  *code_writer
+bool GenerateCppParcelDeclaration(const std::string& filename, const Options& options,
+                                  const AidlParcelable& parcelable, const IoDelegate& io_delegate) {
+  CodeWriterPtr source_writer = io_delegate.GetCodeWriter(filename);
+  *source_writer
       << "// This file is intentionally left blank as placeholder for parcel declaration.\n";
+  CHECK(source_writer->Close());
+
+  // TODO(b/111362593): no unecessary files just to have consistent output with interfaces
+  const string header_path = options.OutputHeaderDir() + HeaderFile(parcelable, ClassNames::RAW);
+  unique_ptr<CodeWriter> header_writer(io_delegate.GetCodeWriter(header_path));
+  header_writer->Write("#error TODO(b/111362593) parcelables do not have headers");
+  CHECK(header_writer->Close());
+  const string bp_header = options.OutputHeaderDir() + HeaderFile(parcelable, ClassNames::CLIENT);
+  unique_ptr<CodeWriter> bp_writer(io_delegate.GetCodeWriter(bp_header));
+  bp_writer->Write("#error TODO(b/111362593) parcelables do not have bp classes");
+  CHECK(bp_writer->Close());
+  const string bn_header = options.OutputHeaderDir() + HeaderFile(parcelable, ClassNames::SERVER);
+  unique_ptr<CodeWriter> bn_writer(io_delegate.GetCodeWriter(bn_header));
+  bn_writer->Write("#error TODO(b/111362593) parcelables do not have bn classes");
+  CHECK(bn_writer->Close());
 
   return true;
 }
@@ -1231,7 +1247,7 @@
 
   const AidlParcelable* parcelable_decl = defined_type.AsParcelable();
   if (parcelable_decl != nullptr) {
-    return GenerateCppParcelDeclaration(output_file, io_delegate);
+    return GenerateCppParcelDeclaration(output_file, options, *parcelable_decl, io_delegate);
   }
 
   const AidlInterface* interface = defined_type.AsInterface();