-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
197 lines (169 loc) · 6.15 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
mavenLocal()
}
dependencies {
classpath "org.codehaus.griffon:gradle-griffon-plugin:$griffonVersion"
classpath "org.codehaus.griffon:gradle-griffon-build-plugin:$griffonVersion"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'org.ajoberstar:gradle-git:1.3.2'
classpath 'org.kordamp.gradle:stats-gradle-plugin:0.2.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'net.nemerosa:versioning:2.6.0'
classpath 'net.ltgt.gradle:gradle-apt-plugin:0.10'
}
}
apply plugin: 'base'
apply plugin: 'idea'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'net.nemerosa.versioning'
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 {
buildBy = System.properties['user.name']
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
buildRevision = versioning.info.commit
buildCreatedBy = "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})".toString()
}
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')
}
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
}
apply plugin: 'jacoco'
jacoco {
toolVersion = jacocoVersion
}
ext.jacocoProjects = []
subprojects { subproj ->
subproj.apply plugin: 'net.ltgt.apt'
plugins.withType(JavaPlugin) {
subproj.tasks.withType(JavaCompile) {
sourceCompatibility = subproj.sourceCompatibility
targetCompatibility = subproj.targetCompatibility
}
subproj.tasks.withType(GroovyCompile) {
sourceCompatibility = subproj.sourceCompatibility
targetCompatibility = subproj.targetCompatibility
}
dependencies {
testCompile "junit:junit:$junitVersion"
testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile("org.spockframework:spock-core:$spockVersion") {
exclude group: 'org.codehaus.groovy', module:' groovy-all'
}
testCompile "org.slf4j:slf4j-simple:$slf4jVersion"
}
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 Javadocs'
classifier '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 = jacocoProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/report.xml"
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
group = 'Reporting'
description = 'Aggregate Jacoco coverage reports.'
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 {
xml.enabled true
html.enabled true
xml.destination "${buildDir}/reports/jacoco/report.xml"
html.destination "${buildDir}/reports/jacoco/html"
}
}
generateBom {
pomConfig {
description = projectDescription
url = projectWebsiteUrl
scm {
url = projectVcsUrl
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 'aalmiray'
name = 'Andres Almiray'
}
}
}
}