forked from MovingBlocks/Terasology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (98 loc) · 2.34 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
/*
* This is a Gradle build file:
* - Gradle Homepage: http://gradle.org/
* - Gradle Installation: http://gradle.org/installation
* - View tasks for this project: $ gradle tasks
*/
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
idea {
project {
jdkName = '1.6'
}
}
sourceCompatibility = 1.5
//version = '0.5.0' //TODO: Disabled version tagging until we actually have something solid to do with it (was breaking old artifact links)
buildDir = 'out'
task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-8a'
}
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDir 'src' }
}
test {
java { srcDir 'tests' }
}
}
repositories {
mavenCentral()
}
dependencies{
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.8.2'
compile fileTree(dir: 'libs', include: '*.jar', exclude: 'mockito-all-1.9.0.jar')
testCompile 'junit:junit:4.10'
}
task copyResources(type:Copy) {
description = 'Copies resources into build directory.'
from('src') {
exclude '**/*.java'
exclude '**/*.groovy'
}
into('out/classes/main')
}
jar {
dependsOn compileGroovy
dependsOn copyResources
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes("Main-Class": "org.terasology.game.Terasology", "Manifest-Version": "1.0")
}
archiveName('Terasology.jar')
}
jar.doLast {
ant.signjar(jar: jar.archivePath, keystore: 'applet/tera.keystore', alias: 'Terasology', storepass: 'Terasology')
}
task dist(type:Copy) {
description = 'Creates a fully-functional game folder.'
dependsOn jar
from('.') {
include 'natives/**'
include 'groovy/**'
include 'README.markdown'
include 'LICENSE.txt'
}
from('scripts') {
exclude('Launcher.xml')
}
from(jar.archivePath)
into('out/dist')
}
task zip(type:Zip) {
description = 'Creates a fully-functionional game archive.'
dependsOn dist
from('out/dist')
into('Terasology')
destinationDir = buildDir
}
task applet(type:Copy) {
description = 'Creates a game distribution playable through a browser.'
dependsOn jar
from('applet') {
exclude '*.keystore'
}
from(jar.archivePath)
into('out/applet')
}
task run(type:JavaExec) {
description = 'Run Terasology'
dependsOn compileGroovy
dependsOn copyResources
main = 'org.terasology.game.Terasology'
classpath = sourceSets.main.runtimeClasspath
}