aboutsummaryrefslogtreecommitdiff
path: root/gradle/src
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-12-10 15:20:31 -0800
committerXavier Ducrohet <xav@android.com>2012-12-11 10:21:44 -0800
commit7d37b2da92258af4e92da1055767706097d81428 (patch)
tree674f6907dd50081550410eec627a0cce91a0dc55 /gradle/src
parentbd04878e60be0477dd7752f731c29a880b0268f9 (diff)
downloadbuild-7d37b2da92258af4e92da1055767706097d81428.tar.gz
Move to Gradle 1.3
- Update the wrapper and wrapper scripts to force 1.3 - add gradle version detection to the android plugins to make them fail if the version of gradle is not right. - Ensure the test projects are built with the right version. Change-Id: Ibd2d970f9bdf98acbca54847eb493b3379532d99
Diffstat (limited to 'gradle/src')
-rw-r--r--gradle/src/integration-test/groovy/com/android/build/gradle/ProjectTest.groovy2
-rw-r--r--gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy14
2 files changed, 14 insertions, 2 deletions
diff --git a/gradle/src/integration-test/groovy/com/android/build/gradle/ProjectTest.groovy b/gradle/src/integration-test/groovy/com/android/build/gradle/ProjectTest.groovy
index 51d585f..da4425d 100644
--- a/gradle/src/integration-test/groovy/com/android/build/gradle/ProjectTest.groovy
+++ b/gradle/src/integration-test/groovy/com/android/build/gradle/ProjectTest.groovy
@@ -152,7 +152,7 @@ class ProjectTest extends BaseTest {
GradleConnector connector = GradleConnector.newConnector()
ProjectConnection connection = connector
- .useGradleVersion("1.2")
+ .useGradleVersion(BasePlugin.GRADLE_VERSION)
.forProjectDirectory(project)
.connect()
diff --git a/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy b/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy
index 0c9dd45..02d2120 100644
--- a/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy
+++ b/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy
@@ -75,6 +75,7 @@ import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.internal.reflect.Instantiator
+import org.gradle.tooling.BuildException
import org.gradle.util.GUtil
/**
@@ -82,6 +83,9 @@ import org.gradle.util.GUtil
*/
public abstract class BasePlugin {
+ public final static String GRADLE_VERSION = "1.3";
+
+
public final static String INSTALL_GROUP = "Install"
protected static File TEST_SDK_DIR;
@@ -117,6 +121,14 @@ public abstract class BasePlugin {
protected void apply(Project project) {
this.project = project
+
+ if (!project.getGradle().gradleVersion.startsWith(GRADLE_VERSION)) {
+ throw new BuildException(
+ String.format(
+ "Gradle version %s is required. Current version is %s",
+ GRADLE_VERSION, project.getGradle().gradleVersion), null);
+ }
+
project.apply plugin: JavaBasePlugin
project.tasks.assemble.description =
@@ -795,7 +807,7 @@ public abstract class BasePlugin {
List<AndroidDependency> bundles = []
List<JarDependency> jars = []
collectArtifacts(compileClasspath, artifacts)
- compileClasspath.resolvedConfiguration.resolutionResult.root.dependencies.each { ResolvedDependencyResult dep ->
+ compileClasspath.incoming.resolutionResult.root.dependencies.each { ResolvedDependencyResult dep ->
addDependency(dep.selected, configDependencies, bundles, jars, modules,
artifacts, reverseMap)
}