-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
139 lines (111 loc) · 3.76 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
plugins {
id "fabric-loom" version "1.9-SNAPSHOT"
id "com.modrinth.minotaur" version "2.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "maven-publish"
}
base.archivesName = project.archives_base_name
version = "${project.mod_version}+${project.minecraft_version}"
group = project.maven_group
repositories {
maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://maven.terraformersmc.com/releases/" }
maven { url = "https://maven.isxander.dev/releases/" }
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
includeFabricApiModule "fabric-api-base"
includeFabricApiModule "fabric-key-binding-api-v1"
includeFabricApiModule "fabric-lifecycle-events-v1"
// Provides the latest farbic-api in dev runtime for mod dependencies
modLocalRuntime "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modApi "dev.isxander:yet-another-config-lib:${project.yacl_config_version}-fabric"
}
def includeFabricApiModule(String moduleName) {
Object dependency = fabricApi.module(moduleName, project.fabric_version)
dependencies.modImplementation(dependency)
dependencies.include(dependency)
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Minecraft 1.20.5 (24w14a) upwards uses Java 21.
it.options.release = 21
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}
jar {
from "LICENSE.txt"
}
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
repositories {
// mavenLocal()
}
}
def ENV = System.getenv()
modrinth {
token = ENV.MODRINTH_TOKEN
projectId = "DIlqwRFH"
versionNumber = "${project.mod_version}+${project.minecraft_version}"
versionName = "v${project.mod_version} (${project.minecraft_version})"
versionType = "release"
changelog = "A changelog can be found at https://github.com/Grayray75/FPS-Display/blob/main/CHANGELOG.md"
uploadFile = remapJar
gameVersions = ["1.21.4"]
loaders = ["fabric", "quilt"]
dependencies {
optional.project "modmenu"
optional.project "cloth-config"
optional.project "yacl"
}
}
curseforge {
if (ENV.CURSEFORGE_TOKEN) {
apiKey = ENV.CURSEFORGE_TOKEN
}
project {
id = "440228"
releaseType = "release"
changelog = "A changelog can be found at https://github.com/Grayray75/FPS-Display/blob/main/CHANGELOG.md"
addGameVersion "1.21.4"
addGameVersion "Fabric"
addGameVersion "Quilt"
addGameVersion "Java 21"
mainArtifact(remapJar) {
displayName = "v${project.mod_version} (${project.minecraft_version})"
relations {
optionalDependency "modmenu"
optionalDependency "cloth-config"
optionalDependency "yacl"
}
}
afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}
options {
forgeGradleIntegration = false
javaVersionAutoDetect = false
}
}