-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
173 lines (148 loc) · 4.76 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
/*
* Copyright (c) 2021 Worksoft, Inc.
*
* gradle build
*
* @author rrinehart
*/
buildscript {
// These are the list of remote repositories where Gradle Plugins can be found
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
// These are Gradle Plugins this build uses. See also the plugins block below
dependencies {
classpath 'net.saliman:gradle-properties-plugin:1.5.1'
}
}
}
plugins {
id 'groovy'
id 'org.jenkins-ci.jpi' version '0.50.0'
id 'com.github.onslip.gradle-one-jar' version '1.0.5'
}
apply plugin: 'maven-publish'
apply plugin: 'idea'
// Where to resolve external dependencies.
repositories {
mavenCentral()
maven {
url('https://repo.jenkins-ci.org/public/')
}
}
group = 'org.jenkins-ci.plugins'
//group = 'io.jenkins.plugins'
description = 'Adds build step(s) for interacting with Worksoft Continuous Test Manager.'
project.ext {
buildUser = { ->
return System.env.USERNAME
}
}
apply plugin: 'net.saliman.properties'
jenkinsPlugin {
//jenkinsVersion="${jenkinsBaseVersion}.${jenkinsPatchVersion}"
jenkinsVersion="2.440.3"
displayName = "Worksoft Continuous Test Manager Plugin"
shortName = "ws-ctm"
// URL for plugin on Jenkins wiki or elsewhere
url = "https://github.com/jenkinsci/ws-ctm-plugin"
repoUrl = 'https://repo.jenkins-ci.org/releases'
snapshotRepoUrl = 'https://repo.jenkins-ci.org/snapshots'
// enable injection of additional tests for checking the syntax of Jelly and other things
disabledTestInjection = false
// disable configuration of Maven Central, the local Maven cache and the Jenkins Maven repository, defaults to true
configureRepositories = false
// skip configuration of publications and repositories for the Maven Publishing plugin, defaults to true
configurePublishing = false
// plugin file extension, either 'jpi' or 'hpi', defaults to 'hpi'
fileExtension = 'hpi'
developers {
developer {
id = "worksoft"
name = "Worksoft, Inc."
email = "[email protected]"
}
}
licenses {
license {
name = "MIT license"
distribution "repo"
}
}
}
dependencies {
api platform("io.jenkins.tools.bom:bom-2.440.x:${jenkinsBomVersion}")
compileOnly 'org.jenkins-ci.plugins:credentials' // This is should be change from "compileOnly" to "implementation" while building code locally
compileOnly 'org.jenkins-ci.plugins:structs' // This is should be change from "compileOnly" to "implementation" while building code locally
implementation 'org.jodd:jodd-http:5.0.1'
implementation "org.codehaus.groovy:groovy-all:${groovyVersion}"
implementation 'com.github.jnr:jnr-ffi:2.2.17'
}
idea{
module{
inheritOutputDirs = false
outputDir = compileJava.destinationDir
testOutputDir = compileTestJava.destinationDir
}
}
//compileJava {
// options.compilerArgs << '-Xlint:deprecation'
//}
task listSrc(group: 'debugging', description: 'list project source') {
doLast { task ->
println "Project $task.project.name Source Sets:"
task.project.sourceSets.each { srcSet ->
println " - SourceSet: $srcSet.name"
srcSet.allSource.each { file ->
println " - ${file}"
}
}
}
}
// Below code should be uncomment while building code using gradle locally.
/*
tasks.withType(Test).each { task ->
task.enabled = false
}
*/
task listCompile(group: 'debugging', description: 'show compile configuration') {
doLast {
configurations.each { conf ->
println "Configuration $conf"
println " $conf.allDependencies"
}
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
name 'jenkins'
if (project.version.toString().endsWith('-SNAPSHOT')) {
url System.properties['jpi.snapshotRepoUrl'] ?: 'https://repo.jenkins-ci.org/snapshots'
} else {
url System.properties['jpi.repoUrl'] ?: 'https://repo.jenkins-ci.org/releases'
}
credentials {
//username = "notspecified"
//password = "notspecified"
}
}
}
}
//password = "hrBcJCotgbKEEp"
//username = project.stringProp(“jenkins.username”)
//password = project.stringProp(“jenkins.password”)
tasks.named('server').configure {
execSpec {
debugOptions {
port.set(5005)
suspend.set(false)
}
}
}