-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
82 lines (66 loc) · 2.01 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
import org.apache.tools.ant.filters.ReplaceTokens
defaultTasks 'build'
task pluginZip(type: Jar) {
destinationDir = file("build/libs")
baseName = project.ext.archivesBaseName
version = project.version
classifier = ''
extension = 'zip'
from("${project.buildDir}/zip-contents") {
include("*.yaml")
include("resources/**")
include("contents/*")
into(archiveFilename)
}
manifest {
attributes 'Rundeck-Plugin-Name': pluginName.toString(),
'Rundeck-Plugin-Description': pluginDescription.toString(),
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-File-Version': version,
'Rundeck-Plugin-Author': sopsCopyright,
'Rundeck-Plugin-URL': sopsUrl,
'Rundeck-Plugin-Date': buildDateString
}
}
pluginZip.doFirst {
def assetsMap = new Properties()
def tokens = assetsMap + [
version : version,
date : new Date().format("yyyy-MM-dd'T'HH:mm:ssX").toString(),
author : sopsCopyright,
url : sopsUrl,
title : pluginName,
description: pluginDescription,
name : archivesBaseName.toString(),
]
copy {
from("${project.projectDir}/resources"){
include '**/*'
into "resources"
}
from("${project.projectDir}/contents"){
into "contents"
}
from("${project.projectDir}/plugin.yaml") {
filter(ReplaceTokens, tokens: tokens)
exclude '**/*.png'
}
into "${project.buildDir}/zip-contents"
}
}
apply plugin: 'maven-publish'
publishing {
publications {
mavenZip(MavenPublication) {
artifact pluginZip
}
}
}
defaultTasks 'clean', 'build','pluginZip'
task build(dependsOn: ['pluginZip']) << {
}
task install(dependsOn: ['build','publishToMavenLocal']) << {
}
task clean(type: Delete) {
delete('build')
}