-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathbuild.gradle.kts
63 lines (52 loc) · 1.94 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
53
54
55
56
57
58
59
60
61
62
63
/** Guava compatibility adapter. The tests are forked from Guava commit e370dde. */
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
plugins {
id("java-library-caffeine-conventions")
}
dependencies {
api(project(":caffeine"))
api(libs.guava)
testImplementation(libs.jctools)
testImplementation(libs.guava.testlib)
testImplementation(libs.bundles.slf4j.nop)
}
tasks.named<JavaCompile>("compileJava").configure {
modularity.inferModulePath = true
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
project(":caffeine").plugins.withId("java-library") {
val caffeineJar = project(":caffeine").tasks.jar
val guavaJar = project(":guava").tasks.jar
dependsOn(caffeineJar, guavaJar)
systemProperties(mapOf(
"guava.osgi.version" to libs.versions.guava.get(),
"caffeine.osgi.jar" to relativePath(caffeineJar.get().archiveFile.get().asFile.path),
"caffeine-guava.osgi.jar" to relativePath(guavaJar.get().archiveFile.get().asFile.path),
))
}
}
tasks.jar {
bundle.bnd(mapOf(
"Bundle-SymbolicName" to "com.github.ben-manes.caffeine.guava",
"Import-Package" to listOf(
"com.google.common.cache",
"com.google.common.util.concurrent",
"com.github.benmanes.caffeine.cache",
"com.github.benmanes.caffeine.cache.stats").joinToString(","),
"Export-Package" to "com.github.benmanes.caffeine.guava",
"Automatic-Module-Name" to "com.github.benmanes.caffeine.guava"))
}
tasks.withType<Javadoc>().configureEach {
javadocOptions {
addStringOption("Xdoclint:none", "-quiet")
}
}
tasks.named<CheckForbiddenApis>("forbiddenApisMain").configure {
bundledSignatures.addAll(listOf("jdk-deprecated", "jdk-internal",
"jdk-non-portable", "jdk-reflection", "jdk-system-out", "jdk-unsafe"))
}
tasks.named<CheckForbiddenApis>("forbiddenApisTest").configure {
bundledSignatures.addAll(listOf("jdk-deprecated", "jdk-internal",
"jdk-non-portable", "jdk-system-out", "jdk-unsafe"))
}