-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
139 lines (114 loc) · 3.67 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
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
plugins {
id "org.jetbrains.kotlin.jvm" version "1.8.22"
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false
id 'com.diffplug.spotless-changelog' version "3.0.2" apply false
id 'com.diffplug.spotless' version '6.21.0' apply false
id 'com.palantir.git-version' version '3.0.0' apply false
}
architectury {
minecraft = rootProject.minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
// Spotless auto-formatter
// See https://github.com/diffplug/spotless/tree/main/plugin-gradle
// Can be locally toggled via spotless:off/spotless:on comments
loom {
silentMojangMappingsLicense()
}
repositories {
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.layered() {
officialMojangMappings() { nameSyntheticMembers = false }
parchment("org.parchmentmc.data:parchment-1.20.1:2023.09.03@zip")
}
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.20.1+build.10:v2"
}
}
allprojects {
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
apply plugin: 'com.diffplug.spotless'
base {
archivesName = rootProject.archives_base_name
}
version = rootProject.mod_version
group = rootProject.maven_group
spotless {
encoding 'UTF-8'
format 'misc', {
target '.gitignore'
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java' // exclude api as they are not our files
def orderFile = rootProject.file('spotless/spotless.importorder')
def formatFile = rootProject.file('spotless/spotless.eclipseformat.xml')
toggleOffOn()
importOrderFile(orderFile)
removeUnusedImports()
endWithNewline()
indentWithTabs(2)
indentWithSpaces(4)
//noinspection GroovyAssignabilityCheck
eclipse('4.19').configFile(formatFile)
}
kotlin {
target 'src/*/kotlin/**/*.kt'
toggleOffOn()
ktfmt('0.39').kotlinlangStyle()
trimTrailingWhitespace()
endWithNewline()
}
scala {
target 'src/*/scala/**/*.scala'
scalafmt('3.7.1')
}
}
repositories {
exclusiveContent {
forRepository {
maven {
name 'Modrinth'
url 'https://api.modrinth.com/maven'
}
}
filter {
includeGroup 'maven.modrinth'
}
}
maven {
name 'ModMaven'
url 'https://modmaven.dev'
}
}
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib"
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
kotlin.target.compilations.all {
kotlinOptions.jvmTarget = "17"
}
java {
withSourcesJar()
}
}
apply plugin: 'com.diffplug.spotless-changelog'
spotlessChangelog {
changelogFile 'CHANGELOG.md'
enforceCheck true
}