40 lines
1 KiB
Groovy
40 lines
1 KiB
Groovy
|
apply plugin: 'groovy'
|
||
|
|
||
|
// no groovy dependencies, we must use gradle embedded groovy
|
||
|
|
||
|
compileGroovy {
|
||
|
// type checked, static
|
||
|
groovyOptions.configurationScript = rootProject.file('gradle/compile/groovyc.groovy')
|
||
|
}
|
||
|
|
||
|
compileTestGroovy {
|
||
|
// type checked, static
|
||
|
groovyOptions.configurationScript = rootProject.file('gradle/compile/groovyc.groovy')
|
||
|
}
|
||
|
|
||
|
tasks.withType(GroovyCompile) {
|
||
|
options.forkOptions.jvmArgs.add('-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true')
|
||
|
options.compilerArgs
|
||
|
if (!options.compilerArgs.contains("-processor")) {
|
||
|
options.compilerArgs.add('-proc:none')
|
||
|
}
|
||
|
}
|
||
|
|
||
|
task groovydocJar(type: Jar) {
|
||
|
dependsOn groovydoc
|
||
|
from groovydoc.destinationDir
|
||
|
archiveClassifier.set('groovydoc')
|
||
|
}
|
||
|
tasks.assemble.dependsOn(tasks.groovydocJar)
|
||
|
|
||
|
artifacts {
|
||
|
archives groovydocJar
|
||
|
}
|
||
|
// make java source visible to groovy compiler, suppress sources for java compiler
|
||
|
sourceSets {
|
||
|
main {
|
||
|
java { srcDirs = [] }
|
||
|
groovy { srcDirs += ['src/main/java'] }
|
||
|
}
|
||
|
}
|