-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
executable file
·172 lines (142 loc) · 4.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
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
import java.util.regex.Matcher
//noinspection GroovyAssignabilityCheck
group 'org.zowe.explorer.files'
buildscript {
ext {
licenseGradlePluginVersion = '0.6.1'
}
ext.mavenRepositories = {
mavenLocal()
maven {
url artifactoryMavenSnapshotRepo
credentials {
username mavenUser
password mavenPassword
}
}
maven {
url artifactoryMavenRepo
credentials {
username mavenUser
password mavenPassword
}
}
}
repositories mavenRepositories
dependencies {
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8'
classpath 'net.researchgate:gradle-release:2.8.1'
classpath "gradle.plugin.org.cadixdev.gradle:licenser:${licenseGradlePluginVersion}"
classpath 'org.owasp:dependency-check-gradle:3.3.4'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
apply from: 'gradle/publish.gradle'
apply from: 'gradle/sonar.gradle'
apply from: 'gradle/coverage.gradle'
apply from: 'gradle/versions.gradle'
apply from: 'gradle/code-quality.gradle'
allprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'org.cadixdev.licenser'
apply plugin: 'org.owasp.dependencycheck'
repositories mavenRepositories
sourceCompatibility = 1.8
version = version
idea {
module {
//noinspection GroovyAssignabilityCheck
outputDir file('build/classes/main')
//noinspection GroovyAssignabilityCheck
testOutputDir file('build/classes/test')
downloadJavadoc = true
downloadSources = true
}
}
configurations.all {
exclude group: 'org.glassfish', module: 'jakarta.el'
}
dependencies {
constraints {
compileOnly libraries.values()
implementation libraries.values()
testImplementation libraries.values()
annotationProcessor libraries.values()
}
}
configurations.all {
exclude group: 'org.junit.jupiter'
resolutionStrategy.force libraries.mockito_core
}
}
subprojects {
license {
header = rootProject.file('.license/LICENSE_HEADER')
properties {
name = 'Contributors to the Zowe Project'
year = Calendar.getInstance().get(Calendar.YEAR)
}
exclude "**/*.yml", "**/*.yaml", "**/*.json", "**/static", "**/*.sh", "**/*.txt", "**/*.p12", "**/*.xml", "**/*.jsp", "**/*.html", "**/*.jks"
skipExistingHeaders = true
}
tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors()
}
}
configurations {
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
all*.exclude group: 'com.fasterxml.jackson.module', module: 'jackson-module-kotlin'
}
task publishAllVersions {
group 'Zowe Publishing'
description 'Publish SDK libraries for all version of Spring Boot to Zowe Artifactory'
doLast {
println 'Published all versions of SDK'
}
}
publishAllVersions.dependsOn publishArtifacts
//-----------Release part start
apply plugin: 'net.researchgate.release'
ext.releaseScope = project.hasProperty('release.scope') ? project.getProperty('release.scope') : 'patch'
release {
failOnCommitNeeded = false
failOnPublishNeeded = false
failOnSnapshotDependencies = false
failOnUnversionedFiles = false
failOnUpdateNeeded = false
revertOnFail = true
preCommitText = '[Gradle Release plugin]'
preTagCommitMessage = '[skip ci] Before tag commit'
tagCommitMessage = 'Release:'
tagTemplate = '${version}'
newVersionCommitMessage = 'Create new version:'
versionPropertyFile = 'gradle.properties'
buildTasks = ['build']
if (releaseScope == 'minor') {
versionPatterns = [
/[.]*\.(\d+)\.(\d+)[.]*/: { Matcher m, Project p -> m.replaceAll(".${(m[0][1] as int) + 1}.0") }
]
} else if (releaseScope == 'major') {
versionPatterns = [
/(\d+)\.(\d+)\.(\d+)[.]*/: { Matcher m, Project p -> m.replaceAll("${(m[0][1] as int) + 1}.0.0") }
]
} else {
versionPatterns = [
/(\d+)([^\d]*$)/: { Matcher m, Project p -> m.replaceAll("${(m[0][1] as int) + 1}${m[0][2]}") }
]
}
scmAdapters = [
net.researchgate.release.GitAdapter
]
git {
requireBranch = ''
pushToRemote = 'origin'
pushToBranchPrefix = ''
commitVersionFileOnly = true
signTag = false
}
}
afterReleaseBuild.dependsOn publishAllVersions
//-----------Release part end