Created
November 2, 2013 15:29
-
-
Save galex/7280110 to your computer and use it in GitHub Desktop.
storm-gen gradle script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.6.+' | |
} | |
} | |
apply plugin: 'android-library' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile 'log4j:log4j:1.2.16' | |
//compile 'org.slf4j:slf4j-log4j12:1.6.1' | |
compile files('libs/storm-apt-0.97.jar') | |
} | |
def getSourceSetName(variant) { | |
return new File(variant.dirName).getName(); | |
} | |
android.libraryVariants.all { variant -> | |
def aptOutputDir = project.file("${project.projectDir}/src/main/generated") | |
android.sourceSets[getSourceSetName(variant)].java.srcDirs += aptOutputDir.getPath() | |
variant.javaCompile.options.compilerArgs += [ | |
"-processor", "com.turbomanage.storm.apt.MainProcessor", | |
'-AandroidManifestFile=' + variant.processResources.manifestFile, | |
'-s', aptOutputDir | |
] | |
variant.javaCompile.source = variant.javaCompile.source.filter { p -> | |
return !p.getPath().startsWith(aptOutputDir.getPath()) | |
} | |
variant.javaCompile.doFirst { | |
aptOutputDir.mkdirs() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment