Merge "Fix up javadoc." into mnc-dev
diff --git a/baseLibrary/build.gradle b/baseLibrary/build.gradle
index fd8ccd1..241e4a8 100644
--- a/baseLibrary/build.gradle
+++ b/baseLibrary/build.gradle
@@ -20,17 +20,6 @@
sourceCompatibility = config.javaTargetCompatibility
targetCompatibility = config.javaSourceCompatibility
-buildscript {
- repositories {
- mavenLocal()
- mavenCentral()
- }
-}
-
-repositories {
- mavenCentral()
-}
-
sourceSets {
main {
java {
@@ -45,7 +34,7 @@
}
dependencies {
- testCompile 'junit:junit:4.11'
+ testCompile 'junit:junit:4.12'
}
def javadocTask = project.tasks.create(name: "javadocBaseLibrary", type: Javadoc) {
diff --git a/build.gradle b/build.gradle
index da2f10e..acf68f4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,29 +1,22 @@
-Properties databindingProperties = new Properties()
-databindingProperties.load(new FileInputStream("${projectDir}/databinding.properties"))
-def repoBase = databindingProperties.mavenRepoAbsolutePath == "." ? projectDir : databindingProperties.mavenRepoAbsolutePath
-databindingProperties.mavenRepoDir = "${repoBase}/${databindingProperties.mavenRepoName}"
-databindingProperties.eapOutDir = "${projectDir}/${databindingProperties.eapOutFolderName}"
-databindingProperties.prebuildFolder = "${projectDir}/${databindingProperties.prebuildFolderName}" +
- "/${databindingProperties.releaseVersion}"
-ext.config = databindingProperties
-
-println "local maven repo is ${ext.config.mavenRepoDir}."
-println "local pre-build folder is ${ext.config.prebuildFolder}."
-
-new File(ext.config.mavenRepoDir).mkdir()
-new File(ext.config.prebuildFolder).mkdir()
-
-subprojects {
- apply plugin: 'maven'
- group = config.group
- version = config.version
- repositories {
- mavenCentral()
- maven {
- url "file://${config.mavenRepoDir}"
+buildscript {
+ ext.rootFolder = project.projectDir
+ apply from: 'propLoader.gradle'
+ ext.addRepos(repositories)
+ if (ext.config.addRemoteRepos) {
+ dependencies {
+ classpath "com.android.databinding:localizemaven:${config.extraPluginsVersion}"
}
}
+}
+subprojects {
+ apply plugin: 'maven'
+ if (config.addRemoteRepos) {
+ apply plugin: 'com.android.databinding.localizemaven'
+ }
+
+ group = config.group
+ version = config.version
uploadArchives {
repositories {
mavenDeployer {
@@ -31,8 +24,20 @@
}
}
}
+ buildscript {
+ addRepos(repositories)
+ dependencies {
+ classpath "com.android.databinding:bintray:${config.extraPluginsVersion}"
+ }
+ }
}
+if (config.addRemoteRepos) {
+ localizeMaven {
+ localRepoDir = file(config.megaRepoDir)
+ otherRepoDirs = config.localRepositories
+ }
+}
task deleteRepo(type: Delete) {
delete "${config.mavenRepoDir}/${config.group.replace('.', '/')}"
@@ -134,4 +139,4 @@
dependsOn copyMavenRepoToEap
dependsOn copySamplesToEap
dependsOn createEapConfigFile
-}
\ No newline at end of file
+}
diff --git a/buildSrc/src/main/groovy/android.databinding/LicenseCollector.groovy b/buildSrc/src/main/groovy/android.databinding/LicenseCollector.groovy
deleted file mode 100644
index ef6321e..0000000
--- a/buildSrc/src/main/groovy/android.databinding/LicenseCollector.groovy
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-package android.databinding
-import org.apache.commons.io.IOUtils
-import java.util.jar.JarFile
-import org.gradle.api.artifacts.ResolvedArtifact
-
-class LicenseCollector {
- List<ResolvedArtifact> artifacts = new ArrayList();
- def knownLicenses = [
- [
- libraries : ["kotlin-stdlib", "kotlin-runtime"],
- licenses : ["https://raw.githubusercontent.com/JetBrains/kotlin/master/license/LICENSE.txt",
- "http://www.apache.org/licenses/LICENSE-2.0.txt"],
- notices : ["https://raw.githubusercontent.com/JetBrains/kotlin/master/license/NOTICE.txt"]
- ],
- [
- libraries : ["antlr4", "antlr4-runtime", "antlr-runtime", "antlr4-annotations"],
- licenses : ["https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt"]
- ],
- [
- libraries : ["java.g4"],
- licenses : ["https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt"]
- ],
- [
- libraries : ["ST4"],
- licenses : ["https://raw.githubusercontent.com/antlr/stringtemplate4/master/LICENSE.txt"]
- ],
- [
- libraries : ["org.abego.treelayout.core"],
- licenses: ["http://treelayout.googlecode.com/files/LICENSE.TXT"]
- ],
- [
- libraries : ["junit"],
- licenses : ["https://raw.githubusercontent.com/junit-team/junit/master/LICENSE-junit.txt"],
- notices: ["https://raw.githubusercontent.com/junit-team/junit/master/NOTICE.txt"]
- ],
- [
- libraries : ["commons-lang3", "commons-io", "commons-codec"],
- licenses : ["http://svn.apache.org/viewvc/commons/proper/lang/trunk/LICENSE.txt?revision=560660&view=co"],
- notices : ["http://svn.apache.org/viewvc/commons/proper/lang/trunk/NOTICE.txt?view=co"]
- ],
- [
- libraries : ["guava"],
- licenses : ["http://www.apache.org/licenses/LICENSE-2.0.txt"]
- ],
- [
- libraries : ["hamcrest-core"],
- licenses : ["https://raw.githubusercontent.com/hamcrest/JavaHamcrest/master/LICENSE.txt"]
- ]
- ]
-
- Set<String> licenseLookup = new HashSet();
-
- LicenseCollector() {
- knownLicenses.each {
- licenseLookup.addAll(it.libraries)
- }
- }
-
- def skipLicenses = ['baseLibrary', 'grammarBuilder', 'xmlGrammar', 'compiler']
- public void add(ResolvedArtifact artifact) {
- artifacts.add(artifact)
- }
-
- public String buildNotice() {
- artifacts.each { artifact ->
- if (!skipLicenses.contains(artifact.getName())) {
- if (!licenseLookup.contains(artifact.getName())) {
- throw new RuntimeException("Cannot find license for ${artifact.getName()} in ${artifact.getFile()}")
- }
- }
- }
-
- // now build the output
- StringBuilder notice = new StringBuilder();
- notice.append("List of 3rd party licenses:")
- knownLicenses.each {
- notice.append("\n-----------------------------------------------------------------------------")
- it.libraries.each {
- notice.append("\n* $it")
- }
- notice.append("\n")
- if (it.notices != null) {
- it.notices.each {
- notice.append("\n ****** NOTICE:\n${new URL(it).getText()}")
- }
- }
- it.licenses.each {
- notice.append("\n ****** LICENSE:\n${new URL(it).getText()}")
- }
- notice.append("\n\n\n")
- }
- return notice.toString()
- }
-}
\ No newline at end of file
diff --git a/compilationTests/build.gradle b/compilationTests/build.gradle
index e8b56dd..743050c 100644
--- a/compilationTests/build.gradle
+++ b/compilationTests/build.gradle
@@ -3,12 +3,8 @@
sourceCompatibility = 1.7
version = '1.0'
-repositories {
- mavenCentral()
-}
-
dependencies {
- testCompile group: 'junit', name: 'junit', version: '4.11'
+ testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'org.apache.commons:commons-lang3:3.3.2'
testCompile 'commons-io:commons-io:2.4'
testCompile 'commons-codec:commons-codec:1.10'
diff --git a/compilationTests/src/test/java/android/databinding/compilationTest/BaseCompilationTest.java b/compilationTests/src/test/java/android/databinding/compilationTest/BaseCompilationTest.java
index c9cf2a0..814f4aa 100644
--- a/compilationTests/src/test/java/android/databinding/compilationTest/BaseCompilationTest.java
+++ b/compilationTests/src/test/java/android/databinding/compilationTest/BaseCompilationTest.java
@@ -216,6 +216,7 @@
if (localProperties.exists()) {
FileUtils.copyFile(localProperties, new File(testFolder, "local.properties"));
}
+ FileUtils.copyFile(new File("../propLoader.gradle"), new File(testFolder, "propLoaderClone.gradle"));
FileUtils.copyFile(new File("../gradlew"), new File(testFolder, "gradlew"));
FileUtils.copyDirectory(new File("../gradle"), new File(testFolder, "gradle"));
}
diff --git a/compilationTests/src/test/java/android/databinding/compilationTest/CompilationResult.java b/compilationTests/src/test/java/android/databinding/compilationTest/CompilationResult.java
index f50755b..f6d1f5e 100644
--- a/compilationTests/src/test/java/android/databinding/compilationTest/CompilationResult.java
+++ b/compilationTests/src/test/java/android/databinding/compilationTest/CompilationResult.java
@@ -47,7 +47,7 @@
if (errors.isEmpty()) {
return null;
}
- assertEquals(1, errors.size());
+ assertEquals(error, 1, errors.size());
return errors.get(0);
}
diff --git a/compilationTests/src/test/java/android/databinding/compilationTest/SimpleCompilationTest.java b/compilationTests/src/test/java/android/databinding/compilationTest/SimpleCompilationTest.java
index e627c99..43efbb8 100644
--- a/compilationTests/src/test/java/android/databinding/compilationTest/SimpleCompilationTest.java
+++ b/compilationTests/src/test/java/android/databinding/compilationTest/SimpleCompilationTest.java
@@ -52,7 +52,7 @@
public void testEmptyCompilation() throws IOException, URISyntaxException, InterruptedException {
prepareProject();
CompilationResult result = runGradle("assembleDebug");
- assertEquals(0, result.resultCode);
+ assertEquals(result.error, 0, result.resultCode);
assertTrue("there should not be any errors " + result.error, StringUtils.isEmpty(result.error));
assertTrue("Test sanity, should compile fine",
result.resultContainsText("BUILD SUCCESSFUL"));
@@ -94,9 +94,9 @@
copyResourceTo("/layout/invalid_setter_binding.xml",
"/app/src/main/res/layout/invalid_setter.xml");
CompilationResult result = runGradle("assembleDebug");
- assertNotEquals(0, result.resultCode);
+ assertNotEquals(result.output, 0, result.resultCode);
List<ScopedException> bindingExceptions = result.getBindingExceptions();
- assertEquals(2, bindingExceptions.size());
+ assertEquals(result.error, 2, bindingExceptions.size());
File broken = new File(testFolder, "/app/src/main/res/layout/broken.xml");
File invalidSetter = new File(testFolder, "/app/src/main/res/layout/invalid_setter.xml");
for (ScopedException exception : bindingExceptions) {
diff --git a/compilationTests/src/test/resources/project_build.gradle b/compilationTests/src/test/resources/project_build.gradle
index b859755..fcf1b75 100644
--- a/compilationTests/src/test/resources/project_build.gradle
+++ b/compilationTests/src/test/resources/project_build.gradle
@@ -1,24 +1,18 @@
buildscript {
- def Properties dataBindingProperties = new Properties()
- dataBindingProperties.load(new FileInputStream("${projectDir}/../../../databinding.properties"))
- dataBindingProperties.mavenRepoDir = "${projectDir}/../../../${dataBindingProperties.mavenRepoName}"
- ext.config = dataBindingProperties
- println "loaded config"
-
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
+ ext.rootFolder = new File(project.projectDir, "../../..")
+ apply from: "${project.projectDir}/propLoaderClone.gradle"
+ ext.addRepos(repositories)
dependencies {
- classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
classpath "com.android.databinding:dataBinder:${config.version}"
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
}
}
+subprojects {
+ apply plugin: 'maven'
+ group = config.group
+ version = config.version
+}
+
allprojects {
repositories {
jcenter()
diff --git a/compiler/build.gradle b/compiler/build.gradle
index a395e5e..711bb39 100644
--- a/compiler/build.gradle
+++ b/compiler/build.gradle
@@ -13,21 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import android.databinding.LicenseCollector
apply plugin: 'java'
apply plugin: "kotlin"
+apply plugin: 'com.android.databinding.bintray'
sourceCompatibility = config.javaTargetCompatibility
targetCompatibility = config.javaSourceCompatibility
buildscript {
- repositories {
- mavenCentral()
- }
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${config.kotlinVersion}"
- classpath 'org.apache.commons:commons-io:1.3.2'
+ classpath 'commons-io:commons-io:2.4'
}
}
@@ -69,15 +66,7 @@
task fatJar(type: Jar) {
baseName = project.name + '-all'
doFirst {
- def LicenseCollector allLicenses = new LicenseCollector();
- configurations.compile.getResolvedConfiguration().getResolvedArtifacts().each {
- allLicenses.add(it)
- }
- def notice = allLicenses.buildNotice()
- def noticeFile = new File(project.buildDir,'NOTICE.txt')
- noticeFile.delete()
- println ("writing notice file to: ${noticeFile.getAbsolutePath()}")
- noticeFile << notice
+ tasks.findByName("buildLicenseNoticeFor${project.name.capitalize()}").execute()
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from new File(project.buildDir,'NOTICE.txt')
diff --git a/compiler/src/main/java/android/databinding/annotationprocessor/ProcessExpressions.java b/compiler/src/main/java/android/databinding/annotationprocessor/ProcessExpressions.java
index 61e6365..ab2b8bf 100644
--- a/compiler/src/main/java/android/databinding/annotationprocessor/ProcessExpressions.java
+++ b/compiler/src/main/java/android/databinding/annotationprocessor/ProcessExpressions.java
@@ -120,9 +120,9 @@
final int minSdk, String exportClassNamesTo)
throws JAXBException {
final CompilerChef compilerChef = CompilerChef.createChef(resourceBundle, getWriter());
+ compilerChef.sealModels();
+ compilerChef.writeComponent();
if (compilerChef.hasAnythingToGenerate()) {
- compilerChef.sealModels();
- compilerChef.writeComponent();
compilerChef.writeViewBinderInterfaces(forLibraryModule);
if (!forLibraryModule) {
compilerChef.writeViewBinders(minSdk);
diff --git a/compilerCommon/build.gradle b/compilerCommon/build.gradle
index bc59c72..61477da 100644
--- a/compilerCommon/build.gradle
+++ b/compilerCommon/build.gradle
@@ -15,13 +15,10 @@
*/
apply plugin: 'java'
-
+apply plugin: 'com.android.databinding.bintray'
sourceCompatibility = config.javaTargetCompatibility
targetCompatibility = config.javaSourceCompatibility
-repositories {
- mavenCentral()
-}
sourceSets {
main {
@@ -40,7 +37,7 @@
}
dependencies {
- testCompile group: 'junit', name: 'junit', version: '4.11'
+ testCompile group: 'junit', name: 'junit', version: '4.12'
compile project(':baseLibrary')
compile 'org.apache.commons:commons-lang3:3.3.2'
compile 'com.tunnelvisionlabs:antlr4:4.5'
diff --git a/compilerCommon/src/main/java/android/databinding/tool/processing/Scope.java b/compilerCommon/src/main/java/android/databinding/tool/processing/Scope.java
index 35668cd..c723c80 100644
--- a/compilerCommon/src/main/java/android/databinding/tool/processing/Scope.java
+++ b/compilerCommon/src/main/java/android/databinding/tool/processing/Scope.java
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
/**
@@ -97,8 +98,13 @@
return;
}
StringBuilder sb = new StringBuilder();
+ HashSet<String> messages = new HashSet<String>();
for (ScopedException ex : sDeferredExceptions) {
- sb.append(ex.getMessage()).append("\n");
+ final String message = ex.getMessage();
+ if (!messages.contains(message)) {
+ sb.append(message).append("\n");
+ messages.add(message);
+ }
}
throw new RuntimeException("Found data binding errors.\n" + sb.toString());
}
diff --git a/databinding.properties b/databinding.properties
index 2fc8988..0036719 100644
--- a/databinding.properties
+++ b/databinding.properties
@@ -1,7 +1,7 @@
# global settings for projects
-kotlinVersion = 0.12.412
-version = 1.0-rc1-SNAPSHOT
-releaseVersion = 1.0-rc1-SNAPSHOT
+kotlinVersion = 0.12.613
+version = 1.0-rc2-SNAPSHOT
+releaseVersion = 1.0-rc2-SNAPSHOT
androidPluginVersion = 1.2.3
javaTargetCompatibility = 1.7
javaSourceCompatibility = 1.7
@@ -18,4 +18,7 @@
# e.g. If the maven repo folder is at /Volumes/ssd/src/maven-repo
# mavenRepoAbsolutePath is /Volumes/ssd/src and mavenRepoName is maven-repo
mavenRepoAbsolutePath=.
-mavenRepoName=maven-repo
\ No newline at end of file
+mavenRepoName=maven-repo
+extraPluginsRepoName=plugins-repo
+extraPluginsVersion=1.0
+
diff --git a/developmentPlugins/bintrayPlugin/build.gradle b/developmentPlugins/bintrayPlugin/build.gradle
new file mode 100644
index 0000000..364a5bb
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/build.gradle
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2015 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: 'groovy'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile gradleApi()
+ testCompile group: 'junit', name: 'junit', version: '4.12'
+}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ pom.artifactId = 'bintray'
+ repository(url: "file://${config.extraPluginsRepoDir}")
+ }
+ }
+}
\ No newline at end of file
diff --git a/developmentPlugins/bintrayPlugin/gradle/wrapper/gradle-wrapper.jar b/developmentPlugins/bintrayPlugin/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..0087cd3
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/developmentPlugins/bintrayPlugin/gradle/wrapper/gradle-wrapper.properties b/developmentPlugins/bintrayPlugin/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..72508b4
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jul 10 10:59:20 PDT 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
diff --git a/developmentPlugins/bintrayPlugin/gradlew b/developmentPlugins/bintrayPlugin/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/gradlew
@@ -0,0 +1,164 @@
+#!/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
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# 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\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+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"`
+
+ # 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/developmentPlugins/bintrayPlugin/gradlew.bat b/developmentPlugins/bintrayPlugin/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/gradlew.bat
@@ -0,0 +1,90 @@
+@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/developmentPlugins/bintrayPlugin/src/main/groovy/android/databinding/BintrayPlugin.groovy b/developmentPlugins/bintrayPlugin/src/main/groovy/android/databinding/BintrayPlugin.groovy
new file mode 100644
index 0000000..fe9d1b1
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/src/main/groovy/android/databinding/BintrayPlugin.groovy
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+package android.databinding
+
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
+import org.gradle.api.tasks.Upload
+
+class BintrayPlugin implements Plugin<Project> {
+ public static final USER_PROP = "bintrayUser"
+ public static final API_KEY_PROP = "bintrayApiKey"
+ public static final DEFAULT_TASK_NAME = "uploadToBintray"
+
+ @Override
+ void apply(Project target) {
+ def taskName = DEFAULT_TASK_NAME
+ String user = target.getProperties().get(USER_PROP)
+ String apiKey = target.getProperties().get(API_KEY_PROP)
+ def uploadArchivesTask = target.tasks.findByName("uploadArchives")
+ if (uploadArchivesTask == null) {
+ throw new RuntimeException("Cannot find uploadArchives task in $target")
+ }
+ Upload uploadTask = uploadArchivesTask
+ def bintrayTask = target.tasks.create(taskName, UploadToBintrayTask, {
+ it.dependsOn uploadTask
+ it.apiKey = apiKey
+ it.username = user
+ })
+ target.afterEvaluate({
+ def mavenDeployerRepo = uploadTask.repositories.findByName("mavenDeployer")
+ if (mavenDeployerRepo == null) {
+ throw new RuntimeException("Cannot find maven deployer repository")
+ }
+ DefaultGroovyMavenDeployer mavenDeployer = mavenDeployerRepo
+ mavenDeployer.pom.whenConfigured({
+ bintrayTask.configureFrom(mavenDeployer)
+ })
+ })
+
+
+ }
+}
diff --git a/developmentPlugins/bintrayPlugin/src/main/groovy/android/databinding/UploadToBintrayTask.groovy b/developmentPlugins/bintrayPlugin/src/main/groovy/android/databinding/UploadToBintrayTask.groovy
new file mode 100644
index 0000000..06d419c
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/src/main/groovy/android/databinding/UploadToBintrayTask.groovy
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package android.databinding;
+
+import org.gradle.api.DefaultTask
+import org.gradle.api.artifacts.maven.MavenPom
+import org.gradle.api.file.FileCollection
+import org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
+import org.gradle.api.tasks.Input;
+import org.gradle.api.tasks.TaskAction;
+import groovy.json.JsonSlurper;
+
+public class UploadToBintrayTask extends DefaultTask {
+ static final String API_URL = "https://api.bintray.com";
+ static final String PACKAGE_HEADER = "X-Bintray-Package"
+ static final String VERSION_HEADER = "X-Bintray-Version"
+ static final String PUBLISH_HEADER = "X-Bintray-Publish"
+ static final String OVERRIDE_HEADER = "X-Bintray-Override"
+ static final String EXPLODE_HEADER = "X-Bintray-Explode"
+ static final String CONTENT_PREFIX = "content/android/android-tools"
+ String username;
+ String apiKey;
+ String pkg;
+ String version;
+ FileCollection localFiles;
+ String mavenRepoAbsPath;
+ String targetPath;
+ public void configureFrom(DefaultGroovyMavenDeployer deployer) {
+ String repoUrl = deployer.repository.url
+ if (repoUrl == null) {
+ throw new RuntimeException("Cannot find repo url for $deployer")
+ }
+
+ def pom = deployer.pom
+ pkg = pom.groupId + "." + pom.artifactId
+ version = pom.version
+ mavenRepoAbsPath = repoUrl
+ targetPath = "${pkg.replaceAll("\\.", "/")}/${version}"
+ localFiles = project.fileTree(mavenRepoAbsPath + "/" + targetPath)
+ }
+ @TaskAction
+ public void upload() {
+ if (username == null || apiKey == null) {
+ throw new IllegalArgumentException("You should pass your bintray user and " +
+ "api key as params e.g. ./gradlew ${BintrayPlugin.DEFAULT_TASK_NAME}" +
+ " -P${BintrayPlugin.USER_PROP}=<my username>" +
+ " -P${BintrayPlugin.API_KEY_PROP}=<my api key>")
+ }
+ println(log())
+ for (File localFile : localFiles) {
+ def p = ['curl', '-u', "$username:$apiKey", "-H",
+ "$PACKAGE_HEADER: $pkg", "-H", "$VERSION_HEADER: $version",
+ "-X", "PUT", "-F", "file=@${localFile.getAbsolutePath()}",
+ "$API_URL/$CONTENT_PREFIX/$targetPath/${localFile.name}"]
+ println("executing $p")
+ def execute = p.execute()
+ execute.waitFor()
+ if (execute.exitValue() != 0) {
+ throw new RuntimeException("failed to upload artifact. error: ${execute.err.text}")
+ }
+ def responseText = execute.text
+ def json = new JsonSlurper().parseText(responseText)
+ if (json.getAt("message") != "success") {
+ throw new RuntimeException("Cannot upload artifact. Error response: " +
+ "${json.getAt("message")}")
+ }
+ println("uploaded $localFile")
+ }
+ }
+
+ public String log() {
+ return "UploadToBintrayTask{" +
+ "username='" + username + '\'' +
+ ", apiKey='" + apiKey + '\'' +
+ ", pkg='" + pkg + '\'' +
+ ", version='" + version + '\'' +
+ ", localFile=" + localFiles +
+ ", mavenRepo=" + mavenRepoAbsPath +
+ '}';
+ }
+}
diff --git a/developmentPlugins/bintrayPlugin/src/main/resources/META-INF/gradle-plugins/com.android.databinding.bintray.properties b/developmentPlugins/bintrayPlugin/src/main/resources/META-INF/gradle-plugins/com.android.databinding.bintray.properties
new file mode 100644
index 0000000..3cf2d8c
--- /dev/null
+++ b/developmentPlugins/bintrayPlugin/src/main/resources/META-INF/gradle-plugins/com.android.databinding.bintray.properties
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 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.
+#
+
+implementation-class=android.databinding.BintrayPlugin
\ No newline at end of file
diff --git a/developmentPlugins/build.gradle b/developmentPlugins/build.gradle
new file mode 100644
index 0000000..a99d215
--- /dev/null
+++ b/developmentPlugins/build.gradle
@@ -0,0 +1,14 @@
+ext.rootFolder = "${project.projectDir}/.."
+apply from: '../propLoader.gradle'
+subprojects {
+ apply plugin: 'maven'
+ group = config.group
+ version = config.extraPluginsVersion
+ uploadArchives {
+ repositories {
+ mavenDeployer {
+ repository(url: "file://${config.extraPluginsRepoDir}")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/developmentPlugins/gradle/wrapper/gradle-wrapper.jar b/developmentPlugins/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..0087cd3
--- /dev/null
+++ b/developmentPlugins/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/developmentPlugins/gradle/wrapper/gradle-wrapper.properties b/developmentPlugins/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..c2fda82
--- /dev/null
+++ b/developmentPlugins/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jul 10 16:16:18 PDT 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
diff --git a/developmentPlugins/gradlew b/developmentPlugins/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/developmentPlugins/gradlew
@@ -0,0 +1,164 @@
+#!/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
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# 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\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+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"`
+
+ # 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/developmentPlugins/gradlew.bat b/developmentPlugins/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/developmentPlugins/gradlew.bat
@@ -0,0 +1,90 @@
+@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/developmentPlugins/localizeMavenPlugin/build.gradle b/developmentPlugins/localizeMavenPlugin/build.gradle
new file mode 100644
index 0000000..02d9b16
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/build.gradle
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2015 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: 'groovy'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile gradleApi()
+ compile localGroovy()
+ compile 'commons-io:commons-io:2.4'
+ compile 'org.apache.maven:maven-aether-provider:3.3.3'
+ compile 'org.eclipse.aether:aether-transport-http:1.0.2.v20150114'
+ compile 'org.eclipse.aether:aether:1.0.2.v20150114'
+ compile 'org.eclipse.aether:aether-connector-basic:1.0.2.v20150114'
+ compile 'org.eclipse.aether:aether-transport-file:1.0.2.v20150114'
+
+}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ pom.artifactId = 'localizemaven'
+ repository(url: "file://${config.extraPluginsRepoDir}")
+ }
+ }
+}
\ No newline at end of file
diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy
new file mode 100644
index 0000000..cf3ef59
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+package android.databinding
+
+import org.gradle.api.DefaultTask;
+import org.gradle.api.artifacts.ResolvedArtifact
+import org.gradle.api.tasks.TaskAction;
+
+class ExportLicensesTask extends DefaultTask {
+ List<ResolvedArtifact> artifacts = new ArrayList();
+
+ static def knownLicenses = [
+ [
+ libraries: ["kotlin-stdlib", "kotlin-runtime", "kotlin-annotation-processing", "kotlin-gradle-plugin", "kotlin-gradle-plugin-api"],
+ licenses : ["https://raw.githubusercontent.com/JetBrains/kotlin/master/license/LICENSE.txt",
+ "http://www.apache.org/licenses/LICENSE-2.0.txt"],
+ notices : ["https://raw.githubusercontent.com/JetBrains/kotlin/master/license/NOTICE.txt"]
+ ],
+ [
+ libraries: ["antlr4", "antlr4-runtime", "antlr-runtime", "antlr4-annotations"],
+ licenses : ["https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt"]
+ ],
+ [
+ libraries: ["antlr"],
+ licenses: ["http://www.antlr3.org/license.html", "http://www.antlr2.org/license.html"]
+ ],
+ [
+ libraries: ["java.g4"],
+ licenses : ["https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt"]
+ ],
+ [
+ libraries: ["ST4", "stringtemplate"],
+ licenses : ["https://raw.githubusercontent.com/antlr/stringtemplate4/master/LICENSE.txt"]
+ ],
+ [
+ libraries: ["org.abego.treelayout.core"],
+ licenses : ["http://treelayout.googlecode.com/files/LICENSE.TXT"]
+ ],
+ [
+ libraries: ["junit"],
+ licenses : ["https://raw.githubusercontent.com/junit-team/junit/master/LICENSE-junit.txt"],
+ notices : ["https://raw.githubusercontent.com/junit-team/junit/master/NOTICE.txt"]
+ ],
+ [
+ libraries: ["commons-io"],
+ licenses : ["http://svn.apache.org/viewvc/commons/proper/io/trunk/LICENSE.txt?view=co"],
+ notices : ["http://svn.apache.org/viewvc/commons/proper/io/trunk/NOTICE.txt?view=co"]
+ ],
+ [
+ libraries: ["commons-codec"],
+ licenses: ["http://svn.apache.org/viewvc/commons/proper/codec/trunk/LICENSE.txt?view=co"],
+ notices: ["http://svn.apache.org/viewvc/commons/proper/codec/trunk/NOTICE.txt?view=co"]
+ ],
+ [
+ libraries: ["commons-lang3"],
+ licenses : ["https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=blob_plain;f=LICENSE.txt;hb=refs/heads/master"],
+ notices : ["https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=blob_plain;f=NOTICE.txt;hb=refs/heads/master"]
+ ],
+ [
+ libraries: ["guava"],
+ licenses : ["http://www.apache.org/licenses/LICENSE-2.0.txt"]
+ ],
+ [
+ libraries: ["hamcrest-core"],
+ licenses : ["https://raw.githubusercontent.com/hamcrest/JavaHamcrest/master/LICENSE.txt"]
+ ],
+ [
+ libraries: ["avalon-framework"],
+ licenses : ["http://archive.apache.org/dist/avalon/LICENSE.txt"]
+ ],
+ [
+ libraries: ["log4j"],
+ licenses: ["https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob_plain;f=LICENSE.txt;hb=HEAD"],
+ notices: ["https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob_plain;f=NOTICE.txt;hb=HEAD"]
+ ],
+ [
+ libraries: ["ant", "ant-launcher"],
+ licenses: ["http://www.apache.org/licenses/LICENSE-2.0.html"]
+ ],
+ [
+ libraries: ["xz"],
+ licenses: ["http://git.tukaani.org/?p=xz-java.git;a=blob_plain;f=COPYING;hb=HEAD"]
+ ],
+ [
+ libraries: ["logkit"],
+ licenses: ["unknown. see: http://commons.apache.org/proper/commons-logging/dependencies.html"]
+ ]
+
+ ]
+
+ Map<String, Object> usedLicenses = new HashMap<>();
+ static Map<String, Object> licenseLookup = new HashMap<>();
+ static {
+ knownLicenses.each {license ->
+ license.libraries.each {
+ licenseLookup.put(it, license)
+ }
+ }
+ }
+
+ ExportLicensesTask() {
+ }
+
+ public void add(ResolvedArtifact artifact) {
+ artifacts.add(artifact)
+ println("adding artifact $artifact")
+ }
+
+ @TaskAction
+ public void exportNotice() {
+ project.configurations.compile.getResolvedConfiguration().getResolvedArtifacts().each {
+ add(it)
+ }
+ resolveLicenses()
+ def notice = buildNotice(usedLicenses)
+ def noticeFile = new File(project.buildDir,'NOTICE.txt')
+ noticeFile.delete()
+ println ("writing notice file to: ${noticeFile.getAbsolutePath()}")
+ noticeFile << notice
+ }
+
+ public void resolveLicenses() {
+ artifacts.each { artifact ->
+ if (!shouldSkip(artifact)) {
+ def license = licenseLookup.get(artifact.name)
+ if (license == null) {
+ throw new RuntimeException("Cannot find license for ${artifact.getModuleVersion().id} in ${artifact.getFile()}")
+ }
+ usedLicenses.put(artifact, license)
+ }
+ }
+ }
+
+ public static Object findLicenseFor(String artifactId) {
+ return licenseLookup.get(artifactId)
+ }
+
+ public static String urlToText(String url) {
+ //return new URL(url).getText()
+ return url
+ }
+
+ public boolean shouldSkip(ResolvedArtifact artifact) {
+ return artifact.getModuleVersion().id.group.startsWith("com.android");
+ }
+
+ public static String buildNotice(Map<String, Object> licenses) {
+ // now build the output
+ StringBuilder notice = new StringBuilder();
+ notice.append("List of 3rd party licenses:")
+ licenses.each {
+ notice.append("\n-----------------------------------------------------------------------------")
+ notice.append("\n* ${it.key}")
+ notice.append("\n")
+ def license = it.value
+ if (license.notices != null) {
+ license.notices.each {
+ notice.append("\n ****** NOTICE:\n${urlToText(it)}")
+ }
+ }
+ license.licenses.each {
+ notice.append("\n ****** LICENSE:\n${urlToText(it)}")
+ }
+ notice.append("\n\n\n")
+ }
+ return notice.toString()
+ }
+}
\ No newline at end of file
diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy
new file mode 100644
index 0000000..a9e8d05
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package android.databinding
+
+import groovy.io.FileType
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils
+import org.eclipse.aether.DefaultRepositorySystemSession
+import org.eclipse.aether.RepositorySystem
+import org.eclipse.aether.RepositorySystemSession
+import org.eclipse.aether.artifact.Artifact
+import org.eclipse.aether.artifact.DefaultArtifact
+import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory
+import org.eclipse.aether.graph.Dependency
+import org.eclipse.aether.impl.DefaultServiceLocator
+import org.eclipse.aether.repository.LocalRepository
+import org.eclipse.aether.repository.RemoteRepository
+import org.eclipse.aether.resolution.ArtifactDescriptorRequest
+import org.eclipse.aether.resolution.ArtifactDescriptorResult
+import org.eclipse.aether.resolution.ArtifactRequest
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory
+import org.eclipse.aether.spi.connector.transport.TransporterFactory
+import org.eclipse.aether.transport.file.FileTransporterFactory
+import org.eclipse.aether.transport.http.HttpTransporterFactory
+import org.gradle.api.DefaultTask
+import org.gradle.api.artifacts.Configuration
+import org.gradle.api.artifacts.ModuleVersionIdentifier
+import org.gradle.api.tasks.TaskAction
+
+class LocalizeDependenciesTask extends DefaultTask {
+
+ private Set<String> ids = new HashSet<>();
+
+ private Set<String> fetchTestDependencies = new HashSet<>();
+
+ List<Artifact> artifactsToResolve = new LinkedList<>();
+
+ Set<String> resolvedArtifacts = new HashSet<>();
+
+ Set<String> failed = new HashSet<>();
+
+ HashMap<String, Object> licenses = new HashMap<>();
+
+ Set<String> missingLicenses = new HashSet<>();
+
+ File localRepoDir;
+
+ @TaskAction
+ doIt() {
+ println(ids)
+ LocalizePluginExtension extension = project.extensions.
+ getByName(MavenDependencyCollectorPlugin.EXTENSION_NAME)
+ if (extension.localRepoDir == null || extension.otherRepoDirs == null) {
+ throw new IllegalArgumentException("you must configure " +
+ "${MavenDependencyCollectorPlugin.EXTENSION_NAME} with localRepoDir and" +
+ " otherRepoDirs")
+ }
+ localRepoDir = extension.localRepoDir
+ downloadAll(extension.localRepoDir, extension.otherRepoDirs)
+
+ if (!missingLicenses.isEmpty()) {
+ throw new RuntimeException("Missing licenses for $missingLicenses")
+ }
+ println("List of new licenses:")
+ println(ExportLicensesTask.buildNotice(licenses))
+ }
+
+ public void add(MavenDependencyCollectorTask task, ModuleVersionIdentifier id, Configuration conf) {
+ def key = toStringIdentifier(id)
+ ids.add(key)
+ println("adding $key in $conf by $task")
+ }
+
+ public static String toStringIdentifier(ModuleVersionIdentifier id) {
+ return id.group + ":" + id.name + ":" + id.version;
+ }
+
+ private static String artifactKey(Artifact artifact) {
+ return artifact.groupId + ":" + artifact.artifactId + ":" + artifact.version;
+ }
+
+ public downloadAll(File localRepoDir, List<String> otherRepoDirs) {
+ println("downloading all dependencies to $localRepoDir")
+ def mavenCentral = new RemoteRepository.Builder("central", "default",
+ "http://central.maven.org/maven2/").build();
+ def system = newRepositorySystem()
+ localRepoDir = localRepoDir.canonicalFile
+ List<File> otherRepos = new ArrayList<>()
+ otherRepoDirs.each {
+ def repo = new File(it).getCanonicalFile()
+ if (repo.exists() && !repo.equals(localRepoDir)) {
+ otherRepos.add(repo)
+ }
+ }
+ def session = newRepositorySystemSession(system, localRepoDir)
+ ids.each {
+ def artifact = new DefaultArtifact(it)
+ artifactsToResolve.add(artifact)
+ }
+
+ while (!artifactsToResolve.isEmpty()) {
+ println("remaining artifacts to resolve ${artifactsToResolve.size()}")
+ Artifact artifact = artifactsToResolve.remove(0)
+ println(" handling artifact ${artifact.getArtifactId()}")
+ if (shouldSkip(artifact, otherRepos)) {
+ println("skipping $artifact")
+ continue
+ }
+ resolveArtifactWithDependencies(system, session, Arrays.asList(mavenCentral), artifact);
+ }
+ }
+
+ public static boolean shouldSkip(Artifact artifact, List<File> otherRepos) {
+ if (artifact.groupId.startsWith('com.android.databinding') ||
+ artifact.groupId.startsWith('com.android.support') ||
+ artifact.groupId.equals("jdk")){
+ return true
+ }
+ String targetPath = artifact.groupId.replaceAll("\\.", "/") + "/" + artifact.artifactId +
+ "/" + artifact.version
+ for (File repo : otherRepos) {
+ File f = new File(repo, targetPath)
+ if (f.exists()) {
+ println("skipping ${artifact} because it exists in $repo")
+ return true
+ }
+ }
+ return false
+ }
+
+ def boolean isInGit(File file) {
+ if (!file.getCanonicalPath().startsWith(localRepoDir.getCanonicalPath())) {
+ println("$file is in another git repo, ignore for license")
+ return false
+ }
+ def gitSt = ["git", "status", "--porcelain", file.getCanonicalPath()].
+ execute([], localRepoDir)
+ gitSt.waitFor()
+ if (gitSt.exitValue() != 0) {
+ throw new RuntimeException("unable to get git status for $file. ${gitSt.err.text}")
+ }
+ return gitSt.text.trim().isEmpty()
+ }
+
+ public void resolveArtifactWithDependencies(RepositorySystem system,
+ RepositorySystemSession session, List<RemoteRepository> remoteRepositories,
+ Artifact artifact) {
+ def key = artifactKey(artifact)
+ if (resolvedArtifacts.contains(key) || failed.contains(key)) {
+ return
+ }
+ resolvedArtifacts.add(key)
+ ArtifactRequest artifactRequest = new ArtifactRequest();
+ artifactRequest.setArtifact(artifact);
+ artifactRequest.setRepositories(remoteRepositories);
+ def resolved;
+ try {
+ resolved = system.resolveArtifact(session, artifactRequest);
+ } catch (Throwable ignored) {
+ println("cannot find $key, skipping")
+ failed.add(key)
+ return
+ }
+ def alreadyInGit = isInGit(resolved.artifact.file)
+ println(" |-> resolved ${resolved.artifact.file}. Already in git? $alreadyInGit")
+
+
+
+ if (!alreadyInGit) {
+ def license = ExportLicensesTask.findLicenseFor(resolved.artifact.artifactId)
+ if (license == null) {
+ missingLicenses.add(artifactKey(artifact))
+ } else {
+ licenses.put(resolved.artifact.artifactId, license)
+ }
+ }
+
+ ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
+ descriptorRequest.setArtifact(artifact);
+ descriptorRequest.setRepositories(remoteRepositories);
+
+ ArtifactDescriptorResult descriptorResult = system.
+ readArtifactDescriptor(session, descriptorRequest);
+ for (Dependency dependency : descriptorResult.getDependencies()) {
+ println("dependency $dependency for $artifact . scope: ${dependency.scope}")
+ if ("provided".equals(dependency.scope)) {
+ println("skipping $dependency because provided")
+ continue
+ }
+ if ("optional".equals(dependency.scope)) {
+ println("skipping $dependency because optional")
+ continue
+ }
+ if ("test".equals(dependency.scope)) {
+ if (fetchTestDependencies.contains(key)) {
+ println("${dependency} is test scope but including because $key is in direct dependencies")
+ } else {
+ println("skipping $dependency because test and not first level dependency")
+ continue
+ }
+ }
+
+
+ def dependencyKey = artifactKey(dependency.artifact)
+ if (resolvedArtifacts.contains(dependencyKey)) {
+ println("skipping $dependency because is already resolved as ${dependencyKey}")
+ continue
+ }
+ println("adding to the list ${dependency.artifact}")
+ artifactsToResolve.add(dependency.artifact)
+ }
+ File unwanted = new File(resolved.artifact.file.getParentFile(), "_remote.repositories")
+ if (unwanted.exists()) {
+ unwanted.delete()
+ }
+ }
+
+ public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system,
+ File localRepoDir) {
+ DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
+ LocalRepository localRepo = new LocalRepository(localRepoDir);
+ session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
+ return session;
+ }
+
+ public static RepositorySystem newRepositorySystem() {
+ DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
+ locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
+ locator.addService(TransporterFactory.class, FileTransporterFactory.class);
+ locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
+
+ return locator.getService(RepositorySystem.class);
+ }
+}
diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizePluginExtension.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizePluginExtension.groovy
new file mode 100644
index 0000000..0104206
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizePluginExtension.groovy
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+package android.databinding
+
+
+class LocalizePluginExtension {
+ def File localRepoDir;
+ def List<String> otherRepoDirs;
+}
diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy
new file mode 100644
index 0000000..c3a318d
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package android.databinding
+
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+
+public class MavenDependencyCollectorPlugin implements Plugin<Project> {
+ private static final String DEFAULT_TASK_NAME = "localizeDependencies"
+ static final String EXTENSION_NAME = "localizeMaven"
+ @Override
+ void apply(Project project) {
+ Project parent = project.parent == null ? project : project.parent;
+ def localizeDependenciesTask = parent.tasks.findByName(DEFAULT_TASK_NAME)
+ if (localizeDependenciesTask == null) {
+ localizeDependenciesTask = parent.tasks.
+ create(DEFAULT_TASK_NAME, LocalizeDependenciesTask)
+ parent.extensions.create(EXTENSION_NAME, LocalizePluginExtension)
+ }
+
+ project.allprojects {
+ afterEvaluate { p ->
+ project.tasks.create("collectDependenciesOf${it.getName().capitalize()}", MavenDependencyCollectorTask, {
+ it.localizeTask = localizeDependenciesTask
+ localizeDependenciesTask.dependsOn it
+ })
+
+ }
+ }
+ project.tasks.create("buildLicenseNotice", ExportLicensesTask) {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorTask.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorTask.groovy
new file mode 100644
index 0000000..4966868
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorTask.groovy
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package android.databinding
+
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils
+import org.eclipse.aether.DefaultRepositorySystemSession
+import org.eclipse.aether.RepositorySystem
+import org.eclipse.aether.RepositorySystemSession
+import org.eclipse.aether.artifact.Artifact
+import org.eclipse.aether.artifact.DefaultArtifact
+import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory
+import org.eclipse.aether.graph.Dependency
+import org.eclipse.aether.impl.DefaultServiceLocator
+import org.eclipse.aether.repository.LocalRepository
+import org.eclipse.aether.repository.RemoteRepository
+import org.eclipse.aether.resolution.ArtifactDescriptorRequest
+import org.eclipse.aether.resolution.ArtifactDescriptorResult
+import org.eclipse.aether.resolution.ArtifactRequest
+import org.eclipse.aether.spi.connector.RepositoryConnectorFactory
+import org.eclipse.aether.spi.connector.transport.TransporterFactory
+import org.eclipse.aether.transport.file.FileTransporterFactory
+import org.eclipse.aether.transport.http.HttpTransporterFactory
+import org.gradle.api.DefaultTask
+import org.gradle.api.Project
+import org.gradle.api.artifacts.Configuration
+import org.gradle.api.artifacts.ModuleVersionIdentifier
+import org.gradle.api.tasks.Input
+import org.gradle.api.tasks.TaskAction
+
+class MavenDependencyCollectorTask extends DefaultTask {
+ @Input
+ LocalizeDependenciesTask localizeTask
+
+ @TaskAction
+ public void doIt() {
+ project.configurations.each { conf ->
+ resolveDirectDependencies(conf)
+ }
+ project.buildscript.configurations.each { conf ->
+ resolveDirectDependencies(conf)
+ }
+ }
+
+ void resolveDirectDependencies(Configuration conf) {
+ conf.getResolvedConfiguration().getResolvedArtifacts().each {
+ localizeTask.add(this, it.getModuleVersion().id, conf)
+ }
+ }
+}
diff --git a/developmentPlugins/localizeMavenPlugin/src/main/resources/META-INF/gradle-plugins/com.android.databinding.localizemaven.properties b/developmentPlugins/localizeMavenPlugin/src/main/resources/META-INF/gradle-plugins/com.android.databinding.localizemaven.properties
new file mode 100644
index 0000000..c738d68
--- /dev/null
+++ b/developmentPlugins/localizeMavenPlugin/src/main/resources/META-INF/gradle-plugins/com.android.databinding.localizemaven.properties
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 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.
+#
+
+implementation-class=android.databinding.MavenDependencyCollectorPlugin
\ No newline at end of file
diff --git a/developmentPlugins/settings.gradle b/developmentPlugins/settings.gradle
new file mode 100644
index 0000000..2788877
--- /dev/null
+++ b/developmentPlugins/settings.gradle
@@ -0,0 +1,2 @@
+include 'bintrayPlugin'
+include 'localizeMavenPlugin'
\ No newline at end of file
diff --git a/extensions/baseAdapters/build.gradle b/extensions/baseAdapters/build.gradle
index 813f599..04390ef 100644
--- a/extensions/baseAdapters/build.gradle
+++ b/extensions/baseAdapters/build.gradle
@@ -71,6 +71,7 @@
jarTask.exclude("android/databinding/layouts/*.*")
jarTask.exclude("$appPkgAsClass/databinding/*")
jarTask.exclude("$appPkgAsClass/BR.*")
+ jarTask.exclude("android/databinding/DataBindingComponent.*")
artifacts.add('jarArchives', jarTask);
def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
diff --git a/extensions/build.gradle b/extensions/build.gradle
index 6b9575d..51aad32 100644
--- a/extensions/build.gradle
+++ b/extensions/build.gradle
@@ -13,24 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
+ext.rootFolder = new File(project.projectDir, "..")
buildscript {
- def Properties dataBindingProperties = new Properties()
- dataBindingProperties.load(new FileInputStream("${projectDir}/../databinding.properties"))
- def repoBase = dataBindingProperties.mavenRepoAbsolutePath == "." ? "${projectDir}/.." : dataBindingProperties.mavenRepoAbsolutePath
- dataBindingProperties.mavenRepoDir = "${repoBase}/${dataBindingProperties.mavenRepoName}"
- dataBindingProperties.prebuildFolder = "${projectDir}/../${dataBindingProperties.prebuildFolderName}" +
- "/${dataBindingProperties.releaseVersion}"
- ext.config = dataBindingProperties
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
+ ext.rootFolder = new File(project.projectDir, "..")
+ apply from: "${project.projectDir}/../propLoader.gradle"
+ ext.addRepos(repositories)
dependencies {
- classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
classpath "com.android.databinding:dataBinder:${config.version}"
}
}
@@ -39,16 +27,8 @@
apply plugin: 'maven'
group = config.group
version = config.version
- repositories {
- mavenCentral()
- maven {
- url config.mavenRepoDir
- }
- }
}
-
-
task preparePrebuilds() {
}
diff --git a/gradlePlugin/build.gradle b/gradlePlugin/build.gradle
index f22985b..203105a 100644
--- a/gradlePlugin/build.gradle
+++ b/gradlePlugin/build.gradle
@@ -15,14 +15,10 @@
*/
apply plugin: 'java'
+apply plugin: 'com.android.databinding.bintray'
sourceCompatibility = config.javaTargetCompatibility
targetCompatibility = config.javaSourceCompatibility
-buildscript {
- repositories {
- mavenCentral()
- }
-}
tasks.create(name : 'copyBuildVersion') << {
def buildVersionFile = new File(sourceSets.main.output.resourcesDir,"data_binding_build_info")
diff --git a/integration-tests/App With Spaces/build.gradle b/integration-tests/App With Spaces/build.gradle
index ddf912c..b13840a 100644
--- a/integration-tests/App With Spaces/build.gradle
+++ b/integration-tests/App With Spaces/build.gradle
@@ -14,31 +14,11 @@
* limitations under the License.
*/
buildscript {
- def Properties dataBindingProperties = new Properties()
- dataBindingProperties.load(new FileInputStream("${projectDir}/../../databinding.properties"))
- dataBindingProperties.mavenRepoDir = "${projectDir}/../../${dataBindingProperties.mavenRepoName}"
- ext.config = dataBindingProperties
- println "loaded config"
-
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
+ ext.rootFolder = new File(project.projectDir, "../..")
+ apply from: "${project.projectDir}/../../propLoader.gradle"
+ ext.addRepos(repositories)
dependencies {
classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
classpath "com.android.databinding:dataBinder:${config.version}"
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
}
}
diff --git a/integration-tests/IndependentLibrary/build.gradle b/integration-tests/IndependentLibrary/build.gradle
index 8c6433d..db36a5b 100644
--- a/integration-tests/IndependentLibrary/build.gradle
+++ b/integration-tests/IndependentLibrary/build.gradle
@@ -14,31 +14,11 @@
*/
buildscript {
- def Properties dataBindingProperties = new Properties()
- dataBindingProperties.load(new FileInputStream("${projectDir}/../../databinding.properties"))
- dataBindingProperties.mavenRepoDir = "${projectDir}/../../${dataBindingProperties.mavenRepoName}"
- ext.config = dataBindingProperties
- println "loaded config"
-
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
+ ext.rootFolder = new File(project.projectDir, "../..")
+ apply from: "${project.projectDir}/../../propLoader.gradle"
+ ext.addRepos(repositories)
dependencies {
classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
classpath "com.android.databinding:dataBinder:${config.version}"
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
}
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
-}
+}
\ No newline at end of file
diff --git a/integration-tests/MultiModuleTestApp/build.gradle b/integration-tests/MultiModuleTestApp/build.gradle
index ddf912c..5e5a3e2 100644
--- a/integration-tests/MultiModuleTestApp/build.gradle
+++ b/integration-tests/MultiModuleTestApp/build.gradle
@@ -14,31 +14,11 @@
* limitations under the License.
*/
buildscript {
- def Properties dataBindingProperties = new Properties()
- dataBindingProperties.load(new FileInputStream("${projectDir}/../../databinding.properties"))
- dataBindingProperties.mavenRepoDir = "${projectDir}/../../${dataBindingProperties.mavenRepoName}"
- ext.config = dataBindingProperties
- println "loaded config"
-
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
+ ext.rootFolder = new File(project.projectDir, "../..")
+ apply from: "${project.projectDir}/../../propLoader.gradle"
+ ext.addRepos(repositories)
dependencies {
classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
classpath "com.android.databinding:dataBinder:${config.version}"
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
}
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
-}
+}
\ No newline at end of file
diff --git a/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/InvalidateAllTest.java b/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/InvalidateAllTest.java
index 7e5ee20..bdf9f0d 100644
--- a/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/InvalidateAllTest.java
+++ b/integration-tests/TestApp/app/src/androidTestApi7/java/android/databinding/testapp/InvalidateAllTest.java
@@ -17,9 +17,11 @@
public void testRefreshViaInvalidateAll() throws InterruptedException {
final Semaphore semaphore = new Semaphore(1);
semaphore.acquire();
+ final NotBindableVo vo = new NotBindableVo("foo");
initBinder(new Runnable() {
@Override
public void run() {
+ mBinder.setVo(vo);
mBinder.addOnRebindCallback(new OnRebindCallback() {
@Override
public void onBound(ViewDataBinding binding) {
@@ -29,8 +31,6 @@
});
}
});
- NotBindableVo vo = new NotBindableVo("foo");
- mBinder.setVo(vo);
assertTrue(semaphore.tryAcquire(2, TimeUnit.SECONDS));
assertEquals("foo", mBinder.textView.getText().toString());
diff --git a/integration-tests/TestApp/build.gradle b/integration-tests/TestApp/build.gradle
index c80adb4..c15f7f5 100644
--- a/integration-tests/TestApp/build.gradle
+++ b/integration-tests/TestApp/build.gradle
@@ -1,29 +1,9 @@
buildscript {
- def Properties dataBindingProperties = new Properties()
- dataBindingProperties.load(new FileInputStream("${projectDir}/../../databinding.properties"))
- dataBindingProperties.mavenRepoDir = "${projectDir}/../../${dataBindingProperties.mavenRepoName}"
- ext.config = dataBindingProperties
- println "loaded config"
-
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
- }
+ ext.rootFolder = new File(project.projectDir, "../..")
+ apply from: "${project.projectDir}/../../propLoader.gradle"
+ ext.addRepos(repositories)
dependencies {
classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
classpath "com.android.databinding:dataBinder:${config.version}"
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url config.mavenRepoDir
- }
}
}
diff --git a/library/build.gradle b/library/build.gradle
index 0d9fd62..937a383 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -17,9 +17,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- repositories {
- jcenter()
- }
dependencies {
classpath "com.android.tools.build:gradle:${config.androidPluginVersion}"
// NOTE: Do not place your application dependencies here; they belong
diff --git a/localize.sh b/localize.sh
new file mode 100755
index 0000000..d861d77
--- /dev/null
+++ b/localize.sh
@@ -0,0 +1,2 @@
+ #!/bin/bash
+./gradlew localizeDependencies -PaddRemoteRepos=true
diff --git a/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar
new file mode 100644
index 0000000..27fa902
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar
Binary files differ
diff --git a/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar.md5 b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar.md5
new file mode 100644
index 0000000..bb1e3c0
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar.md5
@@ -0,0 +1 @@
+21449624c543d72f226683327e46bc52
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar.sha1 b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar.sha1
new file mode 100644
index 0000000..1fb2594
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.jar.sha1
@@ -0,0 +1 @@
+4b9a0762ff3a255e5a57386c54a8379133d45998
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom
new file mode 100644
index 0000000..7b2ffc5
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.android.databinding</groupId>
+ <artifactId>bintray</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom.md5 b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom.md5
new file mode 100644
index 0000000..06b668b
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom.md5
@@ -0,0 +1 @@
+3dc6ce6e2b0f405e0e005bfd61824683
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom.sha1 b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom.sha1
new file mode 100644
index 0000000..c071f7c
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/1.0/bintray-1.0.pom.sha1
@@ -0,0 +1 @@
+05fa26e81f15809f9e231099f05fc62d0c4a536b
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/bintray/maven-metadata.xml b/plugins-repo/com/android/databinding/bintray/maven-metadata.xml
new file mode 100644
index 0000000..1615227
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/maven-metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>com.android.databinding</groupId>
+ <artifactId>bintray</artifactId>
+ <version>1.0</version>
+ <versioning>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20150714230002</lastUpdated>
+ </versioning>
+</metadata>
diff --git a/plugins-repo/com/android/databinding/bintray/maven-metadata.xml.md5 b/plugins-repo/com/android/databinding/bintray/maven-metadata.xml.md5
new file mode 100644
index 0000000..91cb33f
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/maven-metadata.xml.md5
@@ -0,0 +1 @@
+c68b6bdd46b2c465501abedb72b62b15
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/bintray/maven-metadata.xml.sha1 b/plugins-repo/com/android/databinding/bintray/maven-metadata.xml.sha1
new file mode 100644
index 0000000..8281a74
--- /dev/null
+++ b/plugins-repo/com/android/databinding/bintray/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+243c68cc8984455847e8765e14e34fa355378405
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar
new file mode 100644
index 0000000..d8d10fc
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar
Binary files differ
diff --git a/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar.md5 b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar.md5
new file mode 100644
index 0000000..d82ebb7
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar.md5
@@ -0,0 +1 @@
+6b918ba89221ac740a32a1fdbf2076f7
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar.sha1 b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar.sha1
new file mode 100644
index 0000000..c285e77
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.jar.sha1
@@ -0,0 +1 @@
+cac4bbf3c633037d17d1d9543071d5c13135bd67
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom
new file mode 100644
index 0000000..e9cc223
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.android.databinding</groupId>
+ <artifactId>localizemaven</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-connector-basic</artifactId>
+ <version>1.0.2.v20150114</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-transport-http</artifactId>
+ <version>1.0.2.v20150114</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-transport-file</artifactId>
+ <version>1.0.2.v20150114</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-aether-provider</artifactId>
+ <version>3.3.3</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether</artifactId>
+ <version>1.0.2.v20150114</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom.md5 b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom.md5
new file mode 100644
index 0000000..21c3a27
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom.md5
@@ -0,0 +1 @@
+f7cd22c6b15280987bb23c4871f32d31
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom.sha1 b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom.sha1
new file mode 100644
index 0000000..f0713d2
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/1.0/localizemaven-1.0.pom.sha1
@@ -0,0 +1 @@
+2bae0e1507a55b8d3ad7f484c56a25896b490cc0
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml b/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml
new file mode 100644
index 0000000..42bba55
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>com.android.databinding</groupId>
+ <artifactId>localizemaven</artifactId>
+ <version>1.0</version>
+ <versioning>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20150714230005</lastUpdated>
+ </versioning>
+</metadata>
diff --git a/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml.md5 b/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml.md5
new file mode 100644
index 0000000..19bed64
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml.md5
@@ -0,0 +1 @@
+ef58d2c1f235e51db31d0efaf6736192
\ No newline at end of file
diff --git a/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml.sha1 b/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml.sha1
new file mode 100644
index 0000000..e946b8a
--- /dev/null
+++ b/plugins-repo/com/android/databinding/localizemaven/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+070f503e0456b0092c916ff84e23b272ca266a97
\ No newline at end of file
diff --git a/propLoader.gradle b/propLoader.gradle
new file mode 100644
index 0000000..f8730ae
--- /dev/null
+++ b/propLoader.gradle
@@ -0,0 +1,71 @@
+/**
+ * Helper build script that reads data binding variables and sets up the projects.
+ */
+def root = ext.rootFolder
+Properties databindingProperties = new Properties()
+databindingProperties.load(new FileInputStream("${root}/databinding.properties"))
+def repoBase = databindingProperties.mavenRepoAbsolutePath == "." ? root : databindingProperties.mavenRepoAbsolutePath
+databindingProperties.mavenRepoDir = "${repoBase}/${databindingProperties.mavenRepoName}"
+databindingProperties.extraPluginsRepoDir = "${root}/${databindingProperties.extraPluginsRepoName}"
+
+databindingProperties.eapOutDir = "${root}/${databindingProperties.eapOutFolderName}"
+databindingProperties.prebuildFolder = "${root}/${databindingProperties.prebuildFolderName}" +
+ "/${databindingProperties.releaseVersion}"
+
+ext.config = databindingProperties
+ext.config.externalPrebuiltsBase = "${root}/../../prebuilts"
+databindingProperties.megaRepoDir = "${databindingProperties.externalPrebuiltsBase}/tools/common/m2/repository"
+
+println "local maven repo is ${ext.config.mavenRepoDir}."
+println "local pre-build folder is ${ext.config.prebuildFolder}."
+println "mega-repo folder is ${ext.config.megaRepoDir}."
+
+new File(ext.config.mavenRepoDir).mkdir()
+new File(ext.config.prebuildFolder).mkdir()
+
+def addRemoteRepos = !project.hasProperty('addRemoteRepos') || project.getProperty('addRemoteRepos').equals("true")
+ext.config.addRemoteRepos = addRemoteRepos
+def config = ext.config
+def localRepositories = ["${config.extraPluginsRepoDir}",
+ "${config.megaRepoDir}",
+ "${config.mavenRepoDir}",
+ "${config.externalPrebuiltsBase}/maven_repo/android",
+ "${config.externalPrebuiltsBase}/gradle-plugin",
+ "${config.externalPrebuiltsBase}/tools/common/m2/repository"]
+ext.config.localRepositories = localRepositories
+def addRepos(RepositoryHandler handler) {
+ config.localRepositories.each { repo ->
+ handler.maven {
+ url repo
+ }
+ }
+ handler.jcenter()
+ handler.mavenCentral()
+}
+ext.addRepos = this.&addRepos
+subprojects {
+ buildscript {
+ config.localRepositories.each { repo ->
+ repositories.maven {
+ url repo
+ }
+ }
+ repositories {
+ if (config.addRemoteRepos) {
+ jcenter()
+ mavenCentral()
+ }
+ }
+ }
+ repositories {
+ config.localRepositories.each { repo ->
+ repositories.maven {
+ url repo
+ }
+ }
+ if (config.addRemoteRepos) {
+ jcenter()
+ mavenCentral()
+ }
+ }
+}