-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
61 lines (47 loc) · 1.26 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
group 'md.leonis.spacetrader'
version "3.51.225"
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.spockframework:spock-core:1.2-groovy-2.5'
}
compileJava.doFirst {
new File("$projectDir/src/main/resources/version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p.store w, null
}
delete fileTree("$projectDir/build/libs") {
include '*.jar'
}
}
jar {
manifest {
attributes(
'Main-Class': 'spacetrader.SpaceTraderApp'
)
}
}
jar.doLast {
def gameName = "space-trader"
def jarFileName = "$gameName-${version}.jar"
def batFileName = "${gameName}.bat"
new File("$projectDir/${batFileName}").text = "java -jar ${jarFileName}"
def firstLetter = version.toString()[0]
delete fileTree(projectDir) {
include "$gameName-$firstLetter*.jar"
}
println "chmod 755 add ${batFileName}".execute().text
copy {
from "build/libs"
into projectDir
}
println "git add ${batFileName}".execute().text
println "git add ${jarFileName}".execute().text
}