-
-
Notifications
You must be signed in to change notification settings - Fork 128
/
build.gradle
75 lines (64 loc) · 1.91 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.23.3"
}
}
plugins {
// Required for NeoGradle
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()
maven {
name = 'Sponge / Mixin'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
}
tasks.withType(GenerateModuleMetadata).configureEach {
it.enabled = false
}
pmd {
toolVersion '6.35.0'
incrementalAnalysis.set(true)
ruleSetFiles = rootProject.files("spotless/pmd-ruleset.xml")
}
jar {
from "LICENSE"
exclude "**/*.bat"
exclude "**/*.psd"
exclude "**/*.exe"
exclude "**/unused"
// exclude test data
exclude "**/assets/patchouli/patchouli_books/**"
exclude "**/data/patchouli/patchouli_books/**"
exclude "**/data/patchouli/advancements/**"
exclude "**/data/patchouli/recipes/**"
}
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')
}
}
}