forked from opensearch-project/opensearch-build-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (124 loc) · 4.86 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
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
plugins {
id 'com.mkobit.jenkins.pipelines.shared-library' version '0.10.1'
id 'java'
id 'groovy'
id 'jacoco'
}
repositories {
mavenCentral()
maven { url 'https://repo.jenkins-ci.org/releases/' }
maven { url 'https://mvnrepository.com/artifact/' }
mavenLocal()
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.15', ext: 'pom'
implementation group: 'com.cloudbees', name: 'groovy-cps', version: '1.31'
testImplementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2'
testImplementation group: 'com.lesfurets', name:'jenkins-pipeline-unit', version: '1.13'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.12.0'
}
configurations.all {
resolutionStrategy {
force group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
force group: 'commons-codec', name: 'commons-codec', version: '1.15'
force group: 'com.google.protobuf', name: 'protobuf-java', version: '3.25.5'
force group: 'com.google.errorprone', name: 'error_prone_annotations', version: '2.18.0'
force group: 'org.checkerframework', name: 'checker-qual', version: '3.33.0'
force group: 'com.google.j2objc', name: 'j2objc-annotations', version: '2.8'
force group: 'org.jenkins-ci.plugins', name: 'durable-task', version: '547.vd1ea_007d100c'
}
}
sourceSets {
main {
groovy {
srcDirs = ['src/jenkins', 'src/gradlecheck', 'src/utils']
}
}
test {
groovy {
srcDirs = ['tests/jenkins', 'tests/gradlecheck']
}
}
jobs {
groovy {
srcDirs 'src/jenkins/jobs'
compileClasspath += main.compileClasspath
}
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
sharedLibrary {
coreVersion = '2.426.3' // https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-core/
testHarnessVersion = '2085.va_c531db_287b_d' // https://mvnrepository.com/artifact/org.jenkins-ci.main/jenkins-test-harness?repo=jenkins-releases
pluginDependencies {
workflowCpsGlobalLibraryPluginVersion = '570.v21311f4951f8' // https://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/workflow/workflow-cps-global-lib/
// see https://mvnrepository.com/artifact/org.jenkins-ci.plugins/<name>?repo=jenkins-releases for latest
dependency('org.jenkins-ci.plugins.workflow', 'workflow-cps', '3606.v0b_d8b_e512dcf')
dependency('org.jenkins-ci.plugins.workflow', 'workflow-multibranch', '2.26.1')
dependency('org.jenkins-ci.plugins', 'pipeline-input-step', '456.vd8a_957db_5b_e9') // https://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/pipeline-input-step/
dependency('org.jenkins-ci.plugins', 'script-security', '1229.v4880b_b_e905a_6')
dependency('org.jenkins-ci.plugins', 'credentials', '1112.vc87b_7a_3597f6')
dependency('org.jenkins-ci.plugins', 'git-client', '3.11.1')
dependency('org.jenkins-ci.plugins', 'junit', '1166.1168.vd6b_8042a_06de')
dependency('org.jenkins-ci.plugins', 'mailer', '408.vd726a_1130320') // https://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/mailer/
}
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
if (project.hasProperty('pipeline.stack.write')) {
systemProperty 'pipeline.stack.write', project.getProperty('pipeline.stack.write')
}
jacoco {
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
finalizedBy jacocoTestReport
}
jacoco {
toolVersion = '0.8.7'
}
jacocoTestReport {
dependsOn test
sourceSets sourceSets.main
afterEvaluate {
classDirectories.from = fileTree(
dir: "$buildDir/jacoco/classpathdumps",
includes: [
'**/*_Jenkinsfile.*',
'**/jenkins/*',
'**/gradlecheck/*',
'**/utils/*'
],
excludes: [
'**/*\$_get_closure*'
]
)
}
reports {
xml.required = true
}
}
String version = '7.3.3'
task updateVersion {
doLast {
println "Setting version to ${version} in all libraries"
ant.replaceregexp(match:'jenkins@main', replace: 'jenkins@' + version, flags: 'g') {
fileset(dir: projectDir) {
include (name: "vars/**")
include (name: "tests/**")
}
}
}
}