forked from henkelmax/status
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
133 lines (116 loc) · 3.71 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
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.modrinth.minotaur' version '2.+'
id 'mod-update' version '2.0.0'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = archives_base_name
version = mod_version
group = maven_group
repositories {
mavenLocal()
mavenCentral()
maven { url = 'https://maven.fabricmc.net/' }
maven { url = 'https://maven.maxhenkel.de/repository/public'}
}
runClient.doFirst {
args = ['--username', "henkelmax${new Random().nextInt(1000)}"]
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation "de.maxhenkel.configbuilder:configbuilder:${configbuilder_version}"
shadow "de.maxhenkel.configbuilder:configbuilder:${configbuilder_version}"
implementation 'com.google.code.findbugs:jsr305:3.0.2'
}
processResources {
filesMatching('fabric.mod.json') {
expand 'version': version,
'minecraft_dependency': minecraft_dependency,
'loader_version': loader_version,
'fabric_version': fabric_version,
'compatibility_version': mod_compatibility_version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 17
}
java {
withSourcesJar()
}
jar {
from('LICENSE') {
rename { "${it}_${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 = release_type
addGameVersion curseforge_minecraft_version
addGameVersion 'Fabric'
addGameVersion 'Java 17'
mainArtifact(file("${buildDir}/libs/${archivesBaseName}-${version}.jar")) {
displayName = "[FABRIC][${minecraft_version}] ${mod_name} ${mod_version}"
relations {
requiredDependency 'fabric-api'
}
}
afterEvaluate {
uploadTask.dependsOn(remapJar)
}
}
options {
forgeGradleIntegration = false
}
}
tasks.modrinth.configure({
group = 'upload'
})
tasks.modrinthSyncBody.configure({
group = 'upload'
})
modrinth {
token = file("${rootDir}/modrinth_token.txt").exists() ? file("${rootDir}/modrinth_token.txt").text : ''
projectId = modrinth_id
versionNumber = "fabric-${mod_version}"
versionName = "[FABRIC][${minecraft_version}] ${mod_name} ${mod_version}"
uploadFile = remapJar
versionType = release_type.toUpperCase()
changelog = file('changelog.md').text
gameVersions = [minecraft_version]
loaders = ['fabric']
dependencies {
required.project 'P7dR8mSH' // Fabric API
}
syncBodyFrom = file("${rootDir}/readme.md").text
}
tasks.modrinth.dependsOn(build)
modUpdate {
serverURL = 'https://update.maxhenkel.de/'
modID = mod_id
gameVersion = minecraft_version
modLoader = 'fabric'
modVersion = mod_version
changelogFile = file('changelog.md')
releaseType = release_type
tags = recommended == 'true' ? ['recommended'] : []
}
shadowJar {
configurations = [project.configurations.shadow]
archiveClassifier = 'shadow-dev'
relocate 'de.maxhenkel.configbuilder', "de.maxhenkel.${mod_id}.configbuilder"
}
remapJar {
dependsOn shadowJar
inputFile = shadowJar.archiveFile.get()
}