-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
108 lines (95 loc) · 2.95 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
plugins {
id 'maven'
id 'java'
id 'com.jfrog.bintray' version '1.8.0'
id 'net.researchgate.release' version '2.7.0'
}
apply from: 'code-style/codestyle.gradle'
dependencies {
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'
compile 'org.apache.logging.log4j:log4j-api:2.11.0'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.0'
compile 'junit:junit:4.12'
compile 'org.apache.commons:commons-lang3:3.7'
compile 'org.apache.commons:commons-text:1.6'
testCompile 'org.mockito:mockito-all:1.10.19'
}
/*
* Default code for all fixtures below
*/
repositories {
jcenter()
}
group = 'org.testeditor.fixture'
sourceCompatibility = 1.10
targetCompatibility = 1.10
// show standard out during test to see logging output
test.testLogging.showStandardStreams = true
// For a summary of failed tests at the end of test execution.
tasks.withType(Test) {
// a collection to track failedTests
ext.failedTests = []
afterTest { descriptor, result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
String failedTest = "${descriptor.className}::${descriptor.name}"
logger.debug("Adding " + failedTest + " to failedTests...")
failedTests << [failedTest]
}
}
afterSuite { suite, result ->
if (!suite.parent) { // will match the outermost suite
// logs each failed test
if (!failedTests.empty) {
logger.lifecycle("\n\n*************************************************************************************************")
logger.lifecycle("\nFailed tests:")
failedTests.each { failedTest ->
logger.lifecycle("${failedTest}")
}
}
logger.lifecycle("\n*************************************************************************************************\n")
}
}
}
jar {
manifest {
attributes 'Implementation-Title': "${project.group}.${project.name}",
'Implementation-Version': project.version
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
install {
repositories.mavenInstaller {
pom.packaging = 'jar'
}
}
release {
preTagCommitMessage = '[release]'
tagCommitMessage = '[release]'
newVersionCommitMessage = '[release] new version'
tagTemplate = 'v${version}'
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
publish = true
pkg {
repo = 'Fixtures'
name = project.name
userOrg = 'test-editor'
licenses = ['EPL-1.0']
vcsUrl = "https://github.com/test-editor/${project.name}.git"
version {
name = project.version
vcsTag = "v$project.version"
}
websiteUrl = 'http://testeditor.org'
}
}