forked from nwlongnecker/wpi-suite
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
105 lines (88 loc) · 3.56 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
//Configuration for root project
apply plugin: 'build-dashboard'
//Common config for all WPISuite projects
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
apply plugin: "jacoco"
//Java version 1.7'
//sourceCompatibility = 1.7
repositories {
mavenCentral()
}
//Create a source set for the functional test files
sourceSets {
// Note that just declaring this sourceset creates two configurations.
funcTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
}
//Create dependecy configuration for functional tests, depending on whatever is required for unit tests
//This allows us to specify dependencies only for functional tests
configurations {
funcTestCompile.extendsFrom testCompile
funcTestRuntime.extendsFrom testRuntime
}
dependencies {
compile 'commons-codec:commons-codec:1.7'
compile 'commons-logging:commons-logging:1.1.1'
compile 'org.apache.httpcomponents:httpcore:4.2.2'
compile 'org.apache.httpcomponents:httpclient:4.2.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.1.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.1.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.1.0'
//runtime files('libs/a.jar', 'libs/b.jar')
compile fileTree(dir: rootDir.toString()+'/libs', includes: ['*.jar']) //db4o jar that isn't on Maven, and any other new dependencies placed in the libs directory
testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-core:1.9.5'
}
eclipse{
project{
//Mark as Gradle project for Gradle plugin in case it is installed
natures 'org.springsource.ide.eclipse.gradle.core.nature'
}
classpath{
downloadSources = true
downloadJavadoc = true //This is false otherwise, we love to read JavaDoc to help use understand libraries :)
}
}
test{
ignoreFailures = true //Lets builds pass with failing tests
}
jacoco {
toolVersion = "0.7.1.201405082137"
}
jacocoTestReport {
//Exclude tests from code coverage report
sourceDirectories = files(project.sourceSets.main.allJava.srcDirs)
}
//Using << ensures that the task will not be executed when being evaluated
task initModule << {
description = "Generate the folders required for a WPI-Suite module. Comes with empty files to allow it to be checked into Git"
//group = "Other"
//Create folders that will contain code, with an empty file if they are empty directories, so they can be checked into Git for each directory
project.sourceSets*.java.srcDirs*.each {
it.mkdirs()
if ((it.list() as List).empty){
new File("$it/empty").createNewFile()
}
}
project.sourceSets*.resources.srcDirs*.each {
it.mkdirs()
if ((it.list() as List).empty){
new File("$it/empty").createNewFile()
}
}
}
//Gradle task to run the functional tests
task funcTest(type:Test){
description = "Run integration tests (located in src/funcTest/...)."
testClassesDir = project.sourceSets.funcTest.output.classesDir
classpath = project.sourceSets.funcTest.runtimeClasspath
}
}