forked from asciidoctor/asciidoctor-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
180 lines (148 loc) · 6.04 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
/*
* Copyright 2013-2019 the original author or authors.
*
* 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.
*/
plugins {
id 'net.nemerosa.versioning' version '2.15.1' apply false
id 'com.github.ben-manes.versions' version '0.50.0' apply false
id 'com.github.hierynomus.license' version '0.16.1' apply false
id 'com.github.kt3k.coveralls' version '2.12.2' apply false
id 'net.ossindex.audit' version '0.4.11' apply false
id 'org.kordamp.jdeps' version '0.2.0' apply false
id 'fi.linuxbox.download.worker' version '0.4' apply false
id 'org.ysb33r.ivypot' version '1.0.0' apply false
id 'org.ysb33r.os' version '1.0.0' apply false
id 'org.ysb33r.cloudci' version '4.0.0' apply false
id 'org.ysb33r.cloudci.appveyor.testreporter' version '4.0.0' apply false
id 'org.ysb33r.gradletest' version '3.0.0-alpha.4' apply false
id 'idea'
}
import org.gradle.util.GradleVersion
import java.text.SimpleDateFormat
apply plugin: 'net.nemerosa.versioning'
ext {
buildTimeAndDate = new Date()
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 {
ext {
offlineRepoRoot = file("${project(':testfixtures-offline-repo').buildDir}/repo")
offlineRepoBinariesRoot = file("${offlineRepoRoot}/binaries")
offlineRepoDescriptionFile = file("${offlineRepoRoot}/repositories.gradle")
withoutIntegrationTests = [
'kindlegen-gradle'
]
withoutCompatibilityTests = [
'kindlegen-gradle'
]
withoutCodeCoverage = [
]
}
}
subprojects {
apply plugin: AsciidoctorGradleModuleVersions
apply plugin: 'org.ysb33r.os'
if (project.name != 'testfixtures-offline-repo') {
apply plugin: 'groovy'
apply plugin: 'idea'
if (!project.name.startsWith('testfixture')) {
apply plugin: AsciidoctorGradlePluginProject
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'net.ossindex.audit'
apply plugin: 'org.kordamp.jdeps'
apply plugin: 'org.ysb33r.ivypot.binary.base'
if (!(project.name in withoutCodeCoverage)) {
apply plugin: 'jacoco'
jacoco {
if (JavaVersion.current().isJava11Compatible() && GradleVersion.version(toolVersion) < GradleVersion.version('0.8.2')) {
toolVersion = '0.8.2'
}
}
}
}
apply from: "${rootDir}/gradle/standard-repositories.gradle"
apply from: "${rootDir}/gradle/code-quality.gradle"
if (!project.name.startsWith('testfixture')) {
if (!(project.name in withoutIntegrationTests)) {
apply from: "${rootDir}/gradle/integration-tests.gradle"
}
apply from: "${rootDir}/gradle/publishing.gradle"
apply from: "${rootDir}/gradle/gradle-plugin-documentation.gradle"
apply from: "${rootDir}/gradle/ci.gradle"
if (project.name.startsWith('asciidoctor-gradle-jvm')) {
apply from: "${rootDir}/gradle/asciidoctorj-versions.gradle"
apply from: "${rootDir}/gradle/jruby-versions.gradle"
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { selection ->
boolean rejected = ['beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.codehaus.groovy') {
details.useVersion GroovySystem.version
details.because 'The same version as Gradle Groovy is required'
}
}
}
}
audit {
failOnError = false
}
if (!(project.name in withoutCompatibilityTests)) {
apply from: "${rootDir}/gradle/compatibility-tests.gradle"
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
project.tasks.withType(Test) {
testLogging {
afterSuite { desc, result ->
if (!desc.parent) {
println "Test results ${project.name}: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
}
}
}
}
}
}
apply from: 'gradle/coveralls.gradle'
task syncWrapper(type: Copy) {
from 'gradle', {
include 'wrapper/**'
}
into 'docs/gradle'
}
wrapper {
finalizedBy syncWrapper
}
tasks.idea.dependsOn syncWrapper