Skip to content

Instantly share code, notes, and snippets.

@hvisser
Created June 25, 2013 21:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hvisser/2679c5c8f983c9a15564 to your computer and use it in GitHub Desktop.
Save hvisser/2679c5c8f983c9a15564 to your computer and use it in GitHub Desktop.
android.applicationVariants.each { variant ->
def aptOutput = project.file("apt_generated/${variant.dirName}")
variant.javaCompile.doFirst {
variant.javaCompile.options.compilerArgs += [
'-processorpath', configurations.compile.getAsPath(),
'-s', aptOutput
]
variant.javaCompile.source = variant.javaCompile.source.filter { p ->
return !p.getPath().startsWith(aptOutput.getPath())
}
}
}
android.sourceSets.debug.java.srcDirs+= "apt_generated/debug"
android.sourceSets.release.java.srcDirs+= "apt_generated/release"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment