-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
151 lines (125 loc) · 4.94 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
buildscript {
ext.kotlin_version = '1.7.10'
ext.lwjglVersion = "3.0.0a"
ext.gdxVersion = '1.9.8'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'edu.sc.seis.gradle:launch4j:2.4.6'
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "1.7.10"
id 'idea'
id 'application'
}
version '0.5.0'
idea {
module {
downloadJavadoc = true // defaults to false
downloadSources = true
}
}
subprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://clojars.org/repo/" }
}
apply plugin: "application"
apply plugin: "org.jetbrains.kotlin.jvm"
apply plugin: 'edu.sc.seis.launch4j'
dependencies {
implementation "com.esotericsoftware:kryo:5.0.0-RC4"
implementation "com.esotericsoftware:kryonet:2.22.0-RC1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'com.adonax:audiocue:2.0.0'
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
}
}
project(":client") {
dependencies {
implementation project(":shared")
}
evaluationDependsOn(":shared")
mainClassName = "main.GameKt"
launch4j {
mainClassName = "main.GameKt"
}
jar {
manifest {
attributes 'Main-Class': 'main.GameKt'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
sourceSets {
main {
kotlin.srcDirs += project(":shared").sourceSets.main.kotlin.srcDirs
resources.srcDirs += project(":shared").sourceSets.main.resources.srcDirs
}
}
}
project(":server") {
dependencies {
implementation project(":shared")
}
evaluationDependsOn(":shared")
mainClassName = "network.ServerKt"
launch4j {
mainClassName = "network.ServerKt"
}
jar {
manifest {
attributes 'Main-Class': 'network.ServerKt'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
sourceSets {
main {
kotlin.srcDirs += project(":shared").sourceSets.main.kotlin.srcDirs
resources.srcDirs += project(":shared").sourceSets.main.resources.srcDirs
}
}
}
//task jpackage(type: Exec) { //exec tasks=command line tasks
// project(":client") { // go inside of the client project
// doFirst() {
// project.delete("${buildDir}/distribution/powerworks") // delete results of last bundling
// }
// workingDir project.projectDir // set cmd line working directory to the project dir
// def commands = [ //new list of cmd arguments, will be separated by spaces
// "${project.projectDir}/jdk-15.0.1/bin/jpackage", // first, the command itself. jpackage.exe is located in jdk/bin
// '--type', 'app-image', // select app-image here to just create the runnable file, otherwise it defaults to runnable installer
// '--dest', "${buildDir}/distribution", // destination for files
// '--input', "${buildDir}/libs", // this should be the folder containing just the game's jar file
// '--name', 'powerworks', // name of app
// '--main-class', project.mainClassName, // references the project's main class, if you don't set this above somewhere just add it manually
// '--main-jar', jar.archiveFile.get().asFile.getName(), //references the jar task, this can also be set manually
// ]
// if (osName.contains('windows')) { //just platform specific icon stuff and the mac xstartonfirstthread
// commands << '--icon'
// commands << "${project.projectDir}/logo.ico"
// } else if (osName.contains('linux')) {
// commands << '--icon'
// commands << "${project.projectDir}/logo.png"
// } else if (osName.contains('mac')) {
// commands << '--icon'
// commands << "${project.projectDir}/logo.icns"
// commands << '--java-options'
// commands << "-XstartOnFirstThread"
// }
//
// commandLine = commands // this is what actually executes the command
// }
//}