-
-
Save rtyler/dfbf7b68df0bd2bfa854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { jcenter() } | |
dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' } | |
} | |
plugins { | |
id "com.github.jruby-gradle.jar" version "0.1.2" | |
// https://github.com/jruby-gradle/jruby-gradle-jar-plugin/issues/18 | |
id "com.github.jruby-gradle.base" version "0.1.3" | |
id "com.github.johnrengelman.shadow" version "1.1.2" | |
} | |
apply plugin: 'groovy' | |
apply plugin: 'java' | |
apply plugin: 'maven' | |
apply plugin: 'com.jfrog.bintray' | |
group = 'com.github.jruby-gradle' | |
version = '0.1.0' | |
if (System.env.RELEASE != '1') { | |
version = "${version}-SNAPSHOT" | |
} | |
sourceCompatibility = '1.7' | |
repositories { | |
jcenter() | |
mavenLocal() | |
mavenCentral() | |
maven { | |
url 'http://clojars.org/repo/' | |
} | |
maven { | |
url 'http://conjars.org/repo/' | |
} | |
} | |
configurations { | |
compile.exclude module: 'storm-core' | |
} | |
dependencies { | |
compile gradleApi() | |
compile localGroovy() | |
compile group: 'com.github.jruby-gradle', name: 'jruby-gradle-plugin', version: '0.1.3+' | |
compile group: 'com.github.jruby-gradle', name: 'jruby-gradle-jar-plugin', version: '0.1.2+' | |
compile group: 'com.github.jruby-gradle', name: 'redstorm', version: '0.7.0-SNAPSHOT' | |
jrubyEmbeds group: 'org.apache.storm', | |
name: 'storm-core', | |
version: '0.9.1-incubating' | |
testCompile ("org.spockframework:spock-core:0.7-groovy-${gradle.gradleVersion.startsWith('1.')?'1.8':'2.0'}") { | |
exclude module : 'groovy-all' | |
} | |
} | |
test { | |
testLogging { | |
showStandardStreams = true | |
exceptionFormat "full" | |
} | |
} | |
task sourcesJar(type: Jar, dependsOn: classes) { | |
classifier = 'sources' | |
from sourceSets.main.allSource | |
} | |
artifacts { | |
archives sourcesJar | |
} | |
task localTest(type: JavaExec) { | |
classpath configurations.compile.asPath | |
main '-jar' | |
args shadowJar.archivePath, 'local', 'hello_world_topology.rb' | |
dependsOn shadowJar | |
} | |
jar { | |
from 'hello_world_topology.rb' | |
} | |
shadowJar { | |
exclude '*.sw*', '*.gitkeep', '*.md' | |
// note that zipTree call is wrapped in closure so that configuration | |
// is only resolved at execution time. This will take the embeds | |
// from within the `jrubyEmbeds` configuration and dump them into the war | |
from { | |
project.configurations.jrubyEmbeds.collect { | |
project.zipTree(it) | |
} | |
} | |
jruby { | |
// Use the default GEM installation directory | |
defaultGems() | |
mainClass 'redstorm.TopologyLauncher' | |
} | |
} | |
// Ensure we don't fail in CI or on a system without these values set in | |
// ~/.gradle/gradle.properties | |
if (!hasProperty( 'bintrayUser' )) | |
ext.bintrayUser = '' | |
if (!hasProperty( 'bintrayKey' )) | |
ext.bintrayKey = '' | |
bintray { | |
user = project.bintrayUser | |
key = project.bintrayKey | |
publish = true | |
dryRun = false | |
configurations = ['archives'] | |
pkg { | |
userOrg = 'jruby-gradle' | |
repo = 'plugins' | |
name = 'jruby-gradle-storm-plugin' | |
labels = ['jruby','storm','java'] | |
version { | |
name = project.version | |
vcsTag = "v${project.version}" | |
attributes = ['gradle-plugin' : 'com.github.jruby-gradle:com.github.jruby-gradle:jruby-gradle-storm-plugin'] | |
desc = 'This plugin encapsulates Storm topology building functionality for JRuby Gradle projects' | |
} | |
} | |
} | |
bintrayUpload.dependsOn assemble | |
// vim: ft=groovy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment