-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
147 lines (118 loc) · 4.55 KB
/
build.gradle
File metadata and controls
147 lines (118 loc) · 4.55 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
plugins {
id "java-library"
id "idea"
id 'maven-publish'
alias(libs.plugins.lombok)
alias(libs.plugins.ebean)
//alias(libs.plugins.sonarlint)
alias(libs.plugins.errorprone)
}
println "[INFO] ${project.group}:${project.name}:$version ⇒ ${tasks.jar.archiveFileName.get()} # JVM: ${System.getProperty("java.version")} Gradle: ${gradle.gradleVersion}"
repositories {
mavenLocal()
mavenCentral()
maven { url = "https://jitpack.io" }
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all,-serial', '-parameters'])
options.release.set(17) // javac --release 7..22+
options.deprecation = true
options.errorprone {
enabled = true
disableWarningsInGeneratedCode = true
excludedPaths = ".*/(generated|test).*/.*"
disable("UnusedVariable")
disable("MissingSummary")
disable("StringConcatToTextBlock")
errorproneArgs = ["-XepExcludedPaths:.*/test/.*"]
}
}
dependencies {
errorprone("com.google.errorprone:error_prone_core:latest.release")
compileOnly(libs.errorprone, libs.jspecify)
implementation(libs.ebean.avaje.config)
api(libs.ebean.core)
api(libs.hikariCP)
implementation(libs.bundles.jackson)
implementation(libs.jakarta.annotationApi)
implementation(libs.jakarta.validationApi)
compileOnly(libs.slf4jApi)
api("org.eclipse.microprofile.config:microprofile-config-api:latest.release")
compileOnly(libs.smallryeConfig)
compileOnly libs.micrometerCore
// compileOnly("io.ebean:ebean-agent:latest.release") // fix old ebean-agent bug → upgrade IDEA plugin,
//*** TEST TEST TEST ***
testImplementation(libs.bundles.junit, libs.bundles.slf4j)
testRuntimeOnly(libs.bundles.junitRuntime)
testAnnotationProcessor(libs.annotationProcessor.ebean.queryBeanGenerator) // vs: annotationProcessor
testImplementation(libs.bundles.coreAnnotation, libs.jspecify)
testImplementation(libs.ebean.test)
testImplementation(libs.ebean.querybean)
testCompileOnly(libs.ebean.spring.txn)// to show SpringJdbcTransactionManager
testImplementation(libs.ebean.platform.h2)
testImplementation(libs.ebean.platform.sqlserver)
testRuntimeOnly(libs.jdbc.h2, libs.jdbc.mssql)
testImplementation(libs.smallryeConfig, libs.smallryeConfigSourceYaml)
}
configurations.configureEach { // .implementation ? https://tomgregory.com/how-to-exclude-gradle-dependencies/
exclude group: 'io.ebean', module: 'ebean-datasource'
exclude group: 'io.avaje', module: 'avaje-lang'
exclude group: 'io.ebean', module: 'ebean-joda-time'
exclude group: 'io.ebean', module: 'ebean-platform-all'
exclude group: 'io.ebean', module: 'ebean-platform-sqlanywhere'
exclude group: 'io.ebean', module: 'ebean-platform-oracle'
exclude group: 'io.ebean', module: 'ebean-platform-nuodb'
exclude group: 'io.ebean', module: 'ebean-platform-mariadb'
exclude group: 'io.ebean', module: 'ebean-platform-hsqldb'
exclude group: 'io.ebean', module: 'ebean-platform-hana'
exclude group: 'io.ebean', module: 'ebean-platform-db2'
exclude group: 'io.ebean', module: 'ebean-platform-clickhouse'
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: "org.jboss.slf4j", module: "slf4j-jboss-logmanager"
exclude group: "com.mchange", module: "c3p0"
}
ebean {
debugLevel = 9 //0 - 9
// queryBeans = 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")
}
//sonarLint { isGeneratedCodeIgnored = true; ignoreFailures = true }
lombok { version = "latest.release" }
publishing { // https://docs.gradle.org/current/userguide/publishing_maven.html
publications {
maven(MavenPublication) { // groupId in gradle.properties; artifactId == folder name
from components.java
suppressPomMetadataWarningsFor('runtimeElements')
}
}
}
java {
withSourcesJar()
// withJavadocJar()
}
idea { module { downloadJavadoc = true; downloadSources = true } }
jar {
from generatePomFileForMavenPublication {
rename('pom-default.xml', "META-INF/maven/${project.group}/${project.name}/pom.xml")
}
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}