-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
184 lines (149 loc) · 4.47 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
//file:noinspection All
plugins {
id "fabric-loom" version "1.8-SNAPSHOT"
id "org.jetbrains.kotlin.jvm"
id "maven-publish"
}
def ENV = System.getenv()
version = mod_version
group = maven_group
base {
archivesName = mod_id
}
repositories {
maven {
name = "Andante"
url = "https://maven.andante.dev/releases/"
}
maven {
name = "Nucleoid"
url = "https://maven.nucleoid.xyz/"
}
}
loom.splitEnvironmentSourceSets()
sourceSets {
test {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
testClient {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
compileClasspath += client.compileClasspath
runtimeClasspath += client.runtimeClasspath
compileClasspath += test.compileClasspath
runtimeClasspath += test.runtimeClasspath
}
}
dependencies {
minecraft "com.mojang:minecraft:$minecraft_version"
mappings "net.fabricmc:yarn:$minecraft_version+build.$yarn_build:v2"
modImplementation "net.fabricmc:fabric-loader:$loader_version"
modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
modImplementation "net.fabricmc:fabric-language-kotlin:$fabric_kotlin_version"
include modImplementation ("dev.andante:codex:$codex_version")
include modImplementation ("xyz.nucleoid:fantasy:$fantasy_version")
include modImplementation ("eu.pb4:polymer-core:$polymer_version")
include modImplementation ("eu.pb4:sgui:$sgui_version")
// test
testImplementation sourceSets.main.output
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:2.21.1"
testClientImplementation sourceSets.main.output
testClientImplementation sourceSets.client.output
testClientImplementation sourceSets.test.output
}
loom {
runtimeOnlyLog4j = true
accessWidenerPath = file("src/main/resources/${mod_id}.accesswidener")
mods {
mod_id {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
runs {
authenticatedClient {
inherit(client)
name("Minecraft Client (Authenticated)")
programArg("--msa")
}
testClient {
inherit(client)
name("Minecraft Client (Test)")
source(sourceSets.testClient)
runDir("runtest")
}
testClientAuthenticated {
inherit(testClient)
name("Minecraft Client (Test Authenticated)")
programArg("--msa")
runDir("runtest")
}
testServer {
inherit(server)
name("Minecraft Server (Test)")
source(sourceSets.test)
runDir("runtest")
}
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = 17
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
rename { "${it}_${base.archivesName.get()}"}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = "Blueprint"
description = "A library and development interface for creating reusable structures."
url = "https://mcbrawls.net"
licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
distribution = "repo"
}
}
}
}
}
repositories {
// Andante's Maven
def mavenUsername = ENV["MAVEN_USERNAME_ANDANTE"]
def mavenPassword = ENV["MAVEN_PASSWORD_ANDANTE"]
if (mavenUsername && mavenPassword) {
maven {
name = "Andante"
url = "https://maven.andante.dev/releases/"
credentials.username = mavenUsername
credentials.password = mavenPassword
}
}
}
}