Skip to content

Instantly share code, notes, and snippets.

@cbart
Created June 12, 2012 20:59
apply plugin: 'java'
apply plugin: 'idea'
repositories {
mavenCentral()
}
project.ext {
v = [
junit: '4.10',
cofoja: '1.0-r139',
]
cofoja = files("lib/cofoja-${v.cofoja}.jar")
outputContractsDir = files('build/contracts') {
builtBy('compileContracts')
}
}
dependencies {
compile cofoja
testCompile "junit:junit:${v.junit}", outputContractsDir
}
compileJava {
options.compilerArgs = ['-proc:none']
}
task compileContracts(type: Compile) {
source = sourceSets.main.java.srcDirs
classpath = cofoja
destinationDir = outputContractsDir as File
options.compilerArgs = ['-classpath',
"lib/cofoja-${v.cofoja}.jar", '-processor',
'com.google.java.contract.core.apt.AnnotationProcessor',
'-proc:only']
}
test {
jvmArgs "-javaagent:lib/cofoja-${v.cofoja}.jar"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment