forked from azagniotov/stubby4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (98 loc) · 3.72 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
// vim: ft=groovy
defaultTasks 'clean', 'build'
description = 'Gradle configuration for stubby4j'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.2'
}
}
def totalTestCounter = 0
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
project.buildDir = 'target'
if (project.name != 'main') {
tasks.withType(Test) {
Task testTask ->
def totalSuiteCount = 0
def successSuiteCount = 0
testReport = false
testLogging {
events /*"passed", */"skipped", "failed"
exceptionFormat "full"
showExceptions true
showCauses true
showStackTraces true
}
doFirst {
//println ""
//println "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
//println "::::: Running " + project.name.toUpperCase() + " module tests"
//println "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
}
afterSuite { testDescriptor, testResult ->
if (testDescriptor.getName().contains("$stubbyProjectGroup")) {
totalSuiteCount += testResult.getTestCount()
totalTestCounter += testResult.getTestCount()
successSuiteCount += testResult.getSuccessfulTestCount()
}
}
doLast {
println ""
println "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
println "::::: Ran " + project.name.toUpperCase() + " module tests"
println "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
println "::::: Passed (" + successSuiteCount + "/" + totalSuiteCount + ") tests"
println "::::: Total tests executed in $stubbyProjectName project so far " + totalTestCounter
println "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
println ""
}
}
}
}
apply from: "$rootDir/conf/gradle/ides.gradle"
subprojects {
subproject ->
sourceCompatibility = 1.6
tasks.withType(Compile) {
doFirst {
assert sourceCompatibility == "1.6": "The sourceCompatibility of $name was changed!"
}
options.encoding = 'UTF-8'
}
targetCompatibility = 1.6
repositories {
mavenCentral()
mavenLocal()
}
apply from: "$rootDir/conf/gradle/dependencies.gradle"
if (subproject.name != 'main' && subproject.name != 'builders') {
apply from: "$rootDir/conf/gradle/cobertura.gradle"
}
}
project(":").tasks.each {
task ->
def taskNameLowerCase = task.name.toLowerCase()
if (!taskNameLowerCase.contains("idea") &&
!taskNameLowerCase.contains("eclipse") &&
!taskNameLowerCase.contains("clean")) {
task.enabled = false
println ":" + task.name + " => Disabling task.."
}
}
def projects = [project(":unit"), project(":integration"), project(":functional") ]
projects.each {
project ->
project.tasks.each {
task ->
def taskNameLowerCase = task.name.toLowerCase()
if (taskNameLowerCase.contains("jar")) {
task.enabled = false
println ":" + project.name + ":" + task.name + " => Disabling task.."
}
}
}