-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
67 lines (57 loc) · 1.64 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
import org.apache.tools.ant.taskdefs.condition.Os
repositories {
mavenCentral()
}
apply plugin: 'java'
// project level config
sourceSets.main.java.srcDir 'src/main'
sourceSets.test.java.srcDir 'src/test'
sourceCompatibility = 1.7
targetCompatibility = 1.7
task fetchDeps(type: Exec) {
description 'Fetch and install LazyLib and GraphicsLib before compilation.'
commandLine 'sh', 'util/fetch-deps.sh'
}
compileJava.dependsOn fetchDeps
build {
doLast {
copy {
from jar
into '.'
}
}
}
task run(type: Exec) {
description 'Run Starsector'
dependsOn build
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
workingDir '../../starsector-core'
commandLine 'cmd', '/c', 'start', 'starsector.bat'
} else {
workingDir '../..'
commandLine 'sh', 'starsector.sh'
}
}
task release(type: Exec) {
description 'Create releaseable zip file.'
commandLine 'sh', 'util/create-release.sh'
}
// nuke everything and start over
clean {
delete fileTree('.') { include '*.jar' }
}
// compile time dependencies for most mods
dependencies {
implementation files('../GraphicsLib/jars/Graphics.jar')
implementation files('../LazyLib/jars/LazyLib.jar')
implementation files('../Nexerelin/jars/ExerelinCore.jar')
// everything in starsector main folder
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
implementation fileTree(dir: '../../starsector-core/', include: ['*.jar'])
} else {
implementation fileTree(dir: '../../', include: ['*.jar'])
}
// Test only
testImplementation 'junit:junit:4.12'
testImplementation 'com.google.truth:truth:0.30'
}