-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (82 loc) · 4.15 KB
/
build.gradle
File metadata and controls
100 lines (82 loc) · 4.15 KB
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
apply from: '../config/gradle/common.gradle'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
import org.reflections.Reflections;
import org.reflections.scanners.SubTypesScanner;
import org.reflections.scanners.TypeAnnotationsScanner;
import org.reflections.util.ConfigurationBuilder;
// Dependencies needed for what our Gradle scripts themselves use. It cannot be included via an external Gradle file :-(
buildscript {
repositories {
// External libs - jcenter is Bintray and is supposed to be a superset of Maven Central, but do both just in case
jcenter()
mavenCentral()
}
dependencies {
// Needed for caching reflected data during builds
classpath 'org.reflections:reflections:0.9.10'
classpath 'dom4j:dom4j:1.6.1'
}
}
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
compile(group: 'org.terasology.gestalt', name: 'gestalt-asset-core', version: '7.0.3')
compile(group: 'org.terasology.gestalt', name: 'gestalt-entity-system', version: '7.0.3')
compile(group: 'org.terasology.gestalt', name: 'gestalt-module', version: '7.0.3')
compile(group: 'org.terasology.gestalt', name: 'gestalt-util', version: '7.0.3')
compile "com.github.everit-org.json-schema:org.everit.json.schema:1.11.1"
compile "com.github.marschall:zipfilesystem-standalone:1.0.1"
compile 'dom4j:dom4j:1.6.1'
//TODO inserted by someone who has no idea how the gradle thing works. Inspect whether necessary (for tests). Copied rom desktop build.gradle. May break things with android (maybe)
testCompile "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
testCompile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
testCompile "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
testCompile "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
// Test lib dependencies
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
testCompile group: 'org.jboss.shrinkwrap', name: 'shrinkwrap-depchain-java7', version: '1.1.3'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.9.0'
// Logging
testRuntime group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'
testRuntime group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
}
task cacheReflections {
description = 'Caches reflection output to make regular startup faster. May go stale and need cleanup at times.'
// TODO: The extra "org" qualifier excludes test classes otherwise sucked up in Jenkins, causing issues. Redo later
File dirToReflect = new File(sourceSets.main.output.classesDir, "org")
inputs.files dirToReflect
outputs.file file(sourceSets.main.output.classesDir.toString() + "/reflections.cache")
dependsOn classes
doFirst {
// Without the .mkdirs() we might hit a scenario where the classes dir doesn't exist yet
dirToReflect.mkdirs()
Reflections reflections = new Reflections(new ConfigurationBuilder()
.addUrls(dirToReflect.toURI().toURL())
.setScanners(new TypeAnnotationsScanner(), new SubTypesScanner()))
reflections.save(sourceSets.main.output.classesDir.toString() + "/reflections.cache")
}
}
jar {
// This prevents the assets from being scanned as code files
dependsOn cacheReflections
archiveName = "sol.jar"
doFirst {
copy {
from 'src/SolAppListener.gwt.xml'
into 'build/classes/main'
}
}
}
eclipse.project {
name = appName + "-engine"
}
// Extra details provided for unit tests
test {
// ignoreFailures: Specifies whether the build should break when the verifications performed by this task fail.
ignoreFailures = true
// showStandardStreams: makes the standard streams (err and out) visible at console when running tests
testLogging.showStandardStreams = true
}