-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (121 loc) · 3.91 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
plugins {
id "pl.allegro.tech.build.axion-release" version "1.18.2"
id 'com.github.johnrengelman.shadow' version '5.2.0'
id "org.sonarqube" version "5.1.0.4882"
id 'jacoco'
id 'java'
id 'maven-publish'
}
sonarqube {
properties {
property "sonar.projectKey", "kdebisschop_rundeck-nexus3-optionvalue-plugin"
property "sonar.organization", "kdebisschop"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.host.url", "https://sonarcloud.io"
}
}
test {
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = true
html.destination file("${buildDir}/jacocoHtml")
}
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
apply plugin: 'idea'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
defaultTasks 'clean','build'
group = 'com.github.kdebisschop'
ext.rundeckPluginVersion = '1.2'
ext.pluginClassNames='com.bioraft.rundeck.nexus.Nexus3OptionProvider'
ext.pluginName = 'Nexus3 Option Values Provider'
ext.pluginDescription = 'Fetches and filters assets from a Nexus3 repository'
version = scmVersion.version
repositories {
mavenCentral()
}
configurations{
// Declare custom pluginLibs configuration to include only libs for this plugin
pluginLibs
// Declare compile to extend from pluginLibs so it inherits the dependencies
compile{
extendsFrom pluginLibs
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile).tap {
configureEach {
options.compilerArgs << "-Xlint:unchecked"
}
}
}
dependencies {
implementation 'org.rundeck:rundeck-core:5.4.0-20240618'
implementation 'org.apache.maven:maven-artifact:3.9.8'
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
testImplementation (
'org.mockito:mockito-all:1.10.19',
'org.powermock:powermock-module-junit4:2.0.9',
'org.powermock:powermock-api-mockito:1.7.4'
)
}
// Task to copy plugin libs to output/lib dir
tasks.register('copyToLib', 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://bitbucket.org/raftdev/raft-tools-rundeck-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)
}
tasks.register('sourceJar', Jar) {
from sourceSets.main.allJava
}
tasks.register('javadocJar', Jar) {
from javadoc.destinationDir
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/kdebisschop/rundeck-nexus3-optionvalue-plugin")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD")
}
}
}
publications {
gpr(MavenPublication) {
version = '0.9.5'
from components.java
}
}
}
wrapper {
gradleVersion = '7.6'
}