-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
120 lines (98 loc) · 3.22 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
plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
id "com.modrinth.minotaur" version "${minotaur_version}"
id 'net.darkhax.curseforgegradle' version "${cfgradle_version}"
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.mod_name
version = project.mod_version + "+" + project.version_meta
group = project.maven_group
repositories {
maven { url "https://maven.terraformersmc.com/"}
maven { url "https://maven.shedaniel.me/" }
}
dependencies {
// Minecraft
minecraft "com.mojang:minecraft:${project.minecraft_version}"
// Yarn
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v${project.tiny_version}"
// Fabric Loader
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}"
// ModMenu
modRuntimeOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
// RoughlyEnoughItems
modApi "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
// Architectury Fabric
modRuntimeOnly "dev.architectury:architectury-fabric:${project.arch_version}"
}
java {
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}
processResources {
inputs.property "version", project.mod_version
filesMatching("fabric.mod.json") {
expand "version": project.mod_version
}
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
manifest {
attributes([
"Specification-Title" : "${mod_name}",
"Specification-Vendor" : "${maven_group}",
"Specification-Version" : "${mod_version}",
"Implementation-Title" : "${mod_name}",
"Implementation-Version" : "${mod_version}",
"Implementation-Vendor" : "${maven_group}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs" : "${mod_name}.mixins.json"
])
}
}
modrinth {
projectId = project.modrinth_project
uploadFile = remapJar
versionName = "${project.mod_version} for Minecraft ${project.minecraft_version}"
gameVersions = ["${project.minecraft_version}"]
dependencies {
required.project "fabric-api"
}
}
task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
apiToken = findProperty('CF_TOKEN')
def projectId = project.cf_project
def mainFile = upload(projectId, remapJar)
mainFile.displayName = "${project.mod_version} for Minecraft ${project.minecraft_version}"
mainFile.addModLoader("Fabric")
mainFile.addGameVersion("${project.minecraft_version}")
mainFile.addRequirement("fabric-api")
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
if (System.getenv("MAVEN_PASS") != null) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = System.getenv("MAVEN_PASS")
}
}
}
}
}