forked from ben-manes/caffeine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (87 loc) · 2.76 KB
/
build.gradle
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import net.ltgt.gradle.errorprone.CheckSeverity
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply plugin: 'io.snyk.gradle.plugin.snykplugin'
apply plugin: 'org.kordamp.gradle.source-stats'
apply plugin: 'com.github.ben-manes.versions'
apply from: "${rootDir}/gradle/coveralls.gradle"
buildscript {
apply from: "${rootDir}/gradle/dependencies.gradle"
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath gradlePlugins.values()
}
}
allprojects {
apply plugin: 'com.github.ethankhall.semantic-versioning'
apply from: "${rootDir}/gradle/eclipse.gradle"
repositories {
mavenCentral()
}
group = 'com.github.ben-manes.caffeine'
version.with {
major = 3 // incompatible API changes
minor = 0 // backwards-compatible additions
patch = 6 // backwards-compatible bug fixes
releaseBuild = rootProject.hasProperty('release')
}
}
subprojects {
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/codeQuality.gradle"
apply from: "${rootDir}/gradle/dependencies.gradle"
apply from: "${rootDir}/gradle/objectLayout.gradle"
java.toolchain.languageVersion = JavaLanguageVersion.of(System.env.'JAVA_VERSION' ?: 11)
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('org.hamcrest:hamcrest-core') using module(testLibraries.hamcrest)
}
}
dependencies {
testImplementation libraries.guava
testImplementation testLibraries.truth
testImplementation testLibraries.mockito
testImplementation testLibraries.hamcrest
testImplementation testLibraries.awaitility
testImplementation testLibraries.osgiCompile
testRuntimeOnly testLibraries.osgiRuntime
}
tasks.register('bundle', aQute.bnd.gradle.Bundle) {
from sourceSets.main.output
sourceSet = sourceSets.main
}
tasks.withType(JavaCompile).configureEach {
if (name.contains('Test') || name.contains('Jmh')) {
options.errorprone.nullaway {
severity = CheckSeverity.OFF
}
}
}
if (project != project(':caffeine')) {
javadoc.options.linksOffline(
"https://static.javadoc.io/${group}/caffeine/${version}/",
"${project(':caffeine').buildDir}/docs/javadoc/",
)
javadoc.dependsOn(project(':caffeine').javadoc)
}
}
nexusPublishing {
repositories {
sonatype {
username = project.properties['nexusUsername'] ?: System.env.'NEXUS_USERNAME'
password = project.properties['nexusPassword'] ?: System.env.'NEXUS_PASSWORD'
}
}
}
snyk {
api = System.env.SNYK_TOKEN
arguments = '--all-sub-projects --sarif-file-output=snyk.sarif'
autoDownload = true
autoUpdate = true
}