-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
139 lines (108 loc) · 3.75 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
buildscript {
repositories {
maven { url = "https://files.minecraftforge.net/maven" }
maven { url = "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath group: "net.minecraftforge.gradle", name: "ForgeGradle", version: "5.1.+", changing: true
classpath "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
}
}
plugins {
id 'maven-publish'
}
apply plugin: "java"
apply plugin: "net.minecraftforge.gradle"
apply plugin: "com.github.johnrengelman.shadow"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
archivesBaseName = archivesBaseName = "${mod_id}-${mc_version}-${mod_version}"
repositories {
// Put remote maven repositories here
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
minecraft {
mappings channel: "official", version: "${mc_version}"
accessTransformer = file("src/main/resources/META-INF/accesstransformer.cfg")
runs {
client {
workingDirectory project.file("run")
mods { twitchmod { source sourceSets.main } }
}
server {
workingDirectory project.file("run")
mods { twitchmod { source sourceSets.main } }
}
}
}
configurations {
library
implementation.extendsFrom library
shadow.extendsFrom library
}
minecraft.runs.all {
lazyToken('minecraft_classpath') {
configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
}
}
dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
// Twitch4J chat module only
library(group: 'com.github.twitch4j', name: 'twitch4j-chat', version: '1.9.0') {
exclude group: "commons-lang"
exclude group: "org.slf4j"
exclude group: "io.github.openfeign"
}
// JDA without audio
library(group: "net.dv8tion", name: "JDA", version: "5.0.0-alpha.9") {
transitive = true
exclude module: "opus-java"
exclude group: "org.slf4j"
}
library(group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.10')
implementation('cpw.mods:securejarhandler') { version { strictly '0.9.45' } }
// Configured mod for config screen
// implementation('curse.maven:configured-457570:3640884')
// implementation('curse.maven:catalogue-459701:3559402')
}
shadowJar {
classifier ''
configurations = [project.configurations.shadow]
dependencies {
exclude(dependency("org.jetbrains:annotations"))
exclude(dependency("com.google.code.findbugs:jsr305"))
}
}
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "repack" // Default value is "shadow"
}
reobf {
shadowJar {
dependsOn createMcpToSrg
mappings = createMcpToSrg.output
}
}
jar {
manifest {
attributes([
"Specification-Title" : "${archivesBaseName}",
"Specification-Vendor" : "${author}",
"Specification-Version" : "${mod_version}",
"Implementation-Title" : "${archivesBaseName}",
"Implementation-Version" : "${mod_version}",
"Implementation-Vendor" : "${author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar
tasks.assemble.dependsOn shadowJar