-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.gradle
More file actions
75 lines (62 loc) · 1.91 KB
/
common.gradle
File metadata and controls
75 lines (62 loc) · 1.91 KB
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
java {
sourceCompatibility = targetCompatibility = 8
// withSourcesJar()
// withJavadocJar()
}
def snapshot = project.release=="true" ? "" : "-SNAPSHOT"
def mod_version = project.mod_version + snapshot
def allowed_mc_version = project.allowed_mc_version
version = mod_version
group = project.maven_group
base {
archivesName = "${mod_name}-${minecraft_version}"
}
//tasks.withType(JavaCompile).configureEach {
// it.options.release = 21
//}
ploceus {
setIntermediaryGeneration(2)
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:"+project.loader_version
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${minecraft_version}"
// mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
//mappings loom.officialMojangMappings()
mappings ploceus.mcpMappings(project.mcp_channel, project.mcp_mcversion, project.mcp_build)
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/modid.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 "-Dmodid.log.level=debug"
}
server {
ideConfigGenerated = true
vmArgs "-Dmodid.log.level=debug"
}
}
}
processResources {
inputs.property "version", mod_version
inputs.property "allowedMcVersion", allowed_mc_version
filesMatching("fabric.mod.json") { file ->
expand "version": mod_version
filter { String line ->
line.replace('"minecraft": "*",', '"minecraft": "' + allowed_mc_version + '",')
};
}
}