Neutrollized/rundeck-gcp-nodes-plugin

View on GitHub
build.gradle

Summary

Maintainability
Test Coverage
buildscript {
   repositories {
      mavenCentral()
      maven { url "https://oss.sonatype.org/content/groups/public"}
   }
}

plugins {
    id 'pl.allegro.tech.build.axion-release' version '1.10.3'
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'pl.allegro.tech.build.axion-release'
sourceCompatibility = 1.8
defaultTasks 'clean', 'build'
ext.rundeckPluginVersion = '1.2'
scmVersion {
    tag {
        prefix = 'v'
        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"
            }
            orig
        }
    }
}

//project.version = scmVersion.version
project.version = '3.3.12-1'

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
    }
}
repositories {
    mavenCentral()

    ivy {
        url = "file:$projectDir/third-party"
        name = 'thirdparty'
        layout  'pattern', {
            artifact "[module]-[revision]/[module]-[revision](-[classifier]).[ext]"
        }
    }
}
dependencies {
    // https://mvnrepository.com/artifact/org.rundeck/rundeck-core
    compile group: 'org.rundeck', name: 'rundeck-core', version: '3.3.12-20210521'

    pluginLibs group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
    pluginLibs group: 'org.dom4j', name: 'dom4j', version: '2.1.3'
    pluginLibs group: 'apache-log4j', name: 'apache-log4j', version: '1.2.15'
    pluginLibs group: 'stax', name: 'stax', version: '1.2.0'
    pluginLibs group: 'stax-api', name: 'stax-api', version: '1.0.1'

    pluginLibs group: 'com.google.apis', name:'google-api-services-compute', version: 'v1-rev235-1.25.0'
    pluginLibs group: 'com.google.oauth-client', name:'google-oauth-client', version: '1.34.1'

}

// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
    into "$buildDir/output/lib"
    from configurations.pluginLibs
}


jar {
    // include contents of output dir
    from "$buildDir/output"
    manifest {
        attributes 'Rundeck-Plugin-Version': rundeckPluginVersion, 'Rundeck-Plugin-Archive': 'true', 'Rundeck-Plugin-Libs-Load-First':'false'
        // create space-separated list of pluginLibs
        def libList = configurations.pluginLibs.collect{'lib/'+it.name}.join(' ')
        attributes 'Rundeck-Plugin-Classnames': 'com.dtolabs.rundeck.plugin.resources.gcp.GCPResourceModelSourceFactory', 'Rundeck-Plugin-Libs': "${libList}"
        attributes 'Rundeck-Plugin-Author': 'Glen Yu', 'Rundeck-Plugin-URL': 'https://github.com/Neutrollized/rundeck-gcp-nodes-plugin', 'Rundeck-Plugin-Date': '2022-09-20'
        attributes 'Rundeck-Plugin-File-Version': '3.3.12-1'
    }
}

// set jar task to depend on copyToLib
jar.dependsOn(copyToLib)

task wrapper(type: Wrapper) {
    gradleVersion = '4.10.3'
}