diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-10-13 11:37:10 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-10-16 15:50:58 -0700 |
commit | 9ba47d813075fcb05c5e1532c137c93b394631cb (patch) | |
tree | 1eb9f7adc315ab8ad640249f8ac1888951520f3f /tools/aapt2/Diagnostics.h | |
parent | 072c5bdff77e354bdf333c0c1d460cdd1c2e76ae (diff) |
Filter products during compile phase
Unfortunately there is no good way to deal with products in the link phase.
Products are like preprocessor defines in that they are processed early
and change the composition of the compiled unit.
Change-Id: I6d5e15ef60d29df8e83e059ba857c09333993779
Diffstat (limited to 'tools/aapt2/Diagnostics.h')
-rw-r--r-- | tools/aapt2/Diagnostics.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/aapt2/Diagnostics.h b/tools/aapt2/Diagnostics.h index d20ae1b92191..7ea26b3ed0df 100644 --- a/tools/aapt2/Diagnostics.h +++ b/tools/aapt2/Diagnostics.h @@ -51,12 +51,6 @@ public: mMessage << value; return *this; } -/* - template <typename T> DiagMessage& operator<<( - const ::std::function<::std::ostream&(::std::ostream&)>& f) { - f(mMessage); - return *this; - }*/ DiagMessageActual build() const { return DiagMessageActual{ mSource, mMessage.str() }; @@ -72,6 +66,8 @@ struct IDiagnostics { }; struct StdErrDiagnostics : public IDiagnostics { + size_t mNumErrors = 0; + void emit(const DiagMessage& msg, const char* tag) { DiagMessageActual actual = msg.build(); if (!actual.source.path.empty()) { @@ -81,7 +77,10 @@ struct StdErrDiagnostics : public IDiagnostics { } void error(const DiagMessage& msg) override { - emit(msg, "error: "); + if (mNumErrors < 20) { + emit(msg, "error: "); + } + mNumErrors++; } void warn(const DiagMessage& msg) override { |