summaryrefslogtreecommitdiff
path: root/compiler/src/main/kotlin/android/databinding
diff options
context:
space:
mode:
authorYigit Boyar <yboyar@google.com>2018-11-30 14:06:18 -0800
committerYigit Boyar <yboyar@google.com>2018-12-04 02:28:58 +0000
commitdc3e97878889567dc552341b4b202e16a9d2e7f6 (patch)
treef628fd9f7774c78c24f3890d10ee5706e0b2f74a /compiler/src/main/kotlin/android/databinding
parent5df7b394ce63dbd9819e72281a4f3e7c2f2c3990 (diff)
downloaddata-binding-dc3e97878889567dc552341b4b202e16a9d2e7f6.tar.gz
Provide consistent output for includes
This CL fixes an issue where data binding generated code would be indeterministic, possibly breaking caches. Bug: 120255763 Test: existing tests pass Change-Id: I983fe418a02992b2292cdad512c0cd20806438cc
Diffstat (limited to 'compiler/src/main/kotlin/android/databinding')
-rw-r--r--compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt
index 9a161073..69853d91 100644
--- a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt
+++ b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt
@@ -458,7 +458,8 @@ class LayoutBinderWriter(val layoutBinder : LayoutBinder, val libTypes: LibTypes
list.add(it)
}
- includeMap.keys.forEach {
+ // sort keys for consistent output
+ includeMap.keys.sortedBy { indices[it] }.forEach {
val index = indices[it]
tab("sIncludes.setIncludes($index, ") {
tab("new String[] {${