From 854fdc157248f1308128d80416a1e18822777679 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 3 Jan 2015 13:21:20 +0100 Subject: [PATCH] Gradle: make paths relative to allow build with common root --- build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 5c43d5d..fa1673b 100644 --- a/build.gradle +++ b/build.gradle @@ -20,15 +20,15 @@ dependencies { * and then configure gradle to change the compile classpath before compiling */ -tasks.findByPath(':preBuild').dependsOn += ':compatSetup' +tasks.getByName('preBuild').dependsOn += 'compatSetup' -task compatSetup(dependsOn: [':compat:assembleDebug', ':compat:assembleRelease']) << { +task compatSetup(dependsOn: [project('compat').path+':assembleDebug', project('compat').path+':assembleRelease']) << { final java.util.concurrent.atomic.AtomicBoolean classpathSet = new java.util.concurrent.atomic.AtomicBoolean(false); - tasks.findAll { it.path.startsWith(':compile') && it.path.endsWith('Java') }.each { + tasks.findAll { it.name.startsWith('compile') && it.name.endsWith('Java') }.each { it.doFirst { if (!classpathSet.get()) { android.applicationVariants.all { - variant -> variant.javaCompile.classpath += project(':compat').files('build/intermediates/bundles/' + (variant.name.endsWith('ebug') ? 'debug' : 'release') + '/classes.jar'); + variant -> variant.javaCompile.classpath += project('compat').files('build/intermediates/bundles/' + (variant.name.endsWith('ebug') ? 'debug' : 'release') + '/classes.jar'); }; classpathSet.set(true); }