-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathbuild.gradle
79 lines (67 loc) · 2.48 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.mapvine:gradle-cobertura-plugin:1.0'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'cobertura'
apply plugin: 'application'
// group is the groupId
group = 'com.miguno.bootstrap.gtm'
//the default artifactId is the project name, which is per default the directory name of the project
version = '1.0.0-SNAPSHOT'
description = """A bootstrap Java project with gradle, TestNG, Mockito, FEST-Assert 2 and Cobertura for Eclipse and Jenkins"""
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenCentral()
// required to get ReportNG 1.1.3 (central Maven repo has only 1.1.2)
mavenRepo url: "http://clojars.org/repo"
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '13.0.1'
testCompile group: 'org.testng', name: 'testng', version: '6.8'
testCompile group: 'org.uncommons', name: 'reportng', version: '1.1.3'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.0'
testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M8'
// workaround for a known issue with TestNG 6.x: explicitly add Guice (Gradle will fail to run tests otherwise)
testCompile group: 'com.google.inject', name: 'guice', version: '3.0'
}
// ensure that test resources (src/test/resources) are added to CLASSPATH;
// see http://forums.gradle.org/gradle/topics/tests_arent_executed_when_setting_the_test_runtimeclasspath and
// http://gradle.org/docs/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:classpath
sourceSets {
main {
runtimeClasspath = files(output.resourcesDir) + runtimeClasspath
}
test {
runtimeClasspath = files(output.resourcesDir) + runtimeClasspath
}
}
test {
useTestNG() {
suiteXmlBuilder().suite(name: 'gradle-testng-mockito-bootstrap', parallel: 'tests') {
test (name : 'all-tests') {
packages {
'package' (name: 'com.miguno.*')
}
}
}
}
options {
listeners << 'org.uncommons.reportng.HTMLReporter'
listeners << 'org.uncommons.reportng.JUnitXMLReporter'
}
ext.useDefaultListeners = true
ext.workingDirectory = 'build/'
}
// see https://github.com/Mapvine/gradle-cobertura-plugin
cobertura {
format = 'xml'
includes = ['**/*.java']
}
mainClassName = "com.miguno.bootstrap.gtm.BobRoss"