summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-12-08 11:43:35 -0800
committerDeepanshu Gupta <deepanshu@google.com>2015-12-16 16:55:15 -0800
commit5bd6addc9cb9dda23d022a6632e90591457f613e (patch)
tree55177b0cb193148352be40ede20b7091af86755c /compiler
parent638a4e1fdc7dcbc8f472684b8c446909992db344 (diff)
downloaddata-binding-5bd6addc9cb9dda23d022a6632e90591457f613e.tar.gz
Add modules definitions.
These are referenced by the tools/idea project. Also, some minor code improvments. Change-Id: Ia1f6a80c257b9022a2efda553ccc9096e03edc00
Diffstat (limited to 'compiler')
-rw-r--r--compiler/compiler.iml41
-rw-r--r--compiler/src/main/kotlin/android/databinding/tool/ext/list_ext.kt4
2 files changed, 43 insertions, 2 deletions
diff --git a/compiler/compiler.iml b/compiler/compiler.iml
new file mode 100644
index 00000000..9fbbd679
--- /dev/null
+++ b/compiler/compiler.iml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
+ <excludeFolder url="file://$MODULE_DIR$/build" />
+ <excludeFolder url="file://$MODULE_DIR$/gradle" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="baseLibrary-base" exported="" />
+ <orderEntry type="module" module-name="compilerCommon" />
+ <orderEntry type="library" name="KotlinJavaRuntime" level="project" />
+ <orderEntry type="module-library" scope="TEST">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/m2/repository/junit/junit/4.12/junit-4.12.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/m2/repository/junit/junit/4.12/junit-4.12-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" scope="TEST">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ </component>
+</module> \ No newline at end of file
diff --git a/compiler/src/main/kotlin/android/databinding/tool/ext/list_ext.kt b/compiler/src/main/kotlin/android/databinding/tool/ext/list_ext.kt
index 3d23e138..70317f6a 100644
--- a/compiler/src/main/kotlin/android/databinding/tool/ext/list_ext.kt
+++ b/compiler/src/main/kotlin/android/databinding/tool/ext/list_ext.kt
@@ -31,13 +31,13 @@ public fun List<String>.joinToCamelCaseAsVar(): String = when(size) {
else -> get(0).toCamelCaseAsVar() + drop(1).joinToCamelCase()
}
-public fun Array<String>.joinToCamelCase(): String = when(size()) {
+public fun Array<String>.joinToCamelCase(): String = when(size) {
0 -> throw IllegalArgumentException("invalid section size, cannot be zero")
1 -> this.get(0).toCamelCase()
else -> this.map {it.toCamelCase()}.joinToString("")
}
-public fun Array<String>.joinToCamelCaseAsVar(): String = when(size()) {
+public fun Array<String>.joinToCamelCaseAsVar(): String = when(size) {
0 -> throw IllegalArgumentException("invalid section size, cannot be zero")
1 -> this.get(0).toCamelCaseAsVar()
else -> get(0).toCamelCaseAsVar() + drop(1).joinToCamelCase()