Update the build.gradle to create a re-usable .jar file with redstorm Java and Ruby code

This commit is contained in:
R. Tyler Croy 2014-10-20 14:18:55 -07:00
parent b8bff11852
commit 41cb426076
3 changed files with 69 additions and 1 deletions

View File

@ -37,6 +37,7 @@ GEM
PLATFORMS
java
ruby
DEPENDENCIES
coveralls

65
build.gradle Normal file
View File

@ -0,0 +1,65 @@
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: 'maven'
apply plugin: 'java'
version = '0.7.0-SNAPSHOT'
group = 'com.github.jruby-gradle'
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'
}
configurations {
runtime.exclude module: 'storm-core'
}
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
jar {
from 'lib'
}
// vim: ft=groovy et ts=4 sw=4

View File

@ -29,8 +29,10 @@ class TupleImpl
fieldIndex(field.to_s)
end
# Because of https://jira.codehaus.org/browse/JRUBY-6643
java_signature 'boolean isContains(Object)'
def contains?(field)
contains(field.to_s)
end
end
end