-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
154 lines (145 loc) · 5.3 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
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.4"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.minecraftforge.gradle'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = '2.0.7'
group = 'de.erdbeerbaerlp.discordrpc' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'discordrpc'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations {
shade
compile.extendsFrom(shade)
}
shadowJar {
classifier = '1.16.4'
configurations = [project.configurations.shade]
exclude 'com/sun/jna/**'
relocate 'com.google', 'drpcshadow.com.google'
relocate 'org.apache.http.entity.mime', 'somesubpackage.org.apache.http.entity.mime'
}
minecraft {
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: '20200723-1.16.1'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
//accessTransformer = file('my_at.cfg')
// default run configurations.
// these can be tweaked, removed, or duplicated as needed.
runs {
client = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'info'
workingDirectory project.file('run').canonicalPath
mods {
discordrpc {
source sourceSets.main
}
}
}
server = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'info'
workingDirectory project.file('run').canonicalPath
mods {
discordrpc {
source sourceSets.main
}
}
}
}
}
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
flatDir {
dirs 'libs'
}
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
}
dependencies {
//Forge
minecraft 'net.minecraftforge:forge:1.16.5-36.0.0'
//Hive MC Libs
shade 'com.github.NukerHD:hive-java-api:1.0-snapshot'
compile 'com.github.NukerHD:hive-java-api:1.0-snapshot'
//DiscordRichPresence lib
shade "com.google.guava:guava:30.1-jre"
shade 'com.github.Vatuu:discord-rpc:1.6.2'
shade 'com.github.Vatuu:discord-rpc-binaries:3.4.0'
//Gui Library
compile 'eguilib:eguilib:1.0.5:1.16'
}
reobf {
shadowJar {
dependsOn tasks.createMcpToSrg
mappings = tasks.createMcpToSrg.outputs.files.singleFile
}
}
artifacts {
archives tasks.shadowJar
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
classifier = "1.16.4"
manifest {
attributes(["Specification-Title": "discordrpc",
"Specification-Vendor": "discordrpc",
"Specification-Version": "2.0",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"discordrpc",
'Target-Platforms': 'win32-x86-64, win32-x86, linux-x86-64, darwin',
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
}
curseforge {
// $GRADLE_USER_HOME/gradle.properties
if (project.hasProperty('curseforge.apikey')) {
apiKey = getProperty("curseforge.apikey")
project {
id = '300569'
changelog = project.changelog
releaseType = 'release'
addGameVersion '1.16.4'
addGameVersion '1.16.5'
mainArtifact(jar) {
displayName = "DiscordRichPresence-$version (MC 1.16.4+)"
}
relations {
requiredDependency 'eguilib'
}
}
}
}
tasks.curseforge.dependsOn(build)