forked from stagemonitor/stagemonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·112 lines (92 loc) · 2.69 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
110
111
112
/*
* To release a new version, all you have to do is execute 'gradle release'. This is what will happen:
* - all tests are executed locally
* - you will be asked for the version number of the release and the next development (SNAPSHOT) version
* - the gradle release plugin will then tag and push the release to github
* - travis builds and tests the version as always
* - if the build was successful, travis will additionally push the maven artifacts that are generated by the
* maven-publish plugin to the stagemonitor maven repo located at https://github.com/stagemonitor/mvn-repo
*
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.saliman:gradle-cobertura-plugin:2.2.4'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:1.0.2'
classpath 'com.github.townsfolk:gradle-release:1.2'
}
}
repositories {
mavenCentral()
}
apply plugin: 'idea'
apply plugin: 'release'
apply plugin: 'cobertura'
apply plugin: 'com.github.kt3k.coveralls'
subprojects {
configurations {
compileNoLib
compile.extendsFrom compileNoLib
provided
compile.extendsFrom provided
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'cobertura'
group = "org.stagemonitor"
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-all:1.9.5'
}
test.testLogging.exceptionFormat = 'full'
compileJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
options.debug = true
options.debugOptions.debugLevel = "source,lines,vars"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
cobertura {
coverageFormats = []
coverageIgnoreTrivial = true
}
if (!project.name.contains("benchmark")) {
apply from: "$rootDir/gradle/publish-maven.gradle"
}
task copyToLib( type: Copy ) {
into "$buildDir/libs/lib"
from configurations.runtime - configurations.provided - configurations.compileNoLib
}
jar {
manifest {
attributes("Implementation-Version": version)
}
}
}
release {
preTagCommitMessage = 'release '
tagCommitMessage = 'release '
newVersionCommitMessage = 'next development version '
failOnSnapshotDependencies = false // snapshot for caliper is needed in benchmark
}
release.dependsOn test
def getProjectsToTest() {
subprojects.findAll { !(it.toString() =~ "benchmark|starter") }
}
test.dependsOn << projectsToTest*.tasks*.withType(Test).flatten()
cobertura {
coverageMergeDatafiles = projectsToTest.collect { file("${it.buildDir.path}/cobertura/cobertura.ser") }
coverageFormats = ['html', 'xml']
coverageIgnoreTrivial = true
coverageSourceDirs = [ projectsToTest.sourceSets.main.java.srcDirs.flatten() ]
}
task wrapper(type: Wrapper) {
gradleVersion = "2.0"
}