|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + mavenCentral() |
| 4 | + maven { url "https://oss.sonatype.org/content/groups/public"} |
| 5 | + } |
| 6 | +} |
| 7 | + |
| 8 | +plugins { |
| 9 | + id 'pl.allegro.tech.build.axion-release' version '1.5.0' |
| 10 | +} |
| 11 | + |
| 12 | +group 'com.rundeck.plugin' |
| 13 | + |
| 14 | +apply plugin: 'pl.allegro.tech.build.axion-release' |
| 15 | +apply plugin: 'groovy' |
| 16 | +apply plugin: 'java' |
| 17 | + |
| 18 | +sourceCompatibility = 1.8 |
| 19 | +ext.rundeckPluginVersion = '1.2' |
| 20 | +ext.pluginClassNames='com.rundeck.plugin.HttpNotificationPlugin' |
| 21 | +ext.pluginName = 'Git Resource Model' |
| 22 | +ext.pluginDescription = 'Writable Git Resource Model' |
| 23 | + |
| 24 | + |
| 25 | +scmVersion { |
| 26 | + ignoreUncommittedChanges = false |
| 27 | + tag { |
| 28 | + prefix = 'v' |
| 29 | + versionSeparator = '' |
| 30 | + def origDeserialize=deserialize |
| 31 | + //apend .0 to satisfy semver if the tag version is only X.Y |
| 32 | + deserialize = { config, position, tagName -> |
| 33 | + def orig = origDeserialize(config, position, tagName) |
| 34 | + if (orig.split('\\.').length < 3) { |
| 35 | + orig += ".0" |
| 36 | + } |
| 37 | + orig |
| 38 | + } |
| 39 | + } |
| 40 | +} |
| 41 | +project.version = scmVersion.version |
| 42 | + |
| 43 | +configurations{ |
| 44 | + //declare custom pluginLibs configuration to include only libs for this plugin |
| 45 | + pluginLibs |
| 46 | + |
| 47 | + //declare compile to extend from pluginLibs so it inherits the dependencies |
| 48 | + compile{ |
| 49 | + extendsFrom pluginLibs |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +repositories { |
| 54 | + mavenCentral() |
| 55 | +} |
| 56 | + |
| 57 | +dependencies { |
| 58 | + compile group: 'org.rundeck', name: 'rundeck-core', version: '2.10.1' |
| 59 | + pluginLibs group: 'org.codehaus.groovy.modules.http-builder', name: 'http-builder', version: '0.7.1' |
| 60 | + pluginLibs group: 'com.google.code.gson', name: 'gson', version: '2.8.2' |
| 61 | + pluginLibs group: 'com.esotericsoftware.yamlbeans', name: 'yamlbeans', version: '1.13' |
| 62 | + |
| 63 | + compile 'org.codehaus.groovy:groovy-all:2.3.11' |
| 64 | + testCompile group: 'junit', name: 'junit', version: '4.12' |
| 65 | + |
| 66 | + |
| 67 | + testCompile "org.codehaus.groovy:groovy-all:2.3.7" |
| 68 | + testCompile "org.spockframework:spock-core:0.7-groovy-2.0" |
| 69 | + testCompile "cglib:cglib-nodep:2.2.2" |
| 70 | + testCompile 'org.objenesis:objenesis:1.4' |
| 71 | + |
| 72 | +} |
| 73 | + |
| 74 | + |
| 75 | +// task to copy plugin libs to output/lib dir |
| 76 | +task copyToLib(type: Copy) { |
| 77 | + into "$buildDir/output/lib" |
| 78 | + from configurations.pluginLibs |
| 79 | +} |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +jar { |
| 84 | + from "$buildDir/output" |
| 85 | + manifest { |
| 86 | + def libList = configurations.pluginLibs.collect{'lib/' + it.name}.join(' ') |
| 87 | + attributes 'Rundeck-Plugin-Classnames': pluginClassNames |
| 88 | + attributes 'Rundeck-Plugin-File-Version': project.version |
| 89 | + attributes 'Rundeck-Plugin-Version': rundeckPluginVersion |
| 90 | + attributes 'Rundeck-Plugin-Archive': 'true' |
| 91 | + attributes 'Rundeck-Plugin-Libs': "${libList}" |
| 92 | + } |
| 93 | + dependsOn(copyToLib) |
| 94 | +} |
| 95 | + |
| 96 | + |
| 97 | +//set jar task to depend on copyToLib |
| 98 | +jar.dependsOn(copyToLib) |
| 99 | + |
| 100 | +task wrapper(type: Wrapper) { |
| 101 | + gradleVersion = '3.3' |
| 102 | + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" |
| 103 | +} |
0 commit comments