generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathbuild.gradle
65 lines (56 loc) · 2.04 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
plugins {
id('fabric-loom').version('0.11-SNAPSHOT')
id('maven-publish')
id('org.ajoberstar.grgit').version('4.1.0')
}
setSourceCompatibility(JavaVersion.toVersion(project.java_version))
setTargetCompatibility(JavaVersion.toVersion(project.java_version))
String real_version = "${project.mod_version}"
if (project.pre_release as String != "") {
real_version += "-${project.pre_release}+"
if (project.pre_release as String == "alpha" && !grgit.status().clean) {
real_version += new Date().format("yyyyMMdd.HHmmss") + ".dirty." + grgit.head().abbreviatedId
} else {
real_version += grgit.head().abbreviatedId
}
}
setArchivesBaseName("${project.archives_base_name}-${project.minecraft_version}")
setVersion(real_version)
setGroup(project.maven_group)
repositories {
maven {
url "https://www.cursemaven.com"
}
mavenCentral()
}
dependencies {
minecraft("com.mojang:minecraft:${project.minecraft_version}")
mappings("net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2")
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
// fabric-carpet
modImplementation("curse.maven:carpet-349239:${project.carpet_core_version}")
// multiconnect
modImplementation("net.earthcomputer.multiconnect:multiconnect-api:${project.multiconnect_version}") {
transitive = false
}
include("net.earthcomputer.multiconnect:multiconnect-api:${project.multiconnect_version}")
}
loom {
accessWidenerPath.set(file("src/main/resources/pca.accesswidener"))
}
processResources {
inputs.property("version", real_version)
filesMatching("fabric.mod.json") {
expand(["version": real_version])
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release.set(Integer.parseInt(project.java_version as String))
}
jar {
from("LICENSE") {
rename({ return "${it}_${project.archives_base_name}" })
}
}