-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
155 lines (126 loc) · 4.16 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
/* groovylint-disable DuplicateStringLiteral, NestedBlockDepth, NoDef, VariableTypeRequired */
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Groovy project to get you started.
* For more details take a look at the Groovy Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.5/userguide/tutorial_groovy_projects.html
*/
plugins {
id 'maven-publish'
// Apply the groovy plugin to add support for Groovy
id 'groovy'
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
// Needed for signing artifacts pushed to https://oss.sonatype.org/
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
version = project.findProperty('CICD_TAG') ?: '0.0.0-DEV'
group = 'io.github.dontshavetheyak'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
task removeDuplicateFiles(type: Delete) {
delete "${buildDir}/tmp/groovydoc"
}
groovydoc {
use = true
overviewText = resources.text.fromString('Bringing the Zen of Python to Jenkins.')
link('https://docs.oracle.com/javase/8/docs/api/', 'java.')
link('https://javadoc.jenkins.io', 'hudson.,jenkins.')
}
task groovydocJar(type: Jar, dependsOn: groovydoc ) {
classifier 'javadoc' // must use javadoc classifier to be able to deploy to Sonatype
from groovydoc.destinationDir
}
groovydoc.finalizedBy removeDuplicateFiles
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
artifact(groovydocJar) {
classifier = 'javadoc'
}
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'jenkins-std-lib'
description = 'A Jenkins shared library for commonly used CI/CD functions.'
url = 'https://github.com/DontShaveTheYak/jenkins-std-lib'
inceptionYear = '2020'
licenses {
license {
name = 'GNU General Public License v3.0'
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
}
}
developers {
developer {
id = 'shadycuz'
name = 'Levi Blaney'
email = '[email protected]'
}
}
scm {
url = 'https://github.com/DontShaveTheYak/jenkins-std-lib'
connection = 'scm:https://github.com/DontShaveTheYak/jenkins-std-lib.git'
developerConnection = 'scm:[email protected]:DontShaveTheYak/jenkins-std-lib.git'
}
}
}
}
}
nexusPublishing {
repositories {
sonatype()
}
}
signing {
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
sourceSets {
main {
groovy {
srcDirs = ['src']
}
}
}
repositories {
// Gradle emits a warning because jcenter() method is going to be
// removed in Grafle 8.0 but google() or mavenCentral() can not find
// org.connectbot.jbcrypt:jbcrypt:1.0.0.
jcenter()
mavenCentral()
maven {
url 'https://repo.jenkins-ci.org/releases/'
}
}
configurations {
contrib.extendsFrom compileOnly
}
dependencies {
// Use the latest Groovy version for building this library
compileOnly('org.codehaus.groovy:groovy-all:3.0.14')
compileOnly('org.jenkins-ci.main:jenkins-core:2.383')
compileOnly('com.cloudbees:groovy-cps:1.34')
}
wrapper {
gradleVersion = '7.5.1'
distributionType = Wrapper.DistributionType.ALL
}
task downloadJars(type: Copy) {
into "${buildDir}/dependencies"
from configurations.contrib
}