groovy-extensions/gradle/compile/java.gradle

47 lines
838 B
Groovy
Raw Normal View History

2021-11-04 16:28:10 +01:00
apply plugin: 'java-library'
java {
modularity.inferModulePath.set(true)
}
compileJava {
2022-04-28 19:07:22 +02:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2021-11-04 16:28:10 +01:00
}
compileTestJava {
2022-04-28 19:07:22 +02:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
2021-11-04 16:28:10 +01:00
}
jar {
manifest {
attributes('Implementation-Version': project.version)
}
}
2021-12-19 00:37:39 +01:00
task sourcesJar(type: Jar) {
dependsOn classes
2021-11-04 16:28:10 +01:00
classifier 'sources'
from sourceSets.main.allSource
}
2021-12-19 00:37:39 +01:00
task javadocJar(type: Jar) {
dependsOn javadoc
2021-11-04 16:28:10 +01:00
classifier 'javadoc'
2021-12-19 00:37:39 +01:00
from javadoc.destinationDir
2021-11-04 16:28:10 +01:00
}
artifacts {
archives sourcesJar, javadocJar
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:all,-fallthrough'
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}