build.gradle 1.32 KB
Newer Older
1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2 3

allprojects {
4
	repositories {
5 6
		jcenter()
		mavenLocal()
7 8 9
		maven {
			url 'https://maven.google.com'
		}
10 11 12 13 14
	}
}

buildscript {
	repositories {
15
		jcenter()
16
		mavenLocal()
17 18 19
		maven {
			url "https://plugins.gradle.org/m2/"
		}
20
		google()
21
	}
22

23
	dependencies {
24
		classpath 'com.android.tools.build:gradle:3.0.0'
25
		classpath 'net.ltgt.gradle:gradle-apt-plugin:0.9'
26
		classpath 'de.undercouch:gradle-download-task:3.2.0'
akwizgran's avatar
akwizgran committed
27
		classpath files('libs/gradle-witness.jar')
28
	}
29
}
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

// If a Java 6 JRE is available, check we're not using any Java 7 or 8 APIs
ext.useJava6StandardLibrary = { task ->
	def home = System.env.JAVA_6_HOME;
	if (home != null && !home.isEmpty()) {
		println "Setting Java 6 bootstrap classpath for ${task.name}"
		task.dependsOn createJavaLangInvokeJar
		task.options.bootstrapClasspath = files(
				"${project.rootDir}/build/invoke.jar",
				"${home}/jre/lib/rt.jar",
				"${home}/jre/lib/jsse.jar"
		)
	}
}

// Create a jar containing the java.lang.invoke classes for the Java 6 bootstrap classpath
task createJavaLangInvokeJar(type: Zip) {
	archiveName 'invoke.jar'
	destinationDir file("${project.rootDir}/build")
	from zipTree("${System.getProperty('java.home')}/lib/rt.jar").matching {
		include 'java/lang/invoke/*'
	}
	include '**/*'
}