forked from jdeferred/jdeferred
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
123 lines (103 loc) · 4.09 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
/*
* Copyright 2013-2018 Ray Tsang
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'net.nemerosa:versioning:2.6.1'
classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.5'
}
}
plugins {
id 'com.gradle.build-scan' version '1.16'
}
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
buildFinished { buildResult ->
buildScanPublished { scan ->
['curl', '-s', '-d', "message=Build scan: ${scan.buildScanUri}", 'https://webhooks.gitter.im/e/ef6326a88d0398551161'].execute()
}
}
}
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'net.nemerosa.versioning'
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()
projectsWithCoverage = []
projectsWithClirr = []
}
if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''
if (!project.hasProperty('mavenUsername')) ext.mavenUsername = ''
if (!project.hasProperty('mavenPassword')) ext.mavenPassword = ''
jacoco {
toolVersion = jacocoVersion
}
allprojects {
apply plugin: 'base'
apply plugin: 'idea'
apply plugin: 'com.github.ben-manes.versions'
repositories {
jcenter()
}
}
evaluationDependsOnChildren()
subprojects { subproj ->
subproj.clirr {
failOnErrors = false
enabled = true
// baseline = "${project.group}:${project.name}:${project.previousVersion}"
baseline = "org.jdeferred:${project.name}:${project.previousVersion}"
}
projectsWithClirr << subproj
subproj.tasks.findByName('clirr').dependsOn subproj.tasks.findByName('assemble')
}
coveralls {
sourceDirs = files(projectsWithCoverage.sourceSets.main.allSource.srcDirs).files.absolutePath
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = projectsWithCoverage.test
group = 'Reporting'
description = 'Aggregate Jacoco coverage reports.'
additionalSourceDirs = files(projectsWithCoverage.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(projectsWithCoverage .sourceSets.main.allSource.srcDirs)
classDirectories = files(projectsWithCoverage.sourceSets.main.output)
executionData = files(projectsWithCoverage.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"
}
}
task compatibilityReport(type: org.kordamp.gradle.clirr.ClirrReportTask) {
dependsOn = projectsWithClirr.tasks.clirr
reports = files(projectsWithClirr.findAll{ it.extensions.clirr.enabled }.tasks.clirr.xmlReport)
}