This repository has been archived by the owner on Aug 2, 2024. It is now read-only.
forked from Flamtky/DevDungeon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
64 lines (51 loc) · 1.57 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
buildscript {
apply from: 'dependencies.gradle'
}
plugins {
id 'com.diffplug.spotless' version "${spotlessVersion}"
}
allprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
sourceCompatibility = JavaVersion.VERSION_21
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
}
tasks.withType(JavaExec).configureEach {
dependsOn classes
standardInput = System.in
ignoreExitValue true
systemProperty 'BASELOGDIR', project.baseLogDir
}
clean {
delete project.baseLogDir
}
checkstyle {
configFile = rootProject.file('.checkstyle.xml')
// Default version vs. current version? The default version is quite old (9.3 from
// Jan 30, 2022), so let's go with the current version (10.14).
// However, this needs to be updated manually as Dependabot won't deal with this!
toolVersion = '10.15.0'
ignoreFailures = false
maxWarnings = 0
}
// Workaround to resolve CS dependencies: https://github.com/checkstyle/checkstyle/issues/14123#issuecomment-1961029772
configurations.checkstyle {
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
select("com.google.guava:guava:0")
}
}
}
spotless {
java {
targetExclude('build/generated-src/**')
googleJavaFormat()
target '**/*.java'
}
}