-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
111 lines (97 loc) · 3.51 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
107
108
109
110
plugins {
id("java-library")
id "com.github.ben-manes.versions" version "0.51.0"
id 'org.openrewrite.rewrite' version '6.27.2'
}
project.ext {
VERSION_JAVACC = '7.0.13'
DEP_SERVLET_API = 'jakarta.servlet:jakarta.servlet-api:6.1.0'
DEP_JANINO = 'org.codehaus.janino:janino:3.1.12'
DEP_JAVASSIST = 'org.javassist:javassist:3.30.2-GA'
DEP_JAVACC = "net.java.dev.javacc:javacc:${VERSION_JAVACC}"
DEP_GROOVY = 'org.apache.groovy:groovy:4.0.24'
DEP_LOMBOK_VERSION = '1.18.36'
DEP_SPOCK_BOM = 'org.spockframework:spock-bom:2.3-groovy-4.0'
DEP_SPOCK_CORE = 'org.spockframework:spock-core'
DEP_JOOL = 'org.jooq:jool:0.9.15'
DEP_VAVR = 'io.vavr:vavr:0.10.5'
DEP_VERSION_SPRING_FW = '6.2.0'
DEP_VERSION_MOCKITO = '5.14.2'
DEP_VERSION_SLF4J = '2.0.16'
DEP_VERSION_JUNIT = '5.11.3'
DEP_VERSION_ASSERTJ = '3.26.3'
DEP_VERSION_JIMFS = '1.3.0'
DEP_RECORD_BUILDER = '43'
DEP_OPEN_REWRITE_BOM = '2.22.0'
}
dependencies {
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:${DEP_OPEN_REWRITE_BOM}")) // https://mvnrepository.com/artifact/org.openrewrite.recipe/rewrite-recipe-bom
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
}
rewrite {
activeRecipe("org.openrewrite.java.RemoveUnusedImports")
activeRecipe("org.openrewrite.staticanalysis.CommonStaticAnalysis")
}
// ben-manes version-plugin:
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
// https://github.com/ben-manes/gradle-versions-plugin
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
allprojects {
// apply plugin: 'java'
apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
annotationProcessor "io.soabase.record-builder:record-builder-processor:${DEP_RECORD_BUILDER}"
compileOnly "io.soabase.record-builder:record-builder-core:${DEP_RECORD_BUILDER}"
implementation "org.slf4j:slf4j-api:${DEP_VERSION_SLF4J}"
implementation "org.slf4j:slf4j-simple:${DEP_VERSION_SLF4J}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${DEP_VERSION_JUNIT}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${DEP_VERSION_JUNIT}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${DEP_VERSION_JUNIT}"
testImplementation "org.assertj:assertj-core:${DEP_VERSION_ASSERTJ}"
testImplementation "org.mockito:mockito-core:${DEP_VERSION_MOCKITO}"
testImplementation "org.mockito:mockito-junit-jupiter:${DEP_VERSION_MOCKITO}"
testImplementation "com.google.jimfs:jimfs:${DEP_VERSION_JIMFS}"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(23)
}
}
tasks.withType(JavaCompile).each {
it.options.deprecation = true
//it.options.compilerArgs.add('--enable-preview')
}
task ('copyToLib', type: Copy) {
into('build/_artifacts')
from configurations.compileClasspath
from configurations.default.allArtifacts*.file
from configurations.compileClasspath.allArtifacts*.file
}
task renameJCC(type: Copy, dependsOn: 'copyToLib') {
from("build/_artifacts/javacc-${VERSION_JAVACC}.jar")
into('build/_artifacts')
rename("javacc-${VERSION_JAVACC}.jar", 'javacc.jar')
}
test {
jvmArgs(['--enable-preview'])
useJUnitPlatform {
// includeEngines 'junit-jupiter' // enabling this line causes spock tests not to be executed
}
testLogging {
events /*'passed',*/ 'skipped', 'failed'
}
}
}
version = '1.0'