diff options
author | Yigit Boyar <yboyar@google.com> | 2018-02-07 16:46:22 -0800 |
---|---|---|
committer | Yigit Boyar <yboyar@google.com> | 2018-02-08 09:57:13 -0800 |
commit | f5027dc1aeb3721d5875fcca3b6fb1446a5c37d4 (patch) | |
tree | c47b1effada1f3ea1cf467a3742bbccdded3bfe7 /compiler/src/main/kotlin/android/databinding/tool | |
parent | bbcef5a45b5f82ecb008b68fbf8c37f1a5b815e0 (diff) | |
download | data-binding-f5027dc1aeb3721d5875fcca3b6fb1446a5c37d4.tar.gz |
Remove dynamic util.
This class was only necessary when we had 2 different release cycles.
We don't need it anymore, even for backwards compatibility.
if developer is in v1, the library's code is regenerated so it won't
use DynamicUtil.
If developer is in v2, it was broken for libraries so there is no
way that a library w/ dynamic util reference exist.
Bug: 73020925
Test: TestApp/IndependentLibraryTest
Change-Id: Id43ca24a096de16c89c0913ee309ba29accccdcb
Diffstat (limited to 'compiler/src/main/kotlin/android/databinding/tool')
-rw-r--r-- | compiler/src/main/kotlin/android/databinding/tool/writer/DynamicUtilWriter.kt | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/compiler/src/main/kotlin/android/databinding/tool/writer/DynamicUtilWriter.kt b/compiler/src/main/kotlin/android/databinding/tool/writer/DynamicUtilWriter.kt deleted file mode 100644 index d349f95c..00000000 --- a/compiler/src/main/kotlin/android/databinding/tool/writer/DynamicUtilWriter.kt +++ /dev/null @@ -1,25 +0,0 @@ -package android.databinding.tool.writer; - -import android.databinding.tool.expr.ExprModel -import android.databinding.tool.reflection.ModelAnalyzer -import android.databinding.tool.reflection.ModelClass - -@Suppress("UNUSED_PARAMETER") // TODO remove in a followup CL, this class is not used anymore. -class DynamicUtilWriter { - fun write(targetSdk : kotlin.Int) : KCode = kcode("package android.databinding;") { - nl("") - nl("import android.os.Build.VERSION;") - nl("import android.os.Build.VERSION_CODES;") - nl("import android.databinding.BindingConversion;") - nl("") - annotateWithGenerated() - block("public class DynamicUtil") { - val analyzer = ModelAnalyzer.getInstance(); - ModelClass.UNBOX_MAPPING.forEach { - block("public static ${it.value.simpleName} ${ExprModel.SAFE_UNBOX_METHOD_NAME}(${it.key.canonicalName} boxed)") { - nl("return boxed == null ? ${analyzer.getDefaultValue(it.value.simpleName)} : (${it.value.canonicalName})boxed;"); - } - } - } - } -} |