-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle
112 lines (96 loc) · 3.61 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
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public"}
}
}
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
}
defaultTasks 'clean','build'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'pl.allegro.tech.build.axion-release'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
ext.rundeckPluginVersion= '1.2'
ext.rundeckVersion='5.2.0-20240410'
/**
* Set this to a comma-separated list of full classnames of your implemented Rundeck
* plugins.
*/
ext.pluginClassNames='org.rundeck.plugins.S3LogFileStoragePlugin'
scmVersion {
ignoreUncommittedChanges = true
tag {
prefix = 'v'
versionSeparator = ''
}
}
project.version = scmVersion.version
repositories {
mavenLocal()
mavenCentral()
maven {
// maven snapshot repo since we are using SNAPSHOT of rundeck-core for now
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
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
}
}
dependencies {
// add any third-party jar dependencies you wish to include in the plugin
// using the `pluginLibs` configuration as shown here:
implementation "com.amazonaws:aws-java-sdk-s3:${awsSdkVersion}"
pluginLibs (group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: "${awsSdkVersion}") {
exclude group: "com.fasterxml.jackson.core"
exclude group: "com.fasterxml.jackson.dataformat"
}
pluginLibs (group: 'com.amazonaws', name: 'aws-java-sdk-sts', version: "${awsSdkVersion}") {
exclude group: "com.fasterxml.jackson.core"
exclude group: "com.fasterxml.jackson.dataformat"
}
//the compile dependency won't add the rundeck-core jar to the plugin contents
implementation group: 'org.rundeck', name: 'rundeck-core', version: rundeckVersion
testImplementation group: 'junit', name:'junit', version: '4.11'
}
// 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': 'S3 Log Plugin'
attributes 'Rundeck-Plugin-Description': 'Store execution log files in S3, for backup or for cloud-friendly behavior.'
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '5.2.0+'
attributes 'Rundeck-Plugin-Tags': 'java,s3,execution file storage'
attributes 'Rundeck-Plugin-License': 'Apache 2.0'
attributes 'Rundeck-Plugin-Author': 'Rundeck, Inc.'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/rundeck-s3-log-plugin'
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': "org.rundeck.plugins.S3LogFileStoragePlugin"
attributes 'Class-Path': "${libList} lib/rundeck-core-${rundeckVersion}.jar"
}
}
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}