-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.gradle
133 lines (113 loc) · 3.93 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 'java'
id 'idea'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id "me.modmuss50.mod-publish-plugin" version "0.8.3"
}
def MT_TOKEN = System.getenv("MODRINTH_TOKEN")
def CF_TOKEN = System.getenv("CURSEFORGE_TOKEN")
base {
archivesName = modid
version = "$modloader-mc$mcversion-v$modversion"
}
java.toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
println "Java: ${System.getProperty 'java.version'}, Gradle Java: ${JavaVersion.current()}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
mappings channel: mappings_channel, version: "$mappings_version"
accessTransformer file('src/main/resources/META-INF/accesstransformer.cfg')
copyIdeResources = true
runs {
configureEach {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
property 'log4j.appender.Console', "org.apache.log4j.ConsoleAppender"
property 'terminal.jline', 'true'
args '--mixin.config', "$modid.$mixin_file_suffix"
arg '--nogui'
mods {
"$modid" {
source sourceSets.main
}
}
}
client {}
server {}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
mixin {
add sourceSets.main, "$modid.$mixin_refmap_suffix"
config "$modid.$mixin_file_suffix"
}
repositories {
maven { url 'https://maven.minecraftforge.net/' }
maven { url 'https://repo.spongepowered.org/maven' }
maven { url 'https://jitpack.io' }
maven { url 'https://www.cursemaven.com'
content {includeGroup 'curse.maven' }
}
}
dependencies {
minecraft "net.minecraftforge:forge:$mcversion-$fgversion"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
//DEPENDENCIES
implementation "com.github.WaterMediaTeam:watermedia:$watermediaversion"
implementation fg.deobf("curse.maven:creativecore-257814:${creativecoreversion}")
}
tasks.processResources.outputs.upToDateWhen { false }
processResources {
filesMatching(['META-INF/*.toml', 'pack.mcmeta', 'resourcepacks/**/pack.mcmeta', "$modid.$mixin_file_suffix".toString()]) {
expand project.properties
}
}
jar {
manifest {
attributes "Specification-Title" : modid
attributes "Specification-Vendor" : modauthor
attributes "Specification-Version" : version
attributes "Implementation-Title" : modname
attributes "Implementation-Version" : version
attributes "Implementation-Vendor" : modauthor
attributes "Implementation-Timestamp" : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
attributes "MixinConfigs" : "$modid.$mixin_file_suffix"
}
exclude('org/valkyrienskies/**')
finalizedBy('reobfJar')
}
publishMods {
file = jar.archiveFile
displayName = "WF-$modloader/mc$mcversion/v$modversion"
type = STABLE
changelog = getChangelogText()
maxRetries = 2
dryRun = false
modLoaders.add(modloader.toLowerCase())
curseforge {
accessToken = CF_TOKEN
projectId = curseforgeid
minecraftVersions.addAll(mcversion)
javaVersions.addAll(JavaVersion.VERSION_17)
clientRequired = true
serverRequired = true
projectSlug = modid
requires("creativecore", "watermedia")
}
modrinth {
accessToken = MT_TOKEN
projectId = modrinthid
minecraftVersions.addAll(mcversion)
requires("creativecore", "watermedia")
}
}
def getChangelogText() {
def result = ""
for (String line: file('CHANGELOG.md').readLines('UTF-8')) {
if (line.isEmpty()) return result
result += line + '\n'
}
return result
}