Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 83 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,39 +1,105 @@
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.7.0'
id 'java'
id 'pl.allegro.tech.build.axion-release' version '1.18.11'
id 'maven-publish'
}

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.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 = true
tag {
prefix = ''
versionSeparator = ''
def origDeserialize=deserialize
//apend .0 to satisfy semver if the tag version is only X.Y
deserialize = { config, position, tagName ->
def orig = origDeserialize(config, position, tagName)
if (orig.split('\\.').length < 3) {
orig += ".0"
}
}

project.version = scmVersion.version
ext.archiveFilename = ext.archivesBaseName + '-' + version

// 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"
}
orig
from("${project.projectDir}/plugin.yaml") {
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: tokens)
exclude '**/*.png'
}
into "${project.buildDir}/zip-contents"
}
}
}

project.version = scmVersion.version
ext.archiveFilename = ext.archivesBaseName + '-' + version
publishing {
publications {
mavenZip(MavenPublication) {
artifact pluginZip
}
}
}

build {
dependsOn 'pluginZip'
}

tasks.register('install') {
dependsOn 'build', 'publishToMavenLocal'
}

apply from: 'https://raw.githubusercontent.com/rundeck-plugins/build-zip/master/build.gradle'
defaultTasks 'clean', 'build', 'pluginZip'
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
244 changes: 244 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading