-
Notifications
You must be signed in to change notification settings - Fork 73
/
build.gradle
61 lines (51 loc) · 1.55 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
plugins {
id 'com.diffplug.spotless' version '6.25.0' apply false
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
}
subprojects {
apply plugin: 'java'
apply plugin: 'pmd'
apply plugin: "com.diffplug.spotless"
apply plugin: 'maven-publish'
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
archivesBaseName = "${mod_name}"
repositories {
mavenCentral()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
}
tasks.withType(GenerateModuleMetadata).configureEach {
it.enabled = false
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
pmd {
toolVersion '6.35.0'
incrementalAnalysis.set(true)
ruleSetFiles = rootProject.files("spotless/pmd-ruleset.xml")
}
jar {
from "LICENSE.txt"
exclude "**/*.bat"
exclude "**/*.psd"
exclude "**/*.ase"
exclude "**/*.exe"
exclude "**/unused"
exclude ".cache"
}
spotless {
enforceCheck = false // workaround around jenkins having wrong line endings in some files
// we explicitly check in github actions builds
java {
indentWithTabs()
eclipse().configFile rootProject.file('spotless/eclipseformat.xml')
removeUnusedImports()
importOrderFile rootProject.file('spotless/eclipse.importorder')
}
}
}