Introduce app-toolkit as a merger project for flatfoot.

This CL creates app-toolkit parent project to compile all
flatfoot. This helps w/ build servers while keeping client
setups simple.

I've also moved the integration-test of lifecycle project
into a regular project.

Similar to support library build,
./gradlew createArchive builds a zip maven repo
./gradlew assembleAndroidTest creates test apsk

Running lint from app-toolkit is not working. Seems like a
tools bug, will test it w/ latest version (lint on individual
projects work fine)

Bug: 33562494
Test: compiles locally
Change-Id: I13444b1716ab13d1d72fc89338a31edce5a08dc4
diff --git a/app-toolkit/.gitignore b/app-toolkit/.gitignore
new file mode 100644
index 0000000..be4e6f1
--- /dev/null
+++ b/app-toolkit/.gitignore
@@ -0,0 +1,4 @@
+local.properties
+maven-repo/
+build/
+*.DS_Store
diff --git a/app-toolkit/README.md b/app-toolkit/README.md
new file mode 100644
index 0000000..e36944f
--- /dev/null
+++ b/app-toolkit/README.md
@@ -0,0 +1,3 @@
+This is a wrapper project for flatfoot projects.
+You can use either individual projects or this one.
+Build server uses this project to build flatfoot.
\ No newline at end of file
diff --git a/lifecycle/integration-tests/TestApp/build.gradle b/app-toolkit/build.gradle
similarity index 76%
rename from lifecycle/integration-tests/TestApp/build.gradle
rename to app-toolkit/build.gradle
index 5956ea6..9267ecf 100644
--- a/lifecycle/integration-tests/TestApp/build.gradle
+++ b/app-toolkit/build.gradle
@@ -15,8 +15,8 @@
  */
 
 buildscript {
-    ext.projectRootFolder = new File(project.projectDir, "../..")
-    apply from: "${project.projectDir}/../../../flatfoot-common/init.gradle"
+    ext.supportRootFolder = new File(project.projectDir, "../")
+    apply from: 'init.gradle'
     ext.addRepos(repositories)
     dependencies {
         classpath "com.android.tools.build:gradle:$android_gradle_plugin_version"
@@ -24,11 +24,4 @@
             classpath "com.android.databinding:localizemaven:${localize_maven_version}"
         }
     }
-}
-
-subprojects { project ->
-    addRepos(project.repositories)
-    project.repositories.maven {
-        url "${localMavenRepo}"
-    }
 }
\ No newline at end of file
diff --git a/app-toolkit/gradle.properties b/app-toolkit/gradle.properties
new file mode 100644
index 0000000..23b1d9c
--- /dev/null
+++ b/app-toolkit/gradle.properties
@@ -0,0 +1 @@
+org.gradle.jvmargs=-Xmx3000M
\ No newline at end of file
diff --git a/app-toolkit/init.gradle b/app-toolkit/init.gradle
new file mode 100644
index 0000000..438a20e
--- /dev/null
+++ b/app-toolkit/init.gradle
@@ -0,0 +1,196 @@
+/*
+ * 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.
+ */
+import org.gradle.internal.os.OperatingSystem
+
+def root = ext.supportRootFolder
+def checkoutRoot = "${root}/../.."
+ext.checkoutRoot = checkoutRoot
+ext.prebuiltsRoot = "$checkoutRoot/prebuilts"
+ext.prebuiltsRootUri = "file://${prebuiltsRoot}"
+
+
+final String platform = OperatingSystem.current().isMacOsX() ? 'darwin' : 'linux'
+final String fullSdkPath = "${checkoutRoot}/fullsdk-${platform}"
+System.setProperty('android.home', "${checkoutRoot}/fullsdk-${platform}")
+File props = file("local.properties")
+props.write "sdk.dir=${fullSdkPath}"
+
+def buildDir
+def distDir
+if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) {
+    buildDir = new File(System.env.OUT_DIR + '/gradle/frameworks/support/build').getCanonicalFile()
+    distDir = new File(System.env.DIST_DIR).getCanonicalFile()
+} else {
+    buildDir = file("${checkoutRoot}/out/host/gradle/frameworks/support/build")
+    distDir = file("${project.rootDir}/../../out/dist")
+}
+println "dist dir: $distDir"
+def localMavenRepo = "file://${new File(buildDir, "flatfoot_repo").absolutePath}"
+ext.testApkDistOut = distDir
+ext.localMavenRepo = localMavenRepo
+
+ext.repoNames = ["$prebuiltsRootUri/maven_repo",
+                 "$prebuiltsRootUri/gradle-plugin",
+                 "$prebuiltsRootUri/tools/common/m2/repository",
+                 "$prebuiltsRootUri/tools/common/m2/internal",
+                 "$prebuiltsRootUri/tools/common/offline-m2",
+                 "$prebuiltsRootUri/maven_repo/android",
+                 "file://$fullSdkPath/extras/android/m2repository",
+                 "file://${new File(buildDir, "support_repo").absolutePath}"]
+
+ext.kotlin_version = "1.0.5"
+ext.android_gradle_plugin_version = "2.2.1"
+ext.auto_common_version = "0.6"
+ext.javapoet_version = "1.8.0"
+ext.compile_testing_version = "0.9"
+ext.localize_maven_version = "1.1"
+ext.support_lib_version = "25.1.0-SNAPSHOT"
+ext.junit_version = "4.12"
+ext.mockito_version = "1.9.5"
+ext.min_sdk_version = 14
+ext.target_sdk_version = 26
+ext.compile_sdk_version = 26
+ext.build_tools_version = "26.0.0"
+ext.intellij_annotation = "12.0"
+ext.espresso_version = "2.2.2"
+ext.release_version = "1.0-SNAPSHOT"
+ext.enablePublicRepos = System.getenv("ALLOW_PUBLIC_REPOS")
+
+// repository creation task
+def createRepoDistTask = rootProject.tasks.create(name : "createArchive", type: Zip) {
+    from localMavenRepo
+    destinationDir distDir
+    into 'appToolkitRepository'
+    baseName = String.format("sdk-repo-linux-appToolkitRepository-%s", rootProject.ext.release_version)
+}
+
+subprojects {
+    configurations.all {
+        resolutionStrategy {
+            force "com.google.guava:guava-jdk5:17.0"
+        }
+    }
+    def mavenGroup = project.getPath().split(":")[1]
+    project.group = "com.android.support.$mavenGroup"
+    project.version = release_version
+    addRepos(project.repositories)
+    
+    if (enablePublicRepos) {
+        apply plugin: 'com.android.databinding.localizemaven'
+        project.localizeMaven {
+            localRepoDir = file("$prebuiltsRoot/tools/common/m2/repository")
+            otherRepoDirs = repoNames
+        }
+    }
+
+    project.afterEvaluate {
+        // Copy instrumentation test APK into the dist dir
+        def assembleTestTask = project.tasks.findByPath('assembleAndroidTest')
+        if (assembleTestTask != null) {
+            assembleTestTask.doLast {
+                // If the project actually has some instrumentation tests, copy its APK
+                if (!project.android.sourceSets.androidTest.java.sourceFiles.isEmpty()) {
+                    def pkgTask = project.tasks.findByPath('packageDebugAndroidTest')
+                    copy {
+                        from(pkgTask.outputFile)
+                        into(rootProject.ext.testApkDistOut)
+                        rename { String fileName ->
+                            "${project.getPath().replace(':', '-').substring(1)}_${fileName}"
+                        }
+                    }
+                }
+            }
+        }
+
+        if (project.plugins.hasPlugin('maven')) {
+            def uploadArchivesTask = project.tasks.findByPath("uploadArchives")
+            if (uploadArchivesTask != null) {
+                createRepoDistTask.dependsOn(uploadArchivesTask)
+            }
+        }
+    }
+}
+
+
+
+def addRepos(RepositoryHandler handler) {
+    repoNames.each { repo ->
+        handler.maven {
+            url repo
+        }
+        if (ext.enablePublicRepos) {
+            handler.mavenCentral()
+            handler.jcenter()
+        }
+    }
+}
+
+def createKotlinCheckstyle(Project project) {
+    def kotlinCheckstyle = project.tasks.create(name : 'checkstyleKotlin', type: Checkstyle) {
+        configFile file("${project.rootProject.ext.supportRootFolder}/app-toolkit/kotlin-checkstyle.xml")
+        source project.sourceSets.main.allJava
+        source project.sourceSets.test.allJava
+        ignoreFailures false
+        showViolations true
+        include '**/*.kt'
+        classpath = project.files()
+        checkstyleClasspath = files(file("${project.rootProject.ext.checkoutRoot}/development/tools/checkstyle/checkstyle.jar").path)
+   }
+    project.tasks.findByName("check").dependsOn(kotlinCheckstyle)
+    // poor man's line length check
+    def lineCheck = project.tasks.create(name : "lineLengthCheck") {
+        (project.sourceSets.main.allJava.getSourceDirectories() +
+            project.sourceSets.test.allJava.getSourceDirectories()).each { sourceDir ->
+                  fileTree(dir : sourceDir, include : "**/*.kt").each{ file ->
+                      file.readLines().eachWithIndex { line, index ->
+                          if (line.size() > 100) {
+                              throw new Exception("line too long: file: $file line:$index line: $line")
+                          }
+                      }
+                  }
+        }
+    }
+    kotlinCheckstyle.dependsOn(lineCheck)
+}
+
+def createAndroidCheckstyle(Project project) {
+    def androidCheckstyle = project.tasks.create(name : 'checkstyleAndroid', type: Checkstyle) {
+        configFile file("${project.rootProject.ext.checkoutRoot}/development/tools/checkstyle/android-style.xml")
+        if (project.hasProperty('android')) {
+            source project.android.sourceSets.main.java.getSrcDirs()
+        }
+        if (project.sourceSets.hasProperty('main')) {
+          source project.sourceSets.main.allJava
+        }
+        ignoreFailures false
+        showViolations true
+        include '**/*.java'
+        classpath = project.files()
+        checkstyleClasspath = files(file("${project.rootProject.ext.checkoutRoot}/development/tools/checkstyle/checkstyle.jar").path)
+    }
+    project.tasks.findByName("check").dependsOn(androidCheckstyle)
+}
+
+def buildDir
+if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) {
+    buildDir = new File(System.env.OUT_DIR + '/gradle/frameworks/support/build').getCanonicalFile()
+} else {
+    buildDir = file("${ext.prebuiltsRootUri}/../out/host/gradle/frameworks/support/build")
+}
+ext.localMavenRepo = "file://${new File(buildDir, "flatfoot_repo").absolutePath}"
+ext.addRepos = this.&addRepos
+ext.createKotlinCheckstyle = this.&createKotlinCheckstyle
+ext.createAndroidCheckstyle = this.&createAndroidCheckstyle
\ No newline at end of file
diff --git a/flatfoot-common/kotlin-checkstyle.xml b/app-toolkit/kotlin-checkstyle.xml
similarity index 100%
rename from flatfoot-common/kotlin-checkstyle.xml
rename to app-toolkit/kotlin-checkstyle.xml
diff --git a/flatfoot-common/localize.sh b/app-toolkit/localize.sh
similarity index 100%
rename from flatfoot-common/localize.sh
rename to app-toolkit/localize.sh
diff --git a/app-toolkit/settings.gradle b/app-toolkit/settings.gradle
new file mode 100644
index 0000000..227ab26
--- /dev/null
+++ b/app-toolkit/settings.gradle
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+// If you change this file, you should also change the settings gradle inside
+// the sub project.
+include ':lifecycle:extensions'
+project(':lifecycle:extensions').projectDir = new File("../lifecycle/extensions")
+
+include ':lifecycle:runtime'
+project(':lifecycle:runtime').projectDir = new File("../lifecycle/runtime")
+
+include ':lifecycle:common'
+project(':lifecycle:common').projectDir = new File("../lifecycle/common")
+
+include ':lifecycle:compiler'
+project(':lifecycle:compiler').projectDir = new File("../lifecycle/compiler")
+
+include ':lifecycle:integration-tests:test-app'
+project(':lifecycle:integration-tests:test-app').projectDir = new File("../lifecycle/integration-tests/test-app")
+
+include ':room:common'
+project(':room:common').projectDir = new File("../room/common")
+
+include ':room:runtime'
+project(':room:runtime').projectDir = new File("../room/runtime")
+
+include ':room:compiler'
+project(':room:compiler').projectDir = new File("../room/compiler")
+
+include ':room:db'
+project(':room:db').projectDir = new File("../room/db")
+
+include ":room:db-impl"
+project(':room:db-impl').projectDir = new File("../room/db-impl")
+
+include ':room:integration-tests:testapp'
+project(':room:integration-tests:testapp').projectDir = new File("../room/integration-tests/testapp")
\ No newline at end of file
diff --git a/flatfoot-common/init.gradle b/flatfoot-common/init.gradle
deleted file mode 100644
index 3493d21..0000000
--- a/flatfoot-common/init.gradle
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.
- */
-import org.gradle.internal.os.OperatingSystem
-
-def root = ext.projectRootFolder
-def checkoutRoot = "${root}/../../../prebuilts"
-ext.prebuiltsRootUri = "file://${checkoutRoot}"
-
-
-final String platform = OperatingSystem.current().isMacOsX() ? 'darwin' : 'linux'
-final String fullSdkPath = "${checkoutRoot}/fullsdk-${platform}"
-System.setProperty('android.home', "${checkoutRoot}/fullsdk-${platform}")
-File props = file("local.properties")
-props.write "sdk.dir=${fullSdkPath}"
-
-
-ext.repoNames = ["$prebuiltsRootUri/maven_repo",
-                 "$prebuiltsRootUri/gradle-plugin",
-                 "$prebuiltsRootUri/tools/common/m2/repository",
-                 "$prebuiltsRootUri/tools/common/m2/internal",
-                 "$prebuiltsRootUri/tools/common/offline-m2",
-                 "$prebuiltsRootUri/maven_repo/android",
-                 "$prebuiltsRootUri/../out/host/gradle/frameworks/support/build/support_repo/"]
-
-ext.kotlin_version = "1.0.5"
-ext.android_gradle_plugin_version = "2.2.1"
-ext.auto_common_version = "0.6"
-ext.javapoet_version = "1.8.0"
-ext.compile_testing_version = "0.9"
-ext.localize_maven_version = "1.1"
-ext.support_lib_version = "25.1.0-SNAPSHOT"
-ext.junit_version = "4.12"
-ext.mockito_version = "1.9.5"
-ext.min_sdk_version = 14
-ext.target_sdk_version = 26
-ext.compile_sdk_version = 26
-ext.build_tools_version = "26.0.0"
-ext.intellij_annotation = "12.0"
-ext.espresso_version = "2.2.2"
-ext.release_version = "1.0-SNAPSHOT"
-ext.enablePublicRepos = System.getenv("ALLOW_PUBLIC_REPOS")
-
-def addRepos(RepositoryHandler handler) {
-    repoNames.each { repo ->
-        handler.maven {
-            url repo
-        }
-        if (ext.enablePublicRepos) {
-            handler.mavenCentral()
-            handler.jcenter()
-        }
-    }
-}
-
-def createKotlinCheckstyle(Project project) {
-    def kotlinCheckstyle = project.tasks.create(name : 'checkstyleKotlin', type: Checkstyle) {
-        configFile file("$projectRootFolder/../flatfoot-common/kotlin-checkstyle.xml")
-        source project.sourceSets.main.allJava
-        source project.sourceSets.test.allJava
-        ignoreFailures false
-        showViolations true
-        include '**/*.kt'
-        classpath = project.files()
-        checkstyleClasspath = files(file("$projectRootFolder../../../development/tools/checkstyle/checkstyle.jar").path)
-   }
-    project.tasks.findByName("check").dependsOn(kotlinCheckstyle)
-    // poor man's line length check
-    def lineCheck = project.tasks.create(name : "lineLengthCheck") {
-        (project.sourceSets.main.allJava.getSourceDirectories() +
-            project.sourceSets.test.allJava.getSourceDirectories()).each { sourceDir ->
-                  fileTree(dir : sourceDir, include : "**/*.kt").each{ file ->
-                      file.readLines().eachWithIndex { line, index ->
-                          if (line.size() > 100) {
-                              throw new Exception("line too long: file: $file line:$index line: $line")
-                          }
-                      }
-                  }
-        }
-    }
-    kotlinCheckstyle.dependsOn(lineCheck)
-}
-
-def createAndroidCheckstyle(Project project) {
-    def androidCheckstyle = project.tasks.create(name : 'checkstyleAndroid', type: Checkstyle) {
-        configFile file("$projectRootFolder/../../../development/tools/checkstyle/android-style.xml")
-        if (project.hasProperty('android')) {
-            source project.android.sourceSets.main.java.getSrcDirs()
-        }
-        if (project.sourceSets.hasProperty('main')) {
-          source project.sourceSets.main.allJava
-        }
-        ignoreFailures false
-        showViolations true
-        include '**/*.java'
-        classpath = project.files()
-        checkstyleClasspath = files(file("$projectRootFolder/../../../development/tools/checkstyle/checkstyle.jar").path)
-    }
-    project.tasks.findByName("check").dependsOn(androidCheckstyle)
-}
-
-def buildDir
-if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) {
-    buildDir = new File(System.env.OUT_DIR + '/gradle/frameworks/support/build').getCanonicalFile()
-} else {
-    buildDir = file("${ext.prebuiltsRootUri}/../out/host/gradle/frameworks/support/build")
-}
-ext.localMavenRepo = "file://${new File(buildDir, "flatfoot_repo").absolutePath}"
-ext.addRepos = this.&addRepos
-ext.createKotlinCheckstyle = this.&createKotlinCheckstyle
-ext.createAndroidCheckstyle = this.&createAndroidCheckstyle
\ No newline at end of file
diff --git a/lifecycle/build.gradle b/lifecycle/build.gradle
index 92152ed..3f56f20 100644
--- a/lifecycle/build.gradle
+++ b/lifecycle/build.gradle
@@ -1,6 +1,6 @@
 buildscript {
-    ext.projectRootFolder = project.rootProject.rootDir
-    apply from: '../flatfoot-common/init.gradle'
+    ext.supportRootFolder = new File(project.projectDir, "../")
+    apply from: '../app-toolkit/init.gradle'
     ext.addRepos(repositories)
     dependencies {
         classpath "com.android.tools.build:gradle:$android_gradle_plugin_version"
@@ -8,22 +8,4 @@
             classpath "com.android.databinding:localizemaven:${localize_maven_version}"
         }
     }
-}
-
-subprojects { project ->
-    configurations.all {
-        resolutionStrategy {
-            force "com.google.guava:guava-jdk5:17.0"
-        }
-    }
-    project.group = 'com.android.support.lifecycle'
-    project.version = release_version
-    addRepos(project.repositories)
-    if (enablePublicRepos) {
-        apply plugin: 'com.android.databinding.localizemaven'
-        project.localizeMaven {
-            localRepoDir = file("$prebuiltsRoot/tools/common/m2/repository")
-            otherRepoDirs = repoNames
-        }
-    }
 }
\ No newline at end of file
diff --git a/lifecycle/compiler/build.gradle b/lifecycle/compiler/build.gradle
index 5ae79d5..97a0c62 100644
--- a/lifecycle/compiler/build.gradle
+++ b/lifecycle/compiler/build.gradle
@@ -14,7 +14,7 @@
 }
 
 dependencies {
-    compile project(":common")
+    compile project(":lifecycle:common")
     compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
     compile "com.google.auto:auto-common:$auto_common_version"
     compile "com.squareup:javapoet:$javapoet_version"
diff --git a/lifecycle/extensions/build.gradle b/lifecycle/extensions/build.gradle
index 7912d8a..0160c9e 100644
--- a/lifecycle/extensions/build.gradle
+++ b/lifecycle/extensions/build.gradle
@@ -26,7 +26,7 @@
     }
 }
 dependencies {
-    compile project(":runtime")
+    compile project(":lifecycle:runtime")
     compile "com.android.support:support-fragment:$support_lib_version"
     testCompile "junit:junit:$junit_version"
     testCompile "org.mockito:mockito-core:$mockito_version"
diff --git a/lifecycle/integration-tests/TestApp/app/build.gradle b/lifecycle/integration-tests/TestApp/app/build.gradle
deleted file mode 100644
index 0dd41f7..0000000
--- a/lifecycle/integration-tests/TestApp/app/build.gradle
+++ /dev/null
@@ -1,45 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
-    compileSdkVersion compile_sdk_version
-    buildToolsVersion build_tools_version
-
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-    }
-
-    defaultConfig {
-        applicationId "com.android.support.lifecycle.testapp"
-        minSdkVersion min_sdk_version
-        targetSdkVersion target_sdk_version
-        versionCode 1
-        versionName "1.0"
-
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-        jackOptions {
-            enabled true
-        }
-    }
-
-    packagingOptions {
-        exclude 'META-INF/services/javax.annotation.processing.Processor'
-    }
-
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-}
-
-createAndroidCheckstyle(project)
-
-dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    compile "com.android.support.lifecycle:extensions:$release_version"
-    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-    testCompile "junit:junit:$junit_version"
-}
\ No newline at end of file
diff --git a/lifecycle/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.jar b/lifecycle/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/lifecycle/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/lifecycle/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties b/lifecycle/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 467c103..0000000
--- a/lifecycle/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Dec 28 10:00:20 PST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip
diff --git a/lifecycle/integration-tests/TestApp/gradlew b/lifecycle/integration-tests/TestApp/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/lifecycle/integration-tests/TestApp/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-##  Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
-    echo "$*"
-}
-
-die ( ) {
-    echo
-    echo "$*"
-    echo
-    exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
-  CYGWIN* )
-    cygwin=true
-    ;;
-  Darwin* )
-    darwin=true
-    ;;
-  MINGW* )
-    msys=true
-    ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-        PRG="$link"
-    else
-        PRG=`dirname "$PRG"`"/$link"
-    fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
-        # IBM's JDK on AIX uses strange locations for the executables
-        JAVACMD="$JAVA_HOME/jre/sh/java"
-    else
-        JAVACMD="$JAVA_HOME/bin/java"
-    fi
-    if [ ! -x "$JAVACMD" ] ; then
-        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-    fi
-else
-    JAVACMD="java"
-    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
-    MAX_FD_LIMIT=`ulimit -H -n`
-    if [ $? -eq 0 ] ; then
-        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
-            MAX_FD="$MAX_FD_LIMIT"
-        fi
-        ulimit -n $MAX_FD
-        if [ $? -ne 0 ] ; then
-            warn "Could not set maximum file descriptor limit: $MAX_FD"
-        fi
-    else
-        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
-    fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
-    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
-    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
-    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-    JAVACMD=`cygpath --unix "$JAVACMD"`
-
-    # We build the pattern for arguments to be converted via cygpath
-    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
-    SEP=""
-    for dir in $ROOTDIRSRAW ; do
-        ROOTDIRS="$ROOTDIRS$SEP$dir"
-        SEP="|"
-    done
-    OURCYGPATTERN="(^($ROOTDIRS))"
-    # Add a user-defined pattern to the cygpath arguments
-    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
-        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
-    fi
-    # Now convert the arguments - kludge to limit ourselves to /bin/sh
-    i=0
-    for arg in "$@" ; do
-        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
-        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
-
-        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
-            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
-        else
-            eval `echo args$i`="\"$arg\""
-        fi
-        i=$((i+1))
-    done
-    case $i in
-        (0) set -- ;;
-        (1) set -- "$args0" ;;
-        (2) set -- "$args0" "$args1" ;;
-        (3) set -- "$args0" "$args1" "$args2" ;;
-        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
-        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
-        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
-        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
-        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
-        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
-    esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
-    JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/lifecycle/integration-tests/TestApp/gradlew.bat b/lifecycle/integration-tests/TestApp/gradlew.bat
deleted file mode 100644
index 8a0b282..0000000
--- a/lifecycle/integration-tests/TestApp/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem  Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/lifecycle/integration-tests/TestApp/settings.gradle b/lifecycle/integration-tests/TestApp/settings.gradle
deleted file mode 100644
index 9d495b3..0000000
--- a/lifecycle/integration-tests/TestApp/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':app'
\ No newline at end of file
diff --git a/lifecycle/integration-tests/TestApp/app/.gitignore b/lifecycle/integration-tests/test-app/.gitignore
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/.gitignore
rename to lifecycle/integration-tests/test-app/.gitignore
diff --git a/lifecycle/integration-tests/test-app/build.gradle b/lifecycle/integration-tests/test-app/build.gradle
new file mode 100644
index 0000000..bba225b
--- /dev/null
+++ b/lifecycle/integration-tests/test-app/build.gradle
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion compile_sdk_version
+    buildToolsVersion build_tools_version
+
+    defaultConfig {
+        minSdkVersion min_sdk_version
+        targetSdkVersion target_sdk_version
+        versionCode 1
+        versionName "1.0"
+
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+        jackOptions {
+            enabled true
+        }
+    }
+
+    testOptions {
+        unitTests.returnDefaultValues = true
+    }
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+}
+
+dependencies {
+    compile fileTree(dir: 'libs', include: ['*.jar'])
+    compile project(":lifecycle:extensions")
+    androidTestCompile("com.android.support.test.espresso:espresso-core:$espresso_version", {
+        exclude group: 'com.android.support', module: 'support-annotations'
+    })
+    testCompile "junit:junit:$junit_version"
+}
+
+createAndroidCheckstyle(project)
+
+tasks['check'].dependsOn(tasks['connectedCheck'])
diff --git a/lifecycle/integration-tests/TestApp/app/proguard-rules.pro b/lifecycle/integration-tests/test-app/proguard-rules.pro
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/proguard-rules.pro
rename to lifecycle/integration-tests/test-app/proguard-rules.pro
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/ActivityFullLifecycleTest.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/ActivityFullLifecycleTest.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/ActivityFullLifecycleTest.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/ActivityFullLifecycleTest.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/SynchronousActivityLifecycleTest.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/SynchronousActivityLifecycleTest.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/SynchronousActivityLifecycleTest.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/SynchronousActivityLifecycleTest.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/BaseStateProviderTest.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/BaseStateProviderTest.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/BaseStateProviderTest.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/BaseStateProviderTest.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/FragmentStatesTests.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/FragmentStatesTests.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/FragmentStatesTests.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/FragmentStatesTests.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/RetainedStateProviderTest.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/RetainedStateProviderTest.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/RetainedStateProviderTest.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/RetainedStateProviderTest.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/SavedStateProviderTest.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/SavedStateProviderTest.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/SavedStateProviderTest.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/SavedStateProviderTest.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/TestUtils.java b/lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/TestUtils.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/androidTest/java/com/android/support/lifecycle/state/TestUtils.java
rename to lifecycle/integration-tests/test-app/src/androidTest/java/com/android/support/lifecycle/state/TestUtils.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/main/AndroidManifest.xml b/lifecycle/integration-tests/test-app/src/main/AndroidManifest.xml
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/main/AndroidManifest.xml
rename to lifecycle/integration-tests/test-app/src/main/AndroidManifest.xml
diff --git a/lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/FullLifecycleTestActivity.java b/lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/FullLifecycleTestActivity.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/FullLifecycleTestActivity.java
rename to lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/FullLifecycleTestActivity.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/LifecycleTestActivity.java b/lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/LifecycleTestActivity.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/LifecycleTestActivity.java
rename to lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/LifecycleTestActivity.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/MainActivity.java b/lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/MainActivity.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/MainActivity.java
rename to lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/MainActivity.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/UsualFragment.java b/lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/UsualFragment.java
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/main/java/com/android/support/lifecycle/testapp/UsualFragment.java
rename to lifecycle/integration-tests/test-app/src/main/java/com/android/support/lifecycle/testapp/UsualFragment.java
diff --git a/lifecycle/integration-tests/TestApp/app/src/main/res/layout/activity.xml b/lifecycle/integration-tests/test-app/src/main/res/layout/activity.xml
similarity index 100%
rename from lifecycle/integration-tests/TestApp/app/src/main/res/layout/activity.xml
rename to lifecycle/integration-tests/test-app/src/main/res/layout/activity.xml
diff --git a/lifecycle/runtime/build.gradle b/lifecycle/runtime/build.gradle
index 749b52d..35ca202 100644
--- a/lifecycle/runtime/build.gradle
+++ b/lifecycle/runtime/build.gradle
@@ -27,7 +27,7 @@
 }
 
 dependencies {
-    compile project(":common")
+    compile project(":lifecycle:common")
     // using classes like Pair from support core allows Lifecycle to be compatible w/ junit tests
     compile "com.android.support:support-fragment:$support_lib_version"
     testCompile "junit:junit:$junit_version"
diff --git a/lifecycle/settings.gradle b/lifecycle/settings.gradle
index 2643340..1aa5341 100644
--- a/lifecycle/settings.gradle
+++ b/lifecycle/settings.gradle
@@ -1,4 +1,16 @@
-include ':extensions'
-include ':runtime'
-include 'common'
-include 'compiler'
\ No newline at end of file
+// if you modify this file, you should modify ../app-toolkit/settings.gradle as well.
+
+include ':lifecycle:extensions'
+project(':lifecycle:extensions').projectDir = new File("extensions")
+
+include ':lifecycle:runtime'
+project(':lifecycle:runtime').projectDir = new File("runtime")
+
+include ':lifecycle:common'
+project(':lifecycle:common').projectDir = new File("common")
+
+include ':lifecycle:compiler'
+project(':lifecycle:compiler').projectDir = new File("compiler")
+
+include ':lifecycle:integration-tests:test-app'
+project(':lifecycle:integration-tests:test-app').projectDir = new File("integration-tests/test-app")
diff --git a/room/build.gradle b/room/build.gradle
index d2b1c5d..2b4a885 100644
--- a/room/build.gradle
+++ b/room/build.gradle
@@ -15,8 +15,8 @@
  */
 
 buildscript {
-    ext.projectRootFolder = project.rootProject.rootDir
-    apply from: '../flatfoot-common/init.gradle'
+    ext.supportRootFolder = new File(project.projectDir, "../")
+    apply from: '../app-toolkit/init.gradle'
     ext.addRepos(repositories)
     dependencies {
         classpath "com.android.tools.build:gradle:$android_gradle_plugin_version"
@@ -24,22 +24,4 @@
             classpath "com.android.databinding:localizemaven:${localize_maven_version}"
         }
     }
-}
-
-subprojects { project ->
-    configurations.all {
-        resolutionStrategy {
-            force "com.google.guava:guava-jdk5:17.0"
-        }
-    }
-    project.group = 'com.android.support.room'
-    project.version = release_version
-    addRepos(project.repositories)
-    if (enablePublicRepos) {
-        apply plugin: 'com.android.databinding.localizemaven'
-        project.localizeMaven {
-            localRepoDir = file("$prebuiltsRoot/tools/common/m2/repository")
-            otherRepoDirs = repoNames
-        }
-    }
 }
\ No newline at end of file
diff --git a/room/compiler/build.gradle b/room/compiler/build.gradle
index bfccb98..ee8bdf6 100644
--- a/room/compiler/build.gradle
+++ b/room/compiler/build.gradle
@@ -36,7 +36,7 @@
     def logger = new com.android.build.gradle.internal.LoggerWrapper(project.logger)
     def sdkHandler = new com.android.build.gradle.internal.SdkHandler(project, logger)
 
-    compile project(":common")
+    compile project(":room:common")
     compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
     compile "com.google.auto:auto-common:$auto_common_version"
     compile "com.squareup:javapoet:$javapoet_version"
@@ -47,8 +47,10 @@
     testCompile "org.mockito:mockito-core:$mockito_version"
     testCompile fileTree(dir: "${sdkHandler.sdkFolder}/platforms/android-$target_sdk_version/",
             include : "android.jar")
-    testCompile fileTree(dir: "${new File(project(":runtime").buildDir, "libJar")}", include : "*.jar")
-    testCompile fileTree(dir: "${new File(project(":db").buildDir, "libJar")}", include : "*.jar")
+    testCompile fileTree(dir: "${new File(project(":room:runtime").buildDir, "libJar")}",
+            include : "*.jar")
+    testCompile fileTree(dir: "${new File(project(":room:db").buildDir, "libJar")}",
+            include : "*.jar")
     testCompile files(org.gradle.internal.jvm.Jvm.current().getToolsJar())
 }
 
@@ -72,8 +74,8 @@
 }
 
 tasks.findByName("compileKotlin").dependsOn(generateAntlrTask)
-tasks.findByName("compileKotlin").dependsOn(":runtime:jarDebug")
-tasks.findByName("compileKotlin").dependsOn(":db:jarDebug")
+tasks.findByName("compileKotlin").dependsOn(":room:runtime:jarDebug")
+tasks.findByName("compileKotlin").dependsOn(":room:db:jarDebug")
 
 createKotlinCheckstyle(project)
 
diff --git a/room/db-impl/build.gradle b/room/db-impl/build.gradle
index ccbb6fd..71b2aa0 100644
--- a/room/db-impl/build.gradle
+++ b/room/db-impl/build.gradle
@@ -57,7 +57,7 @@
 
 dependencies {
     compile "com.android.support:support-annotations:$support_lib_version"
-    compile project(":db")
+    compile project(":room:db")
 }
 createAndroidCheckstyle(project)
 
diff --git a/room/integration-tests/testapp/build.gradle b/room/integration-tests/testapp/build.gradle
index 96930e3..a31bd1a 100644
--- a/room/integration-tests/testapp/build.gradle
+++ b/room/integration-tests/testapp/build.gradle
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 apply plugin: 'com.android.library'
-apply plugin: 'maven'
 
 android {
     compileSdkVersion compile_sdk_version
@@ -39,31 +38,22 @@
 }
 
 dependencies {
-    compile project(":common")
-    compile project(":db")
-    compile project(":db-impl")
-    compile "com.android.support:appcompat-v7:$support_lib_version"
+    compile project(":room:common")
+    compile project(":room:db")
+    compile project(":room:db-impl")
+    compile project(':room:runtime')
 
-    androidTestAnnotationProcessor project(":compiler")
+    compile "com.android.support:appcompat-v7:$support_lib_version"
+    androidTestAnnotationProcessor project(":room:compiler")
 
     androidTestCompile("com.android.support.test.espresso:espresso-core:$espresso_version", {
         exclude group: 'com.android.support', module: 'support-annotations'
     })
     testCompile "junit:junit:$junit_version"
     testCompile "org.mockito:mockito-core:$mockito_version"
-    compile project(path: ':runtime')
+
 }
 
 createAndroidCheckstyle(project)
 
-android.libraryVariants.all { variant ->
-    def name = variant.buildType.name
-    def suffix = name.capitalize()
-    def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
-        dependsOn variant.javaCompile
-        from variant.javaCompile.destinationDir
-        destinationDir new File(project.buildDir, "libJar")
-    }
-}
-
 tasks['check'].dependsOn(tasks['connectedCheck'])
diff --git a/room/runtime/build.gradle b/room/runtime/build.gradle
index a917757..38321d3 100644
--- a/room/runtime/build.gradle
+++ b/room/runtime/build.gradle
@@ -47,9 +47,9 @@
 }
 
 dependencies {
-    compile project(":common")
-    compile project(":db")
-    compile project(":db-impl")
+    compile project(":room:common")
+    compile project(":room:db")
+    compile project(":room:db-impl")
     compile "com.android.support:support-core-utils:$support_lib_version"
 
     testCompile "junit:junit:$junit_version"
diff --git a/room/settings.gradle b/room/settings.gradle
index e5957e9..1dc6aae 100644
--- a/room/settings.gradle
+++ b/room/settings.gradle
@@ -1,22 +1,19 @@
-/*
- * 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.
- */
-include 'common'
-include 'runtime'
-include 'compiler'
-include 'db'
-include ':db-impl'
-include ':integration-tests:testapp'
+// if you modify this file, you should modify ../app-toolkit/settings.gradle as well.
 
+include ':room:common'
+project(':room:common').projectDir = new File("common")
+
+include ':room:runtime'
+project(':room:runtime').projectDir = new File("runtime")
+
+include ':room:compiler'
+project(':room:compiler').projectDir = new File("compiler")
+
+include ':room:db'
+project(':room:db').projectDir = new File("db")
+
+include ":room:db-impl"
+project(':room:db-impl').projectDir = new File("db-impl")
+
+include ':room:integration-tests:testapp'
+project(':room:integration-tests:testapp').projectDir = new File("integration-tests/testapp")