-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
119 lines (103 loc) · 3.16 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
import net.darkhax.curseforgegradle.TaskPublishCurseForge
import net.darkhax.curseforgegradle.UploadArtifact
plugins {
id "dev.architectury.loom" version "1.6-SNAPSHOT"
id 'com.modrinth.minotaur' version '2.+'
id 'net.darkhax.curseforgegradle' version '1.1.+'
}
base {
archivesName = "${archives_base_name}"
}
version = "${minecraft_version}-${mod_version}"
group = "${maven_group}"
java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
}
loom {
silentMojangMappingsLicense()
forge {
mixinConfigs = [
"incurable.mixins.json"
]
}
}
repositories {
maven { url 'https://jitpack.io' }
maven {
name 'ParchmentMC'
url 'https://maven.parchmentmc.org'
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
}
//mappings "net.fabricmc:yarn:${minecraft_version}+build.${project.yarn_mappings}:v2"
forge "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release.set(8)
}
java {
withSourcesJar()
}
jar {
manifest {
attributes([
"Implementation-Title" : archives_base_name,
"Implementation-Version" : mod_version,
"Implementation-Vendor" : mod_author,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
String[] supportedGameVersions = new String[]{"${minecraft_version}"}
String currentChangeLog = file("CHANGELOG.md").getText("UTF-8");
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "${archives_base_name}"
versionNumber = "${mod_version}"
uploadFile = remapJar
gameVersions.addAll(supportedGameVersions)
loaders = ["forge"]
versionType = "release"
additionalFiles = [sourcesJar]
changelog.set(currentChangeLog)
}
tasks.register("publishCurseForge", TaskPublishCurseForge) {
apiToken = System.getenv("CURSEFORGE_TOKEN")
disableVersionDetection()
UploadArtifact mainFile = upload(cf_project_id, remapJar)
mainFile.displayName = "${archives_base_name}-${version}"
mainFile.releaseType = "release"
mainFile.changelog = currentChangeLog
mainFile.changelogType = "markdown"
mainFile.addModLoader("Forge")
mainFile.addJavaVersion("Java 17", "Java 8")
mainFile.addGameVersion(supportedGameVersions)
UploadArtifact sourcesFile = mainFile.withAdditionalFile(sourcesJar)
sourcesFile.changelog = currentChangeLog
sourcesFile.changelogType = "markdown"
}