This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
129 lines (110 loc) · 3.53 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
buildscript {
repositories {
maven { url = 'https://maven.maxhenkel.de/repository/public' }
mavenLocal()
}
dependencies {
classpath group: 'de.maxhenkel.forge-update', name: 'forge-update', version: '1.0.4'
}
}
plugins {
id "fabric-loom" version "0.11-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.github.johnrengelman.shadow" version "7.1.0"
}
apply plugin: 'forge-update'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
repositories {
mavenLocal()
mavenCentral()
maven { url = 'https://maven.maxhenkel.de/repository/public' }
maven { url = "https://maven.fabricmc.net/" }
}
runClient.doFirst {
args = ['--username', "henkelmax${new Random().nextInt(1000)}"]
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation "de.maxhenkel.configbuilder:configbuilder:${configbuilder_version}"
shadow "de.maxhenkel.configbuilder:configbuilder:${configbuilder_version}"
}
processResources {
filesMatching("fabric.mod.json") {
expand "version": project.version,
"minecraft_dependency": project.minecraft_dependency,
"loader_version": project.loader_version,
"fabric_version": project.fabric_version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
curseforge {
apiKey = file('curseforge_api_key.txt').exists() ? file('curseforge_api_key.txt').text : ''
project {
id = curse_id
changelogType = 'markdown'
changelog = file('changelog.md')
releaseType = curse_release_type
addGameVersion curseforge_minecraft_version
addGameVersion "Fabric"
addGameVersion "Java 17"
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
displayName = "[FABRIC][${minecraft_version}] ${mod_name} ${mod_version}"
relations {
requiredDependency 'fabric-api'
}
}
afterEvaluate {
uploadTask.dependsOn(remapJar)
}
}
options {
forgeGradleIntegration = false
}
}
forgeUpdate {
def messages = []
file('changelog.md').eachLine { String line ->
if (line.trim().startsWith('-')) {
messages.add(line.replaceFirst('-', '').trim())
}
}
serverURL = 'https://update.maxhenkel.de/'
apiKey = file('forge_update_api_key.txt').exists() ? file('forge_update_api_key.txt').text : ''
modID = mod_id
gameVersion = minecraft_version
modLoader = "fabric"
modVersion = mod_version
updateMessages = messages
releaseType = curse_release_type
tags = recommended == 'true' ? ['recommended'] : []
}
shadowJar {
configurations = [project.configurations.shadow]
classifier 'shadow-dev'
relocate 'de.maxhenkel.configbuilder', "de.maxhenkel.${mod_id}.configbuilder"
}
prepareRemapJar {
dependsOn shadowJar
}
remapJar {
input = shadowJar.archiveFile.get()
}