initial commit for Room
This introduces the initial setup and testing infrastructure.
This CL also merges the build infras for lifecycle and room.
Bug: 32342709
Test: SqlParserTest.kt, QueryParserTest.kt
Change-Id: I595fa81fd4e201601279fabede8d12c446ef28c8
diff --git a/room/compiler/build.gradle b/room/compiler/build.gradle
new file mode 100644
index 0000000..19efcd4
--- /dev/null
+++ b/room/compiler/build.gradle
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+buildscript {
+ addRepos(repositories)
+ dependencies {
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+apply plugin: 'kotlin'
+apply plugin: 'maven'
+
+def antlrOut = "$buildDir/generated/antlr/grammar-gen/"
+sourceSets {
+ main.java.srcDirs += 'src/main/grammar-gen'
+ test.java.srcDirs += 'src/tests/kotlin'
+ main.java.srcDirs += antlrOut
+}
+
+dependencies {
+ compile project(":common")
+ compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ compile "com.google.auto:auto-common:$auto_common_version"
+ compile "com.squareup:javapoet:$javapoet_version"
+ compile 'org.antlr:antlr4:4.5.3'
+ testCompile "com.google.testing.compile:compile-testing:$compile_testing_version"
+ testCompile files(org.gradle.internal.jvm.Jvm.current().getToolsJar())
+ testCompile "junit:junit:$junit_version"
+ testCompile "com.intellij:annotations:$intellij_annotation"
+}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ repository(url: rootProject.ext.localMavenRepo)
+ pom.artifactId = 'lifecycle-compiler'
+ }
+ }
+}
+
+def generateAntlrTask = task('generateAntlrGrammar', type: JavaExec) {
+ def outFolder = file(antlrOut)
+ outputs.dir(outFolder)
+ inputs.dir("$projectDir/SQLite.g4")
+ classpath configurations.runtime
+ main "org.antlr.v4.Tool"
+ args "SQLite.g4", "-visitor", "-o", new File(outFolder, "com/android/support/room/parser").path,
+ "-package", "com.android.support.room.parser"
+}
+
+tasks.findByName("compileKotlin").dependsOn(generateAntlrTask)
+
+createKotlinCheckstyle(project)
+