-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
99 lines (83 loc) · 2.7 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
plugins {
alias(libs.plugins.axionRelease)
id 'java'
id 'maven-publish'
}
defaultTasks 'clean','build'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
ext.rundeckPluginVersion= '1.2'
ext.rundeckVersion= '3.3.x'
ext.pluginClassNames='com.plugin.sshjplugin.SSHJNodeExecutorPlugin,com.plugin.sshjplugin.SSHJFileCopierPlugin'
ext.pluginName = 'SSHJ Plugin'
ext.pluginDescription ='SSH Node Executor and File Copier plugin based on SSHJ library.'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
scmVersion {
ignoreUncommittedChanges = true
tag {
prefix = 'v'
versionSeparator = ''
}
}
project.version = scmVersion.version
repositories {
mavenLocal()
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 {
pluginLibs libs.sshj
pluginLibs libs.asnOne
pluginLibs libs.eddsa
pluginLibs libs.bundles.bouncycastle
pluginLibs libs.expectitCore
implementation libs.commonsIo
implementation libs.rundeckCore
implementation libs.slf4jApi
testImplementation libs.bundles.testLibs
}
// 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-Name' : pluginName
attributes 'Rundeck-Plugin-Description' : pluginDescription
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '2.x+'
attributes 'Rundeck-Plugin-Tags': 'java,executor'
attributes 'Rundeck-Plugin-License': 'MIT'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins'
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
attributes 'Rundeck-Plugin-Author': 'Rundeck, Inc.'
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 'Class-Path': "${libList} lib/rundeck-core-${rundeckVersion}.jar"
}
}
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)
publishing {
publications {
maven(MavenPublication) {
artifactId = 'jq-json-logfilter'
from components.java
}
}
}