-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (122 loc) · 4.03 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
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.10.3'
id 'java'
id 'jacoco'
id "org.sonarqube" version "2.8"
}
sonarqube {
properties {
property "sonar.projectKey", "kdebisschop_rundeck-rancher-node-plugin"
property "sonar.organization", "kdebisschop"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.login", "807fd8589d7244bd324b5fecdfca9614d8a40c8c"
}
}
jacoco {
toolVersion = "0.8.6"
}
jacocoTestReport {
reports {
xml.enabled true
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
compileJava {
options.release.set(8)
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
compileTestJava {
options.release.set(8)
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
defaultTasks 'clean','test','jacocoTestReport','build'
ext.rundeckPluginVersion = '1.2'
ext.pluginClassNames='com.bioraft.rundeck.rancher.RancherNodeExecutorPlugin,' +
'com.bioraft.rundeck.rancher.RancherFileCopier,' +
'com.bioraft.rundeck.rancher.RancherResourceModelSourceFactory,' +
'com.bioraft.rundeck.rancher.RancherUpgradeService,' +
'com.bioraft.rundeck.rancher.RancherNewStack,' +
'com.bioraft.rundeck.rancher.RancherAddService,' +
'com.bioraft.rundeck.rancher.RancherManageService'
ext.pluginName = 'Rancher Node Plugins'
ext.pluginDescription = 'Interface with Rancher environments'
scmVersion {
ignoreUncommittedChanges = true
tag {
// Ignore tags that begin with <prefix><versionSeparator>, include all tags
// if prefix is empty.
prefix = ''
versionSeparator = ''
// Append .0 to satisfy SemVer if the tag version is only X.Y
def origDeserialize=deserialize
deserialize = { config, position, tagName ->
String orig = origDeserialize(config, position, tagName)
if (orig.split('\\.').length < 3) {
orig += ".0"
}
orig
}
}
}
project.version = scmVersion.version
repositories {
mavenCentral()
}
configurations {
pluginLibs
implementation {
compileClasspath.extendsFrom(pluginLibs)
}
}
dependencies {
implementation (
'com.fasterxml.jackson.core:jackson-databind:2.10.1',
'com.squareup.okhttp3:okhttp:3.14.7',
'org.apache.logging.log4j:log4j-api:2.13.2',
'org.apache.logging.log4j:log4j-core:2.13.2',
'org.rundeck:rundeck-core:3.3.6-20201111',
'org.rundeck:rundeck-storage-api:3.3.6-20201111',
)
testImplementation (
'com.squareup.okhttp3:mockwebserver:3.11.0',
'junit:junit:4.12',
'org.mockito:mockito-core:3.7+',
'org.slf4j:slf4j-simple:1.7.30+',
)
}
plugins.withType(JacocoPlugin) {
tasks["test"].finalizedBy 'jacocoTestReport'
}
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
jar {
from "$buildDir/output"
manifest {
def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': archiveVersion
attributes 'Rundeck-Plugin-Name': pluginName
attributes 'Rundeck-Plugin-Description': pluginDescription
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.x'
attributes 'Rundeck-Plugin-Tags': 'java,WorkflowNodeStep'
attributes 'Rundeck-Plugin-License': 'Apache 2.0'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/kdebisschop/rundeck-rancher-node-plugin'
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion
attributes 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': "${libList}"
}
dependsOn(copyToLib)
}
wrapper {
gradleVersion = '6.7.1'
}