diff --git a/.gitignore b/.gitignore index d819b41..df0fcc8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ gen bin build +user.gradle diff --git a/build.gradle b/build.gradle index 9755fa2..5c43d5d 100644 --- a/build.gradle +++ b/build.gradle @@ -22,16 +22,18 @@ dependencies { tasks.findByPath(':preBuild').dependsOn += ':compatSetup' -task compatSetup (dependsOn: [':compat:assembleDebug',':compat:assembleRelease']) << { +task compatSetup(dependsOn: [':compat:assembleDebug', ':compat: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{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'); - }; - classpathSet.set(true); + tasks.findAll { it.path.startsWith(':compile') && it.path.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'); + }; + classpathSet.set(true); + } } - }}; + }; } @@ -61,3 +63,7 @@ android { } } } + +if (file('user.gradle').exists()) { + apply from: 'user.gradle' +}