This repository has been archived by the owner on Jan 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle
63 lines (50 loc) · 2.1 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
apply plugin: 'java'
println 'Compiling Carbon via Gradle ver. ' + gradle.gradleVersion
sourceCompatibility = '1.7'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
jar {
baseName "Carbon"
}
tasks.build.doLast {
ant.move(todir: "build/classes/main/pretransformedclasses/org/bukkit/craftbukkit/v1_7_R4/inventory/") {
fileset dir: "build/classes/main/org/bukkit/craftbukkit/v1_7_R4/inventory/"
}
ant.move(todir: "build/classes/main/pretransformedclasses/net/minecraft/server/v1_7_R4/") {
fileset dir: "build/classes/main/net/minecraft/server/v1_7_R4/"
}
ant.move(todir: "build/classes/pretransformedclasses/org/bukkit/") {
fileset dir: "build/classes/org/bukkit/"
}
ant.jar destfile:"build/libs/Carbon.jar", basedir: "build/classes/main", includes: "**/*.*", update: true
File export = file('build/libs/Carbon.jar')
File dest = file('dist')
dest.mkdir()
dest.listFiles().each {
it.delete()
}
export.renameTo(new File(dest, "Carbon.jar"))
file('build').delete()
println "Copied Carbon.jar into /dist"
println "Carbon is finished compiling, have a nice day!"
}
file('libs').mkdirs()
ant.get src: 'https://dl.dropboxusercontent.com/u/71299154/carbon/libs/spigotapi.jar', dest: file('libs'), verbose: false, skipexisting: true
ant.get src: 'https://dl.dropboxusercontent.com/u/71299154/carbon/libs/spigotserver.jar', dest: file('libs'), verbose: false, skipexisting: true
repositories {
maven {
url "http://assets.comphenix.net/plugin/repository/everything"
artifactUrls "http://assets.comphenix.net/plugin/repository/everything/com/comphenix/protocol/ProtocolLib-Spigot/3.6.0-SNAPSHOT/ProtocolLib-Spigot-3.6.0-SNAPSHOT.jar"
}
mavenCentral()
}
dependencies {
compile group: 'com.comphenix.protocol', name: 'ProtocolLib-Spigot', version: '3.6.0-SNAPSHOT'
compile files('libs/spigotapi.jar', 'libs/spigotserver.jar')
testCompile group: 'junit', name: 'junit', version: '4.10'
}