-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.gradle
191 lines (162 loc) · 5.17 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
plugins {
id 'fabric-loom' version '1.8.+'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
archivesBaseName = project.archives_base_name
group = project.maven_group
sourceSets {
testmod {
runtimeClasspath += main.runtimeClasspath
compileClasspath += main.compileClasspath
}
}
loom {
runs {
testmodClient {
client()
ideConfigGenerated project.rootProject == project
name = "Test Mod Client"
source sourceSets.testmod
}
testmodServer {
server()
ideConfigGenerated project.rootProject == project
name = "Test Mod Server"
source sourceSets.testmod
}
}
accessWidenerPath = file("src/main/resources/plasmid.accesswidener")
runtimeOnlyLog4j = true
}
def env = System.getenv()
def minor = env.get("MINOR_VERSION")
version = "${project.mod_version}"
def versionGame = version;
def build = env.get("BUILD_NUMBER")
if (minor == null) {
version += ".9999-local"
versionGame += ".9999-local"
} else {
version += ".${minor}"
versionGame += ".${minor}"
if (build != null) {
version += "-SNAPSHOT"
versionGame += "-build." + build
}
}
versionGame += "+" + project.minecraft_version
version += "+" + project.minecraft_version
repositories {
maven { url = "https://maven.nucleoid.xyz/" }
maven { url = "https://maven.gegy.dev/" }
maven { url = "https://api.modrinth.com/maven/" }
maven { url 'https://jitpack.io' }
maven {
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/"
}
maven {
name = "Ladysnake Libs"
url = 'https://maven.ladysnake.org/releases'
}
}
loom {
splitEnvironmentSourceSets()
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
testImplementation "net.fabricmc:fabric-loader-junit:${project.loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modApi include("xyz.nucleoid:server-translations-api:${project.server_translations_version}")
modApi include("xyz.nucleoid:packet-tweaker:${project.packet_tweaker_version}")
modApi include("xyz.nucleoid:fantasy:${project.fantasy_version}")
modApi include("xyz.nucleoid:more-codecs:${project.more_codecs_version}")
modApi include("xyz.nucleoid:stimuli:${project.stimuli_version}")
modApi include("xyz.nucleoid:map-templates:${project.map_templates_version}")
modApi include("xyz.nucleoid:substrate:${project.substrate_version}")
modApi "eu.pb4:polymer-core:${project.polymer_version}"
modApi "eu.pb4:polymer-resource-pack:${project.polymer_version}"
modApi "eu.pb4:polymer-blocks:${project.polymer_version}"
modApi "eu.pb4:polymer-virtual-entity:${project.polymer_version}"
modApi include("eu.pb4:sgui:${project.sgui_version}")
modApi include("eu.pb4:sidebar-api:${project.sidebar_api_version}")
modApi include("eu.pb4:placeholder-api:${project.placeholder_api_version}")
modApi include("eu.pb4:map-canvas-api:${project.map_canvas_api_version}")
modApi include("eu.pb4:player-data-api:${project.player_data_api_version}")
modApi include("eu.pb4:predicate-api:${project.predicate_api_version}")
modImplementation include("me.lucko:fabric-permissions-api:${project.permission_api_version}")
modCompileOnly('xyz.nucleoid:disguiselib-fabric:1.3.2')
modCompileOnly('maven.modrinth:afkdisplay:1.1.0')
modCompileOnly("eu.pb4:polymer-autohost:${project.polymer_version}")
modCompileOnly("dev.emi:trinkets:3.10.0")
testmodImplementation sourceSets.main.output
testmodImplementation sourceSets.client.output
}
test {
useJUnitPlatform()
}
processResources {
inputs.property "version", versionGame
filesMatching("fabric.mod.json") {
expand "version": versionGame
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 21
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
if (System.getenv("MODRINTH")) {
modrinth {
token = System.getenv("MODRINTH")
projectId = 'xUvfRSZh'// The ID of your modrinth project, slugs will not work.
versionNumber = "" + version // The version of the mod to upload.
versionType = "release"
uploadFile = remapJar // This links to a task that builds your mod jar and sets "uploadFile" to the mod jar.
gameVersions = [((String) project.minecraft_version)]
changelog = System.getenv("CHANGELOG")
dependencies {
required.project 'polymer'
required.project 'fabric-api'
optional.project 'afkdisplay'
optional.project 'disguiselib'
embedded.project 'placeholder-api'
}
loaders = ["fabric", "quilt"]
}
remapJar {
finalizedBy project.tasks.modrinth
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
if (env.MAVEN_URL) {
maven {
credentials {
username env.MAVEN_USERNAME
password env.MAVEN_PASSWORD
}
url env.MAVEN_URL
}
} else {
mavenLocal()
}
}
}