This repository has been archived by the owner on Aug 25, 2024. It is now read-only.
forked from The-Aether-Team/Cumulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
151 lines (127 loc) · 4.26 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
140
141
142
143
144
145
146
147
148
149
150
151
plugins {
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '[0.7,0.8)'
id 'org.parchmentmc.librarian.forgegradle' version '[1,2)'
id 'org.moddingx.modgradle.mapping' version '[4,5)'
id 'org.moddingx.modgradle.sourcejar' version '[4,5)' apply false
id 'io.github.0ffz.github-packages' version '[1,2)'
id 'com.matthewprenger.cursegradle' version '[1.4,1.5)'
id 'com.modrinth.minotaur' version '[2,3)'
}
version = "${mc_version}-${mod_version}-forge"
group = 'com.aetherteam.cumulus'
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
apply plugin: 'org.moddingx.modgradle.sourcejar'
minecraft {
mappings channel: 'sugarcane', version: project.mappings
copyIdeResources = true
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
configureEach {
workingDirectory project.file('run')
property "${mod_id}.iside", 'true'
property 'forge.logging.console.level', 'info'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
client {
property 'forge.enabledGameTestNamespaces', mod_id
}
server {
property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}
gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id
}
data {
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/'), '--existing', file('src/generated/resources/')
environment 'target', 'fmluserdevdata'
}
}
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
dependencies {
minecraft "net.minecraftforge:forge:${project.mc_version}-${project.forge_version}"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
repositories {
maven { url = "https://maven.blamejared.com" }
}
tasks.named('jar', Jar).configure {
manifest {
attributes([
"Specification-Title" : project.mod_name,
"Specification-Vendor" : "The Aether Team",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.mod_name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "The Aether Team",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
finalizedBy 'reobfJar'
}
tasks.named(sourceSets.main.compileJavaTaskName) {
outputs.file("${it.temporaryDir}/${it.name}-refmap.json").withPropertyName("mixin refmap")
}
compileJava {
options.incremental = false
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName
artifact jar
artifact sourceJar
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/The-Aether-Team/Cumulus"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
curseforge {
project {
apiKey = System.getenv("CURSEFORGE_TOKEN")
id = "${project.curseforge_id}"
releaseType = "${project.version_type}"
changelog = file("$rootDir/docs/CHANGELOG.md")
changelogType = "markdown"
addGameVersion("${project.mc_version}")
mainArtifact(tasks.jar) {
displayName = "${project.mod_name} - ${version}"
}
}
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "${project.modrinth_id}"
versionNumber = "${version}"
versionType = "${project.version_type}"
versionName = "${project.mod_name} - ${version}"
changelog = new File("$rootDir/docs/CHANGELOG.md").text
uploadFile = tasks.jar
gameVersions = ["${project.mc_version}"]
loaders = ["forge"]
}
mixin {
config "${project.mod_id}.mixins.json"
add sourceSets.main, "${project.mod_id}.refmap.json"
}