Created
March 9, 2011 20:09
-
-
Save sebersole/862894 to your computer and use it in GitHub Desktop.
This file contains 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
generatedLoggingSrcMainDir = file( buildDirName + "/generated-src/logging/main" ) | |
generatedLoggingSrcTestDir = file( buildDirName + "/generated-src/logging/test" ) | |
sourceSets{ | |
main { | |
java { | |
srcDir( generatedLoggingSrcMainDir ) | |
} | |
compileClasspath += configurations.provided | |
} | |
test { | |
java { | |
srcDir( generatedLoggingSrcTestDir ) | |
} | |
} | |
} | |
task generateMainLoggingClasses(type: Compile) { | |
classpath = compileJava.classpath + configurations.jbossLoggingTool | |
source = compileJava.source | |
destinationDir = compileJava.destinationDir | |
options.define( | |
compilerArgs: [ | |
"-nowarn", | |
"-proc:only", | |
"-processor", "org.jboss.logging.LoggingToolsProcessor", | |
"-s", "$generatedLoggingSrcMainDir.absolutePath" | |
] | |
); | |
outputs.dir generatedLoggingSrcMainDir; | |
doFirst { | |
generatedLoggingSrcMainDir.mkdirs() | |
} | |
} | |
compileJava.dependsOn generateMainLoggingClasses | |
compileJava.options.define(compilerArgs: ["-proc:none"]) | |
task generateTestLoggingClasses(type: Compile) { | |
classpath = compileTestJava.classpath + configurations.jbossLoggingTool | |
source = compileTestJava.source | |
destinationDir = compileTestJava.destinationDir | |
options.define( | |
compilerArgs: [ | |
"-nowarn", | |
"-proc:only", | |
"-processor", "org.jboss.logging.LoggingToolsProcessor", | |
"-s", "$generatedLoggingSrcTestDir.absolutePath" | |
] | |
); | |
outputs.dir generatedLoggingSrcTestDir; | |
doFirst { | |
generatedLoggingSrcTestDir.mkdirs() | |
} | |
} | |
compileTestJava.dependsOn generateTestLoggingClasses | |
compileTestJava.options.define(compilerArgs: ["-proc:none"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment