gradle-plugins/gradle/compile/groovy-static.gradle

40 lines
1 KiB
Groovy
Raw Normal View History

2024-01-08 00:38:42 +01:00
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'] }
}
}