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); }