Skip to content

Commit 2f85b2b

Browse files
committed
Update Gradle again and apply some tweaks to get Android working with newer Gradle. Moves around some code analytics as well.
1 parent 325cbb8 commit 2f85b2b

File tree

5 files changed

+128
-105
lines changed

5 files changed

+128
-105
lines changed

build.gradle

Lines changed: 10 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -13,113 +13,29 @@ buildscript {
1313
import org.ajoberstar.gradle.git.tasks.*
1414

1515
allprojects {
16-
apply plugin: 'java'
1716
apply plugin: 'eclipse'
1817
apply plugin: 'idea'
19-
apply plugin: 'project-report'
20-
apply plugin: 'checkstyle'
21-
apply plugin: 'pmd'
22-
apply plugin: 'findbugs'
23-
24-
// Computes code coverage of (unit) tests
25-
apply plugin: 'jacoco'
26-
27-
dependencies {
28-
checkstyle('com.puppycrawl.tools:checkstyle:6.5')
29-
pmd('net.sourceforge.pmd:pmd-core:5.3.3')
30-
pmd('net.sourceforge.pmd:pmd-java:5.3.3')
31-
// the FindBugs version is set in the configuration
32-
}
3318

3419
version = '1.4.0'
3520
ext {
3621
appName = 'DestinationSol'
3722
gdxVersion = '1.7.0'
3823
roboVMVersion = '1.8.0'
3924
}
25+
}
4026

41-
repositories {
42-
// Good ole Maven central
43-
mavenCentral()
44-
45-
// Repos for LibGDX
46-
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
47-
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
48-
49-
// Terasology Artifactory for any shared libs
50-
maven { url "http://artifactory.terasology.org/artifactory/virtual-repo-live" }
51-
}
52-
test {
53-
// ignoreFailures: Specifies whether the build should break when the verifications performed by this task fail.
54-
ignoreFailures = true
55-
56-
// showStandardStreams: makes the standard streams (err and out) visible at console when running tests
57-
testLogging.showStandardStreams = true
58-
59-
// Arguments to include while running tests
60-
jvmArgs '-Xms512m', '-Xmx1024m'
61-
62-
jacoco {
63-
append = false
64-
}
65-
}
66-
67-
jacoco {
68-
toolVersion = "0.7.4.201502262128"
69-
}
70-
71-
jacocoTestReport {
72-
dependsOn test // Despite doc saying this should be automatic we need to explicitly add it anyway :-(
73-
reports {
74-
// We only use the .exec report for display in Jenkins and such. More could be enabled if desired.
75-
xml.enabled false
76-
csv.enabled false
77-
html.enabled false
78-
}
79-
}
80-
81-
// The config files here work in both a multi-project workspace (IDEs, running from source) and for solo module builds
82-
// Solo module builds in Jenkins get a copy of the config dir from the engine harness so it still lives at root/config
83-
// TODO: Maybe update other projects like modules to pull the zipped dependency so fewer quirks are needed in Jenkins
84-
checkstyle {
85-
ignoreFailures = true
86-
configFile = new File(rootDir, 'config/metrics/checkstyle/checkstyle.xml')
87-
configProperties.samedir = checkstyle.configFile.parentFile
88-
}
89-
90-
pmd {
91-
ignoreFailures = true
92-
ruleSetFiles = files("$rootDir/config/metrics/pmd/pmd.xml")
93-
// By default, gradle uses both ruleset file AND the rulesets. Override the ruleSets to use only those from the file
94-
ruleSets = []
95-
}
96-
97-
findbugs {
98-
ignoreFailures = true
99-
toolVersion = '3.0.1'
100-
excludeFilter = new File(rootDir, "config/metrics/findbugs/findbugs-exclude.xml")
101-
}
27+
repositories {
28+
// Good ole Maven central
29+
mavenCentral()
10230

103-
// TODO: Temporary until javadoc has been fixed for Java 8 everywhere
104-
javadoc {
105-
failOnError = false
106-
}
31+
// Repos for LibGDX
32+
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
33+
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
10734

108-
tasks.withType(Checkstyle) {
109-
group = 'Reporting'
110-
}
111-
112-
tasks.withType(Pmd) {
113-
group = 'Reporting'
114-
}
115-
tasks.withType(FindBugs) {
116-
group = 'Reporting'
117-
reports {
118-
xml.enabled = false
119-
html.enabled = true
120-
}
121-
}
35+
// Terasology Artifactory for any shared libs
36+
maven { url "http://artifactory.terasology.org/artifactory/virtual-repo-live" }
12237
}
38+
12339
configurations {
12440
codeMetrics
12541
}
@@ -182,12 +98,6 @@ cleanIdea.doLast {
18298
println "Cleaned root - don't forget to re-extract code metrics config! 'gradlew extractConfig' will do so, or 'gradlew idea' (or eclipse)"
18399
}
184100

185-
// Make sure our config file for code analytics get extracted (vulnerability: non-IDE execution of single analytic)
186-
ideaModule.dependsOn rootProject.extractConfig
187-
tasks.eclipse.dependsOn rootProject.extractConfig
188-
check.dependsOn rootProject.extractConfig
189-
190-
191101
task(fetchAndroid, type: GitClone) {
192102
description = 'Git clones the Android facade source from GitHub'
193103

config/gradle/common.gradle

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
apply plugin: 'java'
2+
apply plugin: 'eclipse'
3+
apply plugin: 'idea'
4+
apply plugin: 'project-report'
5+
apply plugin: 'checkstyle'
6+
apply plugin: 'pmd'
7+
apply plugin: 'findbugs'
8+
9+
// Computes code coverage of (unit) tests
10+
apply plugin: 'jacoco'
11+
12+
dependencies {
13+
checkstyle('com.puppycrawl.tools:checkstyle:6.5')
14+
pmd('net.sourceforge.pmd:pmd-core:5.3.3')
15+
pmd('net.sourceforge.pmd:pmd-java:5.3.3')
16+
// the FindBugs version is set in the configuration
17+
}
18+
19+
version = '1.4.0'
20+
ext {
21+
appName = 'DestinationSol'
22+
gdxVersion = '1.7.0'
23+
roboVMVersion = '1.8.0'
24+
}
25+
26+
sourceCompatibility = 1.8
27+
targetCompatibility = 1.8
28+
29+
repositories {
30+
// Good ole Maven central
31+
mavenCentral()
32+
33+
// Repos for LibGDX
34+
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
35+
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
36+
37+
// Terasology Artifactory for any shared libs
38+
maven { url "http://artifactory.terasology.org/artifactory/virtual-repo-live" }
39+
}
40+
41+
test {
42+
// ignoreFailures: Specifies whether the build should break when the verifications performed by this task fail.
43+
ignoreFailures = true
44+
45+
// showStandardStreams: makes the standard streams (err and out) visible at console when running tests
46+
testLogging.showStandardStreams = true
47+
48+
// Arguments to include while running tests
49+
jvmArgs '-Xms512m', '-Xmx1024m'
50+
51+
jacoco {
52+
append = false
53+
}
54+
}
55+
56+
jacoco {
57+
toolVersion = "0.7.4.201502262128"
58+
}
59+
60+
jacocoTestReport {
61+
dependsOn test // Despite doc saying this should be automatic we need to explicitly add it anyway :-(
62+
reports {
63+
// We only use the .exec report for display in Jenkins and such. More could be enabled if desired.
64+
xml.enabled false
65+
csv.enabled false
66+
html.enabled false
67+
}
68+
}
69+
70+
// The config files here work in both a multi-project workspace (IDEs, running from source) and for solo module builds
71+
// Solo module builds in Jenkins get a copy of the config dir from the engine harness so it still lives at root/config
72+
// TODO: Maybe update other projects like modules to pull the zipped dependency so fewer quirks are needed in Jenkins
73+
checkstyle {
74+
ignoreFailures = true
75+
configFile = new File(rootDir, 'config/metrics/checkstyle/checkstyle.xml')
76+
configProperties.samedir = checkstyle.configFile.parentFile
77+
}
78+
79+
pmd {
80+
ignoreFailures = true
81+
ruleSetFiles = files("$rootDir/config/metrics/pmd/pmd.xml")
82+
// By default, gradle uses both ruleset file AND the rulesets. Override the ruleSets to use only those from the file
83+
ruleSets = []
84+
}
85+
86+
findbugs {
87+
ignoreFailures = true
88+
toolVersion = '3.0.1'
89+
excludeFilter = new File(rootDir, "config/metrics/findbugs/findbugs-exclude.xml")
90+
}
91+
92+
// TODO: Temporary until javadoc has been fixed for Java 8 everywhere
93+
javadoc {
94+
failOnError = false
95+
}
96+
97+
tasks.withType(Checkstyle) {
98+
group = 'Reporting'
99+
}
100+
101+
tasks.withType(Pmd) {
102+
group = 'Reporting'
103+
}
104+
tasks.withType(FindBugs) {
105+
group = 'Reporting'
106+
reports {
107+
xml.enabled = false
108+
html.enabled = true
109+
}
110+
}
111+
112+
// Make sure our config file for code analytics get extracted (vulnerability: non-IDE execution of single analytic)
113+
ideaModule.dependsOn rootProject.extractConfig
114+
tasks.eclipse.dependsOn rootProject.extractConfig
115+
check.dependsOn rootProject.extractConfig

desktop/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
apply plugin: "java"
1+
apply from: '../config/gradle/common.gradle'
22

3-
sourceCompatibility = 1.8
43
sourceSets.main.java.srcDirs = [ "src/" ]
54

65
project.ext.mainClassName = "org.destinationsol.desktop.SolDesktop"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip

main/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
apply plugin: "java"
1+
apply from: '../config/gradle/common.gradle'
22

3-
sourceCompatibility = 1.8
43
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
54

65
dependencies {

0 commit comments

Comments
 (0)