-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle.kts
52 lines (44 loc) · 1.58 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
plugins {
id("java-library")
}
tasks.named("build") {
dependsOn(gradle.includedBuild("generator").task(":build"))
dependsOn(gradle.includedBuild("generator").task(":assembleDist"))
}
tasks.named("clean") {
dependsOn(gradle.includedBuild("generator").task(":clean"))
}
tasks.register("assembleDist") {
dependsOn(gradle.includedBuild("generator").task(":assembleDist"))
}
// Disable jar for top-level project
tasks.withType<Jar>().configureEach {
enabled = false
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(libs.versions.jdk.get())
}
// Generate javadoc for all modules
tasks.withType<Javadoc>().configureEach {
options {
this as StandardJavadocDocletOptions
addStringOption("tag", "apiNote:a:API Note:")
addStringOption("Xdoclint:none", "-quiet")
addStringOption("-add-modules", "org.jetbrains.annotations,org.freedesktop.cairo")
encoding = "UTF-8"
}
exclude("**/module-info.java")
source(subprojects.flatMap { it.sourceSets["main"].allJava.srcDirs })
// Exclude external dependencies from the classpath
classpath = files(subprojects.flatMap { subproject ->
subproject.sourceSets["main"].compileClasspath.filter { file ->
val path = file.absolutePath.replace("\\", "/")
path.contains("/org.jetbrains/annotations/")
|| path.contains("/io.github.jwharm.cairobindings/cairo/")
}
})
// Ensure all source code is generated before the Javadoc task starts
subprojects.forEach {
dependsOn(it.tasks.named("generateSources"))
}
}