-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
117 lines (101 loc) · 3.45 KB
/
build.gradle
File metadata and controls
117 lines (101 loc) · 3.45 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
plugins {
id 'java'
id 'pl.allegro.tech.build.axion-release' version '1.18.17'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}
group = 'org.rundeck.plugins'
repositories {
mavenCentral()
}
// Plugin metadata
ext.pluginName = 'YAML Test Source'
ext.pluginDescription = "Define a set of static Nodes"
ext.sopsCopyright = "© 2017, Rundeck, Inc."
ext.sopsUrl = "http://rundeck.com"
ext.buildDateString = new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
ext.archivesBaseName = "yaml-text-source"
ext.pluginBaseFolder = "."
// No Java dependencies needed - this is a script-based plugin
scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
versionSeparator = ''
}
versionCreator 'simple' // Use simple version creator (just tag name)
}
version = scmVersion.version // Dynamic version from git tag
ext.archiveFilename = ext.archivesBaseName + '-' + version
ext.publishName = "YAML Test Source ${project.version}"
ext.githubSlug = 'rundeck-plugins/yaml-text-source'
ext.developers = [
[id: 'gschueler', name: 'Greg Schueler', email: 'greg@rundeck.com']
]
// Plugin ZIP task (modernized from the external script)
tasks.register('pluginZip', Jar) {
archiveBaseName = project.ext.archivesBaseName
archiveVersion = project.version
archiveClassifier = ''
archiveExtension = 'zip'
destinationDirectory = file("build/libs")
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
)
}
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(org.apache.tools.ant.filters.ReplaceTokens, tokens: tokens)
exclude '**/*.png'
}
into "${project.buildDir}/zip-contents"
}
}
}
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"
build {
dependsOn 'pluginZip'
}
tasks.register('install') {
dependsOn 'build', 'publishToMavenLocal'
}
defaultTasks 'clean', 'build', 'pluginZip'