-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
351 lines (259 loc) · 10.4 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
buildscript {
ext {
appName = 'Ore Infinium'
gdxVersion = '1.9.6'
aiVersion = '1.8.1'
artemisVersion = '2.1.0'
artemisContribVersion = '1.2.1'
kryonetVersion = '2.22.0-RC1'
jcommanderVersion = "1.68"
tweenEngineVersion = "6.3.3"
kotlinVersion = '1.1.1'
kotlinCoroutinesVersion = '0.14'
kotlinxJdk8Version = '0.3'
kotlinLoggingVersion = '1.4.4'
junitVersion = '4.12'
joiseVersion = '1.0.1'
visUiVersion = '1.2.5'
ktxVersion = '1.9.6-SNAPSHOT'
protobufGradlePlugin = '0.8.1'
protobufVersion = '3.2.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
jcenter()
repositories {
maven { url "https://kotlin.bintray.com/kotlinx/" }
}
maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1/" }
maven { url "https://dl.bintray.com/heri/frostcode" }
}
dependencies {
// lib for artemis-odb weaving.
// see https://github.com/junkdog/artemis-odb/wiki/Bytecode-weaving
classpath "net.onedaybeard.artemis:artemis-odb-gradle-plugin:$artemisVersion"
// introduces support for provided scope gradle keyword.
//3.0.3 FIXME
//classpath "com.netflix.nebula:gradle-extra-configurations-plugin:$gradleExtraConfigurationsPluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.google.protobuf:protobuf-gradle-plugin:$protobufGradlePlugin"
classpath 'co.riiid:gradle-github-plugin:0.4.2'
classpath "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
//classpath "com.github.czyzby:ktx-tools:$ktxVersion"
}
}
plugins {
id 'nebula.provided-base' version '3.1.0'
//for extracting git sha at deploy time
id "org.ajoberstar.grgit" version "1.7.1"
//run :dependencyUpdates to get a list of updates needed
//gradle versions plugin
id "com.github.ben-manes.versions" version "0.14.0"
id "co.riiid.gradle" version "0.4.2"
}
//hack this is required for kotlin asset source generator or gradle daemon will crash
// https://youtrack.jetbrains.com/issue/KT-17031
// https://github.com/fusesource/jansi/issues/66
// https://github.com/gradle/gradle/issues/778
System.setProperty("kotlin.colors.enabled", "false")
task wrapper(type: Wrapper) {
gradleVersion = "3.2.1"
}
subprojects {
apply plugin: "java"
apply plugin: "kotlin"
//apply plugin: 'ktx.tools.plugin'
//apply plugin: 'ktx.tools.demo.plugin'
//demoSetting {
// message = "Hi from an extension"
//}
kotlin {
experimental {
coroutines "enable"
}
}
compileJava {
sourceCompatibility = '1.8'
}
apply plugin: "eclipse"
configurations.all {
resolutionStrategy {
// failOnVersionConflict()
}
resolutionStrategy.force "net.onedaybeard.artemis:artemis-odb:$artemisVersion"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
//for kryonet
maven { url "http://clojars.org/repo" }
//for universal tween engine
maven { url "https://dl.bintray.com/heri/frostcode/" }
maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1/" }
}
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
}
import com.badlogic.gdx.tools.texturepacker.TexturePacker
import org.ajoberstar.grgit.Grgit
// Import the texture packer
//todo duped in desktop gradle
def getVersion = '0.1'
def date = new Date()
def formattedDate = date.format("yyyyMMdd-HHmmss-")
def getJarFile = { ->
def tree = fileTree('desktop/build/libs/') { include '**/*.jar' }
if (tree.files.empty) {
return ""
}
println(tree.first().path)
return tree.first().path
}
def getSha() {
return Grgit.open(project.file('.')).head().getAbbreviatedId()
}
//todo share this between here and desktop..waiting on gradle-script-kotlin port, i think
def getDate() {
def date = new Date()
def formattedDate = date.format("yyyyMMdd-HHmmss-")
formattedDate += getSha()
return formattedDate
}
project(":desktop") {
apply plugin: "java"
github {
owner = 'sreich'
repo = 'ore-infinium'
token = System.getenv("GITHUB_TOKEN") ?: "xxxxxxxxx"
tagName = "jenkins-${getDate()}"
targetCommitish = 'master'
name = getVersion + '-' + getDate()
prerelease = true
body = """# Ore Infinium
#### Automatic snapshot build
"""
assets = [getJarFile()]
}
// apply plugin: "com.google.protobuf"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
}
// sourceSets {
// run the annotation processor compile time.
// main {
// compileClasspath = files(configurations.provided)
// proto {
// srcDir 'core/src/com/ore/infinium/proto'
// srcDir 'proto/'
// include '**/*.proto'
// }
// }
// }
project(":core") {
apply plugin: "java"
apply plugin: "idea"
apply plugin: "com.google.protobuf"
// Add a new task that packs the textures for you
task("packTextures") {
logger.info "Calling TexturePacker root outputdir ${projectDir}"
TexturePacker.process("${projectDir}/assets/tiles", "${projectDir}/assets/packed", "tiles")
TexturePacker.process("${projectDir}/assets/blocks", "${projectDir}/assets/packed", "blocks")
TexturePacker.process("${projectDir}/assets/ui", "${projectDir}/assets/packed", "ui")
TexturePacker.process("${projectDir}/assets/entities", "${projectDir}/assets/packed", "entities")
TexturePacker.process("${projectDir}/assets/backgrounds", "${projectDir}/assets/packed", "backgrounds")
}
configurations {
provided
}
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
downloadJavadoc = true
downloadSources = true
}
}
sourceSets {
// run the annotation processor compile time.
main {
//compileClasspath = files(configurations.provided)
proto {
srcDir 'src/com/ore/infinium/proto'
}
//NOTE this is also added to source set in core/build.gradle
}
}
compileKotlin {
dependsOn(':core:generateProto')
}
dependencies {
// kotlin
//compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
compile "org.jetbrains.kotlinx:kotlinx-support-jdk8:$kotlinxJdk8Version"
compile "io.github.microutils:kotlin-logging:$kotlinLoggingVersion"
// compile "org.slf4j:slf4j-log4j12:1.7.25"
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.8.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
// libgdx core
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
//libgdx addons
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-ai:$aiVersion"
compile "com.kotcrab.vis:vis-ui:$visUiVersion"
//junit
testCompile "junit:junit:$junitVersion"
testCompile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
// kryonet
compile "com.esotericsoftware:kryonet:$kryonetVersion"
//artemis-odb
compile "net.onedaybeard.artemis:artemis-odb:$artemisVersion"
// Artemis-odb bonus functionality (systems, events, components).
compile "net.mostlyoriginal.artemis-odb:contrib-core:$artemisContribVersion"
// jcommander for command line parsing
compile "com.beust:jcommander:$jcommanderVersion"
//junit
testCompile "junit:junit:$junitVersion"
//universal tween engine
compile "com.aurelienribon:tween-engine-api:$tweenEngineVersion"
compile "com.sudoplay.joise:joise:$joiseVersion"
compile "com.google.protobuf:protobuf-java:$protobufVersion"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"
compile "com.esotericsoftware.minlog:minlog:1.2-slf4j-jdanbrown-0"
compile "com.github.czyzby:ktx-vis:$ktxVersion"
compile "com.github.czyzby:ktx-vis-style:$ktxVersion"
compile "com.github.czyzby:ktx-style:$ktxVersion"
compile "com.github.czyzby:ktx-scene2d:$ktxVersion"
compile "com.github.czyzby:ktx-math:$ktxVersion"
compile "com.github.czyzby:ktx-i18n:$ktxVersion"
compile "com.github.czyzby:ktx-assets:$ktxVersion"
compile "com.github.czyzby:ktx-app:$ktxVersion"
compile "com.github.czyzby:ktx-actors:$ktxVersion"
//compile "com.github.czyzby:ktx-tools:$ktxVersion"
//compile project(":core:packTextures")
}
protobuf {
protoc {
// download the artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:3.1.0"
}
//generatedFilesBaseDir = "$buildDir/generated/source/proto"
}
}
}