forked from apache/click
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
95 lines (82 loc) · 2.95 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
plugins {
id 'java'
id 'war'
id 'application'
id 'idea'
alias(libs.plugins.lombok)
alias(libs.plugins.sonarlint)
alias(libs.plugins.errorprone)
}
repositories {
mavenLocal()
mavenCentral()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all,-serial', '-parameters', '-g', '-Xmaxwarns', '999'])
options.release.set(17) // javac --release 7..18+
options.deprecation = true
options.errorprone {
enabled = true
disableWarningsInGeneratedCode = true
excludedPaths = ".*/(build/gen|test).*/.*"
disable("MissingSummary")
disable("UnusedVariable")
errorproneArgs = ["--illegal-access=warn"]
}
}
// https://docs.gradle.org/current/userguide/publishing_maven.html
java {
withSourcesJar()
// withJavadocJar()
}
dependencies {
errorprone "com.google.errorprone:error_prone_core:latest.release"
compileOnly libs.javaxServletApi
implementation libs.bundles.springMini, libs.bundles.springSecurity
implementation project(':click')
implementation project(':click-extras')
implementation(libs.slf4jApi, libs.slf4jJCL, libs.slf4jLog4j)
// TEST
testImplementation libs.bundles.junit
testRuntimeOnly libs.slf4jSimple
testImplementation project(':click-mock')
}
configurations.configureEach { // .implementation // https://tomgregory.com/how-to-exclude-gradle-dependencies/
exclude group: "velocity", module: "velocity" // 1.3 they come from somewhere..
exclude group: "commons-logging", module: "commons-logging" // spring?
exclude group: 'org.springframework', module: 'spring-jcl'
exclude group: "org.apache.logging.log4j", module: "log4j-api"
exclude group: "org.apache.logging.log4j", module: "log4j-to-slf4j"
exclude group: "log4j", module: "log4j"
exclude group: "org.jboss.slf4j", module: "slf4j-jboss-logmanager"
exclude group: "com.mchange", module: "c3p0"
exclude group: 'com.google.guava', module: 'listenablefuture'
}
idea { module { downloadJavadoc = true; downloadSources = true } }
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true // show standard out & err of the test JVM on the console
showExceptions = true
exceptionFormat = 'full'
}
enableAssertions = true
maxHeapSize = "500m"
systemProperty("file.encoding", "UTF-8")
systemProperty("user.language", "en")
Locale.setDefault(new Locale("en", "US"));
}
lombok { version = "latest.release" }
sonarLint { ignoreFailures = true }
tasks.named("sonarlintMain").configure {
onlyIf { // gradle build -Psonarlint=true -or- -Dsonarlint=true
(project.hasProperty('sonarlint') && 'true'.equalsIgnoreCase(project.property('sonarlint').toString())) || 'true'.equalsIgnoreCase(System.getProperty('sonarlint'))
}
}
tasks.named("sonarlintTest").configure {
onlyIf {
(project.hasProperty('sonarlint') && 'true'.equalsIgnoreCase(project.property('sonarlint').toString())) || 'true'.equalsIgnoreCase(System.getProperty('sonarlint'))
}
}