summaryrefslogtreecommitdiff
path: root/compiler/src/main/java/android/databinding/annotationprocessor
diff options
context:
space:
mode:
authorYigit Boyar <yboyar@google.com>2015-07-06 09:48:45 -0700
committerYigit Boyar <yboyar@google.com>2015-07-06 13:11:34 -0700
commit08119ea342cb47910ca80ff646d746f00e4663ce (patch)
tree639a01cc13c0bd8856503979cbd1f4622479398c /compiler/src/main/java/android/databinding/annotationprocessor
parentb15fd21ad1821b5e6a1c0c4977bc24c01d6bc7ce (diff)
downloaddata-binding-08119ea342cb47910ca80ff646d746f00e4663ce.tar.gz
Print encoded errors only if data binding is invoked from the IDE
This CL makes Scope aware of execution environment. Now when invoked from tests or via IDE, we'll print exceptions as encoded so that we can parse them back. When user invokes from command line or any other tool, we will print human readable errors. The encoded error format may still change depending on conversations w/ Studio team. Bug: 21953001 Change-Id: I5bd3ea0cb6728e011225ee84d3e38817a2993a43
Diffstat (limited to 'compiler/src/main/java/android/databinding/annotationprocessor')
-rw-r--r--compiler/src/main/java/android/databinding/annotationprocessor/BuildInfoUtil.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/main/java/android/databinding/annotationprocessor/BuildInfoUtil.java b/compiler/src/main/java/android/databinding/annotationprocessor/BuildInfoUtil.java
index 95eb6759..b74e6e55 100644
--- a/compiler/src/main/java/android/databinding/annotationprocessor/BuildInfoUtil.java
+++ b/compiler/src/main/java/android/databinding/annotationprocessor/BuildInfoUtil.java
@@ -17,6 +17,7 @@
package android.databinding.annotationprocessor;
import android.databinding.BindingBuildInfo;
+import android.databinding.tool.processing.ScopedException;
import android.databinding.tool.util.L;
import android.databinding.tool.util.Preconditions;
@@ -32,6 +33,7 @@ public class BuildInfoUtil {
sCached = extractNotNull(roundEnvironment, BindingBuildInfo.class);
if (sCached != null) {
L.setDebugLog(sCached.enableDebugLogs());
+ ScopedException.encodeOutput(sCached.printEncodedError());
}
}
return sCached;