-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.gradle
62 lines (52 loc) · 1.5 KB
/
common.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
java {
sourceCompatibility = targetCompatibility = 21
withSourcesJar()
}
version = project.mod_version
group = project.maven_group
base {
archivesName = "${mod_name}-${minecraft_version}"
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
}
loom {
// set access widener
def accessWidenerFile = file('src/main/resources/lotaslight.accesswidener')
if(accessWidenerFile.exists()) {
accessWidenerPath = accessWidenerFile
}
// set custom log4jconfig
def log4jFile = file('src/main/resources/log4j.xml')
if(log4jFile.exists()) {
log4jConfigs.from(log4jFile)
}
runs {
client {
ideConfigGenerated = true
vmArgs "-Dlotaslight.log.level=debug"
}
server {
ideConfigGenerated = true
vmArgs "-Dlotaslight.log.level=debug"
}
}
}
processResources {
inputs.property "version", project.version
inputs.property "allowedMcVersion", project.allowed_mc_version
filesMatching("fabric.mod.json") { file ->
expand "version": project.version
filter { String line ->
line.replace('"minecraft": "*",', '"minecraft": "' + project.allowed_mc_version + '",')
};
}
}