Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
147 lines (122 loc) · 4.49 KB
/
Copy pathbuild.gradle
File metadata and controls
147 lines (122 loc) · 4.49 KB
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
plugins {
alias(libs.plugins.axionRelease)
id 'java'
}
group 'org.rundeck.plugins'
ext.rundeckPluginVersion = '1.2'
ext.publishName = "Git Plugin ${project.version}"
ext.githubSlug = 'rundeck-plugins/git-plugin'
ext.pluginClassNames='com.rundeck.plugin.GitResourceModelFactory,com.rundeck.plugin.GitCloneWorkflowStep,com.rundeck.plugin.GitPushWorkflowStep,com.rundeck.plugin.GitCommitWorkflowStep,com.rundeck.plugin.GitAddWorkflowStep'
ext.pluginName = 'Git Plugin'
ext.pluginDescription = 'This is a git plugin (based on Jgit) which contain a Resource model and worflow steps'
ext.developers = [
[id: 'ltamaster', name: 'Luis Toledo', email: 'luis@variacode.com']
]
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
versionSeparator = ''
}
versionCreator 'simple' // Use simple version creator (just tag name)
}
project.version = scmVersion.version
apply plugin: 'groovy'
apply plugin: 'java'
repositories {
mavenCentral()
maven {
name = 'Central Portal Snapshots'
url = 'https://central.sonatype.com/repository/maven-snapshots/'
content {
includeGroup('org.rundeck')
}
}
}
configurations {
pluginLibs
implementation {
extendsFrom pluginLibs
}
}
dependencies {
// Use catalog aliases for dependencies
implementation(libs.groovyAll)
compileOnly(libs.rundeckCore)
testImplementation(libs.rundeckCore)
implementation(libs.slf4jApi)
// Add secure commons-lang3 to provide alternative to vulnerable commons-lang 2.6
implementation(libs.commonsLang3)
pluginLibs(libs.jgit) {
exclude module: 'slf4j-api'
exclude module: 'commons-logging'
}
pluginLibs(libs.jgitSshApache) {
exclude module: 'slf4j-api'
}
testImplementation libs.bundles.testLibs
}
configurations.all {
resolutionStrategy {
// Force secure versions for non-breaking dependency overrides
force "com.squareup.okhttp3:okhttp:${libs.versions.okhttp3.get()}"
force "com.squareup.okio:okio:${libs.versions.okio.get()}"
// Replace vulnerable commons-lang with secure commons-lang3
dependencySubstitution {
substitute module('commons-lang:commons-lang') using module("org.apache.commons:commons-lang3:${libs.versions.commonsLang3.get()}")
}
}
}
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-Name' : pluginName
attributes 'Rundeck-Plugin-Description' : pluginDescription
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '2.11.4+'
attributes 'Rundeck-Plugin-Tags': 'java,workflow steps,resource model'
attributes 'Rundeck-Plugin-License': 'Apache 2.0'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/git-plugin'
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
attributes 'Rundeck-Plugin-Author': 'Rundeck, Inc.'
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': project.version
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion
attributes 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': "${libList}"
}
dependsOn(copyToLib)
}
test {
useJUnitPlatform()
// Java 17 requires these for cglib/Spock mocking
jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED'
}
apply from: "${rootDir}/gradle/publishing.gradle"
def pkgcldRepoUrl = (System.getenv("PKGCLD_REPO_URL") ?: "https://packagecloud.io/pagerduty/rundeck-plugins/maven2").trim()
publishing {
repositories {
maven {
name = "PackageCloud"
url = uri(pkgcldRepoUrl)
authentication {
header(HttpHeaderAuthentication)
}
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "Bearer " + (System.getenv("PKGCLD_WRITE_TOKEN") ?: project.findProperty("pkgcldWriteToken"))
}
}
}
}