|
| 1 | +apply plugin: 'groovy' |
| 2 | +apply plugin: 'maven' |
| 3 | +apply plugin: 'com.jfrog.bintray' |
| 4 | + |
| 5 | +buildscript { |
| 6 | + repositories { jcenter() } |
| 7 | + dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' } |
| 8 | +} |
| 9 | + |
| 10 | +group = 'com.github.jruby-gradle' |
| 11 | +version = '0.1.0' |
| 12 | + |
| 13 | +if (System.env.RELEASE != '1') { |
| 14 | + version = "${version}-SNAPSHOT" |
| 15 | +} |
| 16 | +sourceCompatibility = '1.7' |
| 17 | + |
| 18 | +repositories { |
| 19 | + jcenter() |
| 20 | + mavenLocal() |
| 21 | +} |
| 22 | + |
| 23 | +dependencies { |
| 24 | + compile gradleApi() |
| 25 | + compile localGroovy() |
| 26 | + |
| 27 | + testCompile ("org.spockframework:spock-core:0.7-groovy-${gradle.gradleVersion.startsWith('1.')?'1.8':'2.0'}") { |
| 28 | + exclude module : 'groovy-all' |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +test { |
| 33 | + testLogging { |
| 34 | + showStandardStreams = true |
| 35 | + exceptionFormat "full" |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +task sourcesJar(type: Jar, dependsOn: classes) { |
| 40 | + classifier = 'sources' |
| 41 | + from sourceSets.main.allSource |
| 42 | +} |
| 43 | + |
| 44 | +artifacts { |
| 45 | + archives sourcesJar |
| 46 | +} |
| 47 | + |
| 48 | +// Ensure we don't fail in CI or on a system without these values set in |
| 49 | +// ~/.gradle/gradle.properties |
| 50 | +if (!hasProperty( 'bintrayUser' )) |
| 51 | + ext.bintrayUser = '' |
| 52 | + |
| 53 | +if (!hasProperty( 'bintrayKey' )) |
| 54 | + ext.bintrayKey = '' |
| 55 | + |
| 56 | +bintray { |
| 57 | + user = project.bintrayUser |
| 58 | + key = project.bintrayKey |
| 59 | + publish = true |
| 60 | + dryRun = false |
| 61 | + configurations = ['archives'] |
| 62 | + |
| 63 | + pkg { |
| 64 | + userOrg = 'jruby-gradle' |
| 65 | + repo = 'plugins' |
| 66 | + name = 'jruby-gradle-jar-plugin' |
| 67 | + labels = ['jruby'] |
| 68 | + |
| 69 | + version { |
| 70 | + name = project.version |
| 71 | + vcsTag = "v${project.version}" |
| 72 | + attributes = ['gradle-plugin' : 'com.github.jruby-gradle:com.github.jruby-gradle:jruby-gradle-jar-plugin'] |
| 73 | + desc = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects' |
| 74 | + |
| 75 | + } |
| 76 | + } |
| 77 | +} |
| 78 | +bintrayUpload.dependsOn assemble |
| 79 | + |
| 80 | +// vim: ft=groovy |
0 commit comments