-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
183 lines (151 loc) · 5.23 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'org.codehaus.griffon:gradle-griffon-plugin:2.6.0'
classpath 'org.codehaus.griffon:gradle-griffon-build-plugin:2.6.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
classpath 'org.ajoberstar:gradle-git:1.3.2'
classpath 'org.kordamp.gradle:stats-gradle-plugin:0.1.5'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
}
}
apply plugin: 'base'
apply plugin: 'idea'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'build-dashboard'
apply from: 'gradle/idea.gradle'
apply plugin: 'org.codehaus.griffon.griffon-build'
apply from: 'gradle/bom.gradle'
apply plugin: 'org.ajoberstar.github-pages'
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}
allprojects {
apply plugin: 'base'
apply plugin: 'idea'
apply plugin: 'com.github.ben-manes.versions'
repositories {
jcenter()
mavenLocal()
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
repositories {
mavenCentral()
}
apply plugin: 'jacoco'
jacoco {
toolVersion = jacocoVersion
}
ext.jacocoProjects = []
subprojects { subproj ->
subproj.tasks.withType(Javadoc) {
sourceCompatibility = subproj.sourceCompatibility
targetCompatibility = subproj.targetCompatibility
}
plugins.withType(JavaPlugin) {
configurations {
compileOnly
testCompileOnly
}
subproj.tasks.withType(JavaCompile) {
sourceCompatibility = subproj.sourceCompatibility
targetCompatibility = subproj.targetCompatibility
}
subproj.tasks.withType(GroovyCompile) {
sourceCompatibility = subproj.sourceCompatibility
targetCompatibility = subproj.targetCompatibility
}
sourceSets {
main {
compileClasspath += [configurations.compileOnly]
}
test {
compileClasspath += [configurations.testCompileOnly]
}
}
javadoc {
classpath += [configurations.compileOnly]
}
idea {
module {
scopes.PROVIDED.plus += [configurations.compileOnly]
scopes.PROVIDED.plus += [configurations.testCompileOnly]
}
}
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'org.slf4j:slf4j-simple:1.7.18'
}
task sourceJar(type: Jar) {
group 'Build'
description 'An archive of the source code'
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
group 'Build'
description 'An archive of the javadoc'
classifier 'javadoc'
dependsOn javadoc
from javadoc.destinationDir
}
tasks.withType(AbstractCompile) {
if (rootProject.hasProperty('lint') && rootProject.lint.toBoolean()) {
options.compilerArgs = [
'-Xlint:all', '-Xlint:deprecation', '-Xlint:unchecked'
]
}
}
subproj.apply from: rootProject.file('gradle/publishing.gradle')
//subproj.apply from: rootProject.file('gradle/code-quality.gradle')
if (subproj.publishJars.toBoolean()) {
subproj.apply from: rootProject.file('gradle/docs.gradle')
}
subproj.test.testLogging { exceptionFormat 'full' }
}
}
evaluationDependsOnChildren()
if (!project.hasProperty('githubUsername')) ext.githubUsername = ''
if (!project.hasProperty('githubPassword')) ext.githubPassword = ''
githubPages {
repoUri = project.projectVcsUrl
pages {
from project(":${pluginBaseName}-guide").guide.outputs.files
}
credentials {
username = githubUsername
password = githubPassword
}
}
publishGhPages.dependsOn(project(":${pluginBaseName}-guide").guide)
coveralls {
sourceDirs = files(jacocoProjects.sourceSets.main.allSource.srcDirs).files.absolutePath
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = jacocoProjects.test
additionalSourceDirs = files(jacocoProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(jacocoProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(jacocoProjects.sourceSets.main.output)
executionData = files(jacocoProjects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
html.destination = "${buildDir}/reports/jacoco/test/html"
xml.destination = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
}