This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
202 lines (185 loc) · 7.24 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = 'minecraft'
url = 'https://libraries.minecraft.net/'
}
maven {
name = 'apache'
url = 'https://repo.maven.apache.org/maven2/'
}
maven {
name = 'spigotmc-public'
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle.patcher'
group = 'gg.skylight'
version = 'git rev-parse --short HEAD'.execute().text.trim()
repositories {
clear()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = 'minecraft'
url = 'https://libraries.minecraft.net/'
}
maven {
name = 'apache'
url = 'https://repo.maven.apache.org/maven2/'
}
maven {
name = 'spigotmc-public'
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
}
}
sourceSets {
skylight.java.srcDirs = ['src/main/java', 'projects/Skylight/src/main/java']
}
minecraft.version = "1.12.2"
minecraft {
mappings = 'snapshot_nodoc_20171003'
workspaceDir = "projects"
versionJson = "resources/jsons/${minecraft.version}-dev.json"
buildUserdev = false
buildInstaller = false
installerVersion = "1.5"
def common = {
patchPrefixOriginal "../src-base/minecraft"
patchPrefixChanged "../src-work/minecraft"
/*mainClassClient "net.minecraft.launchwrapper.Launch"
tweakClassClient "net.minecraftforge.fml.common.launcher.FMLTweaker"*/
mainClassServer "net.minecraft.launchwrapper.Launch"
tweakClassServer "net.minecraftforge.fml.common.launcher.FMLServerTweaker"
}
projects {
skylight {
rootDir "."
patchDir "patches/"
patchAfter "clean"
genPatchesFrom "clean"
genMcpPatches = true
applyMcpPatches = true
s2sKeepImports = true
//dchImports = true
//ignoreWhiteSpaces = false
with common
}
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
tasks.compileJava.enabled = false
tasks.reobfuscate.setProperty("extraSrg",["PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_12_R1"])
dependencies {
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile 'com.mojang:patchy:1.1'
compile 'oshi-project:oshi-core:1.1'
compile 'net.java.dev.jna:jna:4.4.0'
compile 'net.java.dev.jna:platform:3.4.0'
compile 'com.ibm.icu:icu4j-core-mojang:51.2'
compile 'net.sf.jopt-simple:jopt-simple:5.0.3'
compile 'com.paulscode:codecjorbis:20101023'
compile 'com.paulscode:codecwav:20101023'
compile 'com.paulscode:libraryjavasound:20101123'
compile 'com.paulscode:librarylwjglopenal:20100824'
compile 'com.paulscode:soundsystem:20120107'
compile 'io.netty:netty-all:4.1.24.Final'
compile 'com.google.guava:guava:21.0'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'commons-io:commons-io:2.5'
compile 'commons-codec:commons-codec:1.10'
compile 'net.java.jinput:jinput:2.0.5'
compile 'net.java.jutils:jutils:1.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.mojang:authlib:1.5.25'
compile 'com.mojang:realms:1.10.21'
compile 'org.apache.commons:commons-compress:1.8.1'
compile 'org.apache.httpcomponents:httpclient:4.3.3'
compile 'commons-logging:commons-logging:1.1.3'
compile 'org.apache.httpcomponents:httpcore:4.3.2'
compile 'it.unimi.dsi:fastutil:7.1.0'
compile 'org.apache.logging.log4j:log4j-api:2.8.1'
compile 'org.apache.logging.log4j:log4j-core:2.8.1'
compile 'org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209'
compile 'org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209'
compile 'com.mojang:text2speech:1.10.3'
compile 'net.minecraft:launchwrapper:1.12'
compile 'org.jline:jline:3.5.1'
compile 'org.ow2.asm:asm-debug-all:5.2'
compile 'com.typesafe.akka:akka-actor_2.11:2.3.3'
compile 'com.typesafe:config:1.3.1'
compile 'lzma:lzma:0.0.1'
compile 'java3d:vecmath:1.5.2'
compile 'net.sf.trove4j:trove4j:3.0.3'
compile 'org.apache.maven:maven-artifact:3.5.3'
compile 'org.yaml:snakeyaml:1.19'
compile 'com.googlecode.json-simple:json-simple:1.1.1'
compile 'commons-lang:commons-lang:2.6' // Is needed for plugin compatibility
compile 'net.md-5:SpecialSource:1.8.0'
compile 'org.xerial:sqlite-jdbc:3.21.0.1'
compile 'mysql:mysql-connector-java:5.1.45'
compile 'net.md-5:bungeecord-chat:1.12-SNAPSHOT'
compile 'org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2'
compile 'org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2'
compile 'org.scala-lang:scala-actors-migration_2.11:1.1.0'
compile 'org.scala-lang:scala-compiler:2.11.1'
compile 'org.scala-lang:scala-library:2.11.1'
compile 'org.scala-lang:scala-parser-combinators_2.11:1.0.1'
compile 'org.scala-lang:scala-reflect:2.11.1'
compile 'org.scala-lang:scala-swing_2.11:1.0.1'
compile 'org.scala-lang:scala-xml_2.11:1.0.2'
}
outputJar {
classifier = 'universal'
manifest.attributes([
"Implementation-Title": rootProject.name,
"Implementation-Version": "SkyLight-reboot-" + minecraft.version + "-" + version,
"Main-Class": "catserver.server.CatServerLaunch",
"TweakClass": "net.minecraftforge.fml.common.launcher.FMLTweaker",
"Class-Path": file("src/main/resources/libraries.info").readLines().collect{ it.split("\\|")[0] }.join(" ")
])
}
processJson {
releaseJson = "resources/jsons/${minecraft.version}-rel.json"
addReplacements([
"@minecraft_version@": project.minecraft.version,
"@version@": project.version,
"@project@": "SkyLight-reboot",
"@universal_jar@": { outputJar.archiveName },
"@timestamp@": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
extractSkylightSources { exclude "**/SideOnly.java", "**/Side.java" }
extractSkylightResources { exclude "**/log4j2.xml" }
genGradleProjects {
addRepo('forge', 'http://files.minecraftforge.net/maven/')
addRepo('apache', 'https://repo.maven.apache.org/maven2/')
addRepo('spigotmc-public', 'https://hub.spigotmc.org/nexus/content/groups/public/')
configurations.compile.resolvedConfiguration.resolvedArtifacts.collect { addCompileDep(it.moduleVersion.id.toString()) }
addTestCompileDep "junit:junit:4.12" // TODO update unit tests to junit 5 and remove this
addTestCompileDep "org.junit.jupiter:junit-jupiter-api:5.0.0"
addTestCompileDep "org.opentest4j:opentest4j:1.0.0" // needed for junit 5
addTestCompileDep "org.hamcrest:hamcrest-core:1.3"
filter { dep -> !dep.contains("scala") }
}
cleanBuildDir()
static cleanBuildDir() {
for (File file : new File("build/distributions").listFiles()) file.delete()
for (File file : new File("build/libs").listFiles()) file.delete()
}