-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
171 lines (147 loc) · 5.04 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
buildscript {
repositories {
mavenCentral()
maven { url = "https://files.minecraftforge.net/maven" }
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.spongepowered:mixingradle:0.7.32'
}
}
//Gradle Plugins
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
id 'java'
id "com.modrinth.minotaur" version "2.1.2"
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin'
//Build variables
group = "lv.id.bonne.vhdiscord"
archivesBaseName = "VaultHuntersDiscordIntegration"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
//Gradle Repositories
repositories {
maven { url 'https://jitpack.io' }
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven { url "https://nexus.vankka.dev/repository/maven-public/" }
maven { url "https://repository.dev.gotan.io/repository/gotan.os/" }
maven { url "https://repo.opencollab.dev/maven-snapshots" }
maven { url "https://repo.opencollab.dev/maven-releases" }
maven {
name = 'sonatype-oss'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
flatDir {
dirs 'libs'
}
maven { url "https://repo.erdbeerbaerlp.de/repository/maven-public/" }
maven { url "https://cursemaven.com" }
}
//Forge
minecraft {
mappings channel: 'official', version: "${project.mcVersion}"
}
//ShadowJar
configurations {
embed
compileOnly.extendsFrom(embed)
}
task release{
}
shadowJar {
archiveClassifier = "${project.mcVersion}"
configurations = [project.configurations.embed]
relocate 'org.slf4j', 'dcshadow.org.slf4j'
}
reobf {
shadowJar {
dependsOn tasks.createMcpToSrg
mappings = tasks.createMcpToSrg.outputs.files.singleFile
}
}
artifacts {
archives tasks.shadowJar
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 5, 'minutes'
}
}
//Dependencies
dependencies {
// ========= Minecraft Forge =============
minecraft "net.minecraftforge:forge:${project.mcVersion}-40.1.61"
//Mixin
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
//DCIntegration-API
compileOnly 'de.erdbeerbaerlp:dcintegration.common:2.5.0'
compileOnly group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'
// Curseforge mod dependencies
implementation fg.deobf("curse.maven:vault-hunters-official-mod-458203:${project.vhVersion}")
implementation fg.deobf("curse.maven:dcintegration-324952:${project.dcintegration}")
implementation fg.deobf("curse.maven:mc2discord-325235:${project.mc2discord}")
implementation fg.deobf("curse.maven:simple-discord-link-bot-forge-fabric-spigot-541320:${project.sdlink}")
}
//Mixin
mixin {
add sourceSets.main, 'mixins.vhdiscord.refmap.json'
config 'mixins.vhdiscord.dcintegration.json'
config 'mixins.vhdiscord.mc2discord.json'
config 'mixins.vhdiscord.sdlink.json'
}
//Manifest attributes
jar {
archiveClassifier = "${project.mcVersion}"
manifest {
attributes([
'Maven-Artifact' : "${project.group}:${project.archivesBaseName}:${project.version}",
'Timestamp' : System.currentTimeMillis(),
"Specification-Title" : "vhdiscord",
"Specification-Vendor" : "vhdiscord",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${project.version}",
"Implementation-Vendor" : "vhdiscord",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'MixinConnector' : 'lv.id.bonne.vhdiscord.config.VHDiscordMixinConnector'
])
}
}
//Curseforge publishing
curseforge {
if (project.hasProperty('curseforge.apikey')) { // $GRADLE_USER_HOME/gradle.properties
apiKey = getProperty("curseforge.apikey")
project {
id = '839602'
changelog = project.changelog
releaseType = project.releaseType.toLowerCase()
addGameVersion "${project.mcVersion}"
mainArtifact(jar) {
displayName = "${project.archivesBaseName}-${project.version}-${project.mcVersion}"
}
relations {
optionalDependency("dcintegration")
optionalDependency("mc2discord")
optionalDependency("sdlink")
requiredDependency("vault-hunters-official-mod")
}
}
}
}
tasks.release.dependsOn(tasks.build, tasks.curseforge)