-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
152 lines (124 loc) · 4.72 KB
/
build.gradle
File metadata and controls
152 lines (124 loc) · 4.72 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
148
149
150
151
152
import org.gradle.api.JavaVersion
plugins {
id 'groovy'
id 'java'
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}
group 'org.rundeck.plugins'
ext.publishName = "jq Json Log Filter ${project.version}"
ext.githubSlug = 'rundeck-plugins/jq-json-logfilter'
ext.developers = [
[id: 'gschueler', name: 'Greg Schueler', email: 'greg@rundeck.com']
]
scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
versionSeparator = ''
}
}
ext.rundeckVersion='6.0.0-alpha1-20260407'
defaultTasks 'clean','build'
apply plugin: 'java'
apply plugin: 'idea'
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
ext.rundeckPluginVersion= '1.2'
version = scmVersion.version // Dynamic version from git tag
/**
* Set this to a comma-separated list of full classnames of your implemented Rundeck
* plugins.
*/
ext.pluginClassNames='com.rundeck.plugins.logging.JsonLogFilter'
repositories {
mavenLocal()
maven {
name = 'Central Portal Snapshots'
url = 'https://central.sonatype.com/repository/maven-snapshots/'
// Only search this repository for org.rundeck snapshots
content {
includeGroup('org.rundeck')
}
}
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
implementation{
extendsFrom pluginLibs
}
}
dependencies {
implementation 'org.apache.groovy:groovy-all:4.0.29'
compileOnly group: 'org.rundeck', name: 'rundeck-core', version: rundeckVersion
testImplementation group: 'org.rundeck', name: 'rundeck-core', version: rundeckVersion
// Add secure commons-lang3 to provide alternative to vulnerable commons-lang 2.6
implementation 'org.apache.commons:commons-lang3:3.20.0'
pluginLibs (group: 'net.thisptr', name: 'jackson-jq', version: '1.0.0-preview.20230409') {
exclude group: "com.fasterxml.jackson.core"
}
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation "org.spockframework:spock-core:2.4-groovy-4.0"
testImplementation "cglib:cglib-nodep:3.3.0"
testImplementation 'org.objenesis:objenesis:1.4'
}
configurations.all {
resolutionStrategy {
// Replace vulnerable commons-lang with secure commons-lang3
dependencySubstitution {
substitute module('commons-lang:commons-lang') using module('org.apache.commons:commons-lang3:3.17.0')
}
}
}
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
// Java 17+ module access
jvmArgs = [
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED'
]
}
jar {
from "$buildDir/output"
manifest {
def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
attributes 'Rundeck-Plugin-Name' : 'jq Json Log Filter'
attributes 'Rundeck-Plugin-Description' : 'This plugin maps a JSON String output from a step to key/value context variables.'
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.0.6+'
attributes 'Rundeck-Plugin-Tags': 'java,json,log filter'
attributes 'Rundeck-Plugin-License': 'Apache 2.0'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/jq-json-logfilter'
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': version
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion, 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': "${libList}"
attributes 'Main-Class': "com.rundeck.plugins.logging.JsonLogFilter"
attributes 'Class-Path': "${libList} lib/rundeck-core-${rundeckVersion}.jar"
}
}
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)
nexusPublishing {
packageGroup = 'org.rundeck.plugins'
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
apply from: "${rootDir}/gradle/publishing.gradle"