From 76396f224f3822f2294714b396fbff4b4b5b93d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 30 Mar 2015 16:49:56 +0200 Subject: [PATCH] Bump gradle plugin to 1.1.3 We also no longer depend on the undocumented internal variable sdkFolder --- F-Droid/build.gradle | 16 +++++++++++++++- build.gradle | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/F-Droid/build.gradle b/F-Droid/build.gradle index 4aefb6cec..9c97a5481 100644 --- a/F-Droid/build.gradle +++ b/F-Droid/build.gradle @@ -178,7 +178,21 @@ android.applicationVariants.all { variant -> title = "$name $version API" description "Generates Javadoc for F-Droid." source = variant.javaCompile.source - ext.androidJar = "${android.plugin.sdkFolder}/platforms/${android.compileSdkVersion}/android.jar" + + def sdkDir + Properties properties = new Properties() + File localProps = project.rootProject.file('local.properties') + if (localProps.exists()) { + properties.load(localProps.newDataInputStream()) + sdkDir = properties.getProperty('sdk.dir') + } else { + sdkDir = System.getenv('ANDROID_HOME') + } + if (!sdkDir) { + throw new ProjectConfigurationException("Cannot find android sdk. Make sure sdk.dir is defined in local.properties or the environment variable ANDROID_HOME is set.", null) + } + + ext.androidJar = "${sdkDir}/platforms/${android.compileSdkVersion}/android.jar" classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar) options.links("http://docs.oracle.com/javase/7/docs/api/"); options.links("http://d.android.com/reference/"); diff --git a/build.gradle b/build.gradle index acf7729a6..e1d6d5abe 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.android.tools.build:gradle:1.1.3' // libsuperuser submodule requires these plugins, even though // the F-Droid build process never invokes code from them. It