forked from DragonSurvivalTeam/DragonSurvival
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
170 lines (138 loc) · 4.41 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
id 'net.neoforged.gradle.userdev' version '7.0.165'
id 'com.diffplug.spotless' version "7.0.0.BETA4"
}
version = minecraft_version + "-v" + mod_version + "-" + new Date().format("dd.MM.yyyy")
group = mod_group
base {
archivesName = "DragonSurvival"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
runs {
configureEach {
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
systemProperty 'neoforge.logging.markers', 'REGISTRIES'
systemProperty 'neoforge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
arguments '--username', 'Dev####'
}
client_static {
runType 'client'
// The UUID is the one that will get assigned in multiplayer based on the name 'Dev'
arguments '--username', 'Dev', "--uuid", "380df991-f603-344c-a090-369bad2a924a"
}
server {
arguments
}
gameTestServer {}
data {
arguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
junit {}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
content {
includeGroup("software.bernie.geckolib")
}
}
maven { /* JEI */ url "https://maven.blamejared.com" }
maven { /* Curios */ url "https://maven.theillusivec4.top/" }
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven { url "https://api.modrinth.com/maven" }
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
// Dependencies
implementation "software.bernie.geckolib:geckolib-neoforge-${minecraft_version}:${geckolib_version}"
// Compatibility
compileOnly "mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}"
runtimeOnly("mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}")
// Test
// implementation "curse.maven:jade-324717:5846105" // 15.8.2
// implementation "maven.modrinth:sodium:mc1.21-0.6.0-beta.2-neoforge"
// implementation "curse.maven:irisshaders-455508:5765375" // 1.8 Beta 5
implementation "curse.maven:apothic-attributes-898963:5751458" // 2.4.0
implementation "curse.maven:placebo-283644:5869769" // 9.5.4
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range : minecraft_version_range,
neo_version : neo_version,
neo_version_range : neo_version_range,
loader_version_range : loader_version_range,
geckolib_version_range : geckolib_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
pack_format_number : pack_format_number,
]
duplicatesStrategy = DuplicatesStrategy.WARN
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties + [project: project]
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
minecraft {
accessTransformers {
file('src/main/resources/META-INF/accesstransformer.cfg')
}
}
// Enable JUnit in Gradle:
test {
useJUnitPlatform()
}
// We use spotless for code formatting.
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
target 'src/*/java/**/*.java'
// note: '' is for all other imports \\# is a prefix for static
// There's an empty line between all groups; use | to join without empty lines
importOrder(
'',
'java|javax',
'\\#'
)
removeUnusedImports()
// fixes formatting of type annotations
formatAnnotations()
indentWithSpaces()
}
}