This repository has been archived by the owner on Dec 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
103 lines (83 loc) · 2.51 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
plugins {
id "java"
id "application"
id "com.github.johnrengelman.shadow" version "5.0.0"
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
// JitPack
maven {
url "https://jitpack.io"
}
}
def jlineVersion = "3.11.0"
dependencies {
implementation "org.jline:jline-terminal:$jlineVersion"
implementation "org.jline:jline-terminal-jansi:$jlineVersion"
implementation "org.jline:jline-style:$jlineVersion"
implementation "org.jline:jline-reader:$jlineVersion"
implementation "org.jline:jline-remote-telnet:$jlineVersion"
implementation "com.github.LimeiloN:anscapes:0.7.2"
implementation "com.github.LimeiloN:dynamic-compiler:1.0.0"
implementation "com.google.code.gson:gson:2.8.5"
}
// Define the main class for the application
mainClassName = "lorganisation.projecttbt.Game"
group = "lorganisation"
version = "0.7.0"
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
/*
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
*/
shadowJar {
archiveFileName = "project-tbt.jar"
manifest {
attributes "Main-Class": mainClassName
}
}
task copyScripts(type: Copy) {
from "src/main/dist"
include "*.sh"
include "*.bat"
into "$buildDir/libs"
}
task altConsole(type: Copy) {
from(zipTree("src/main/dist/ConsoleZ.zip")) {
include "*"
}
into "$buildDir/libs"
}
task play(type: Exec) {
dependsOn shadowJar
dependsOn copyScripts
workingDir "$buildDir/libs"
if (System.properties['os.name'].toLowerCase().contains('windows')) {
// Windows
commandLine "C:/Windows/System32/cmd.exe", "/C start cmd /C call start.bat"
} else {
// Unix, for XFCE's terminal only
commandLine "/bin/bash terminal --window --command=\"bash start.sh\" --title=\"Project: TBT\" --hide-menubar --hide-toolbar --hide-borders"
}
}
task experiment(type: Exec) {
dependsOn shadowJar
def mainClass = "lorganisation.projecttbt.experiments.SerializationTest"
//def mainClass = "lorganisation.projecttbt.experiments.FeederTest"
workingDir "$buildDir/libs"
// C:\Windows\System32\cmd.exe /C start cmd /C "echo a && pause"
commandLine "C:/Windows/System32/cmd.exe", "/C start cmd /K java -cp project-tbt.jar $mainClass"
}
/*
clean.doFirst {
delete "temp"
}
*/