2014-10-22 16:59:42 +00:00
|
|
|
buildscript {
|
|
|
|
repositories { jcenter() }
|
|
|
|
dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' }
|
|
|
|
}
|
|
|
|
|
2014-10-20 21:18:55 +00:00
|
|
|
plugins {
|
|
|
|
id "com.github.jruby-gradle.jar" version "0.1.2"
|
|
|
|
// https://github.com/jruby-gradle/jruby-gradle-jar-plugin/issues/18
|
2014-11-02 01:01:53 +00:00
|
|
|
id "com.github.jruby-gradle.base" version "0.1.4"
|
2014-10-20 21:18:55 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "1.1.2"
|
|
|
|
}
|
2014-10-22 16:59:42 +00:00
|
|
|
|
2014-10-20 21:18:55 +00:00
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'java'
|
2014-10-22 16:59:42 +00:00
|
|
|
apply plugin: 'com.jfrog.bintray'
|
2014-10-20 21:18:55 +00:00
|
|
|
|
|
|
|
|
2014-11-02 01:01:53 +00:00
|
|
|
version = '0.7.1'
|
2014-10-22 16:59:42 +00:00
|
|
|
group = 'com.github.jruby-gradle'
|
2014-10-21 22:49:18 +00:00
|
|
|
sourceCompatibility = 1.7
|
|
|
|
|
2014-10-22 16:59:42 +00:00
|
|
|
if (System.env.RELEASE != '1') {
|
|
|
|
version = "${version}-SNAPSHOT"
|
|
|
|
}
|
|
|
|
|
2014-10-20 21:18:55 +00:00
|
|
|
import com.github.jrubygradle.JRubyExec
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
|
|
|
|
maven { url 'http://clojars.org/repo/' }
|
|
|
|
maven { url 'http://conjars.org/repo/' }
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile group: 'com.github.jnr', name: 'jffi', version: '1.2.7'
|
|
|
|
|
|
|
|
compile group: 'org.apache.storm',
|
|
|
|
name: 'storm-core',
|
|
|
|
version: '0.9.2-incubating'
|
2014-10-20 21:43:58 +00:00
|
|
|
|
|
|
|
jrubyExec group: 'rubygems', name: 'rspec', version: '2.13+'
|
|
|
|
jrubyExec group: 'rubygems', name: 'coveralls', version: '0.6.7+'
|
2014-10-20 21:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
2014-11-02 01:01:53 +00:00
|
|
|
// We don't need to include storm-core in the runtime dependencies for the
|
|
|
|
// redstorm.jar since it's provided by the storm cluster this code runs on top of
|
2014-10-20 21:18:55 +00:00
|
|
|
runtime.exclude module: 'storm-core'
|
2014-10-20 21:43:58 +00:00
|
|
|
jrubyExec.extendsFrom compile
|
2014-10-20 21:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
srcDirs 'src/main',
|
|
|
|
"${buildDir}/generated/java"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task compileRedstormJRuby(type: JRubyExec) {
|
|
|
|
group 'build'
|
|
|
|
description "Compile the right Ruby files to Java files for compilation"
|
|
|
|
workingDir 'lib/red_storm'
|
|
|
|
jrubyArgs '-S'
|
|
|
|
script 'jrubyc'
|
|
|
|
scriptArgs '--prefix', 'red_storm',
|
|
|
|
'--java',
|
|
|
|
'--target', '../../build/generated/java',
|
|
|
|
'topology_launcher.rb'
|
|
|
|
|
|
|
|
file("${buildDir}/generated/java").mkdirs()
|
|
|
|
}
|
|
|
|
|
|
|
|
project.compileJava.dependsOn compileRedstormJRuby
|
|
|
|
|
2014-10-20 21:43:58 +00:00
|
|
|
task spec(type: JRubyExec) {
|
|
|
|
group 'JRuby'
|
|
|
|
description 'Run the RSpec examples'
|
|
|
|
jrubyArgs '-S'
|
|
|
|
script 'rspec'
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-22 16:59:42 +00:00
|
|
|
jar {
|
|
|
|
from 'lib'
|
|
|
|
}
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 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 = 'libraries'
|
|
|
|
name = 'redstorm'
|
|
|
|
labels = ['jruby', 'redstorm', 'storm']
|
|
|
|
|
|
|
|
version {
|
|
|
|
name = project.version
|
|
|
|
vcsTag = "v${project.version}"
|
|
|
|
desc = 'JRuby integration & DSL for the Storm distributed realtime computation system'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bintrayUpload.dependsOn assemble
|
|
|
|
|
2014-10-20 21:18:55 +00:00
|
|
|
// vim: ft=groovy et ts=4 sw=4
|
|
|
|
|