-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
73 lines (57 loc) · 1.76 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
plugins {
id "com.github.johnrengelman.shadow" version "1.2.2"
id "me.tatarka.retrolambda" version "3.2.2"
}
apply plugin: 'java'
ext.base_version = '0.2.1'
ext.mc_version = '1.10'
archivesBaseName = 'vanilla-irc'
group = 'com.minecraftonline'
version = "${base_version}-${mc_version}"
repositories {
mavenCentral()
}
task downloadMinecraft {
outputs.file "lib/minecraft_server.${mc_version}.jar"
doLast {
outputs.files.singleFile.parentFile.mkdirs()
ant.get src: "https://s3.amazonaws.com/Minecraft.Download/versions/${mc_version}/minecraft_server.${mc_version}.jar", dest: "lib", verbose: true
}
}
configurations {
provided
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
dependencies {
compile 'org.pircbotx:pircbotx:2.0.1'
compile files("lib/minecraft_server.${mc_version}.jar") {
builtBy downloadMinecraft
}
provided 'org.projectlombok:lombok:1.16.+'
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.0-beta9'
}
jar {
manifest {
attributes 'Class-Path': "minecraft_server.${mc_version}.jar",
'Main-Class': 'com.minecraftonline.vanillairc.VanillaIRC',
'Implementation-Title': rootProject.name,
'Implementation-Version': version,
'Implementation-Vendor': '14mRh4X0r'
}
}
task checkClass {
check.dependsOn checkClass
onlyIf { tasks.compileJava.didWork }
doLast {
def nmsFile = sourceSets.main.java.files.getAt(0)
def nmsName = org.apache.commons.io.FilenameUtils.getBaseName(nmsFile.name)
def nmsCheck = /ObfuscationHelper\.setLoginManager\(this, ${nmsName}\.class\);/
if (!(nmsFile.text =~ nmsCheck).find())
throw new RuntimeException("Wrong class name in ${nmsFile}, aborting")
}
}
assemble.dependsOn clean, shadowJar