redstorm/build.gradle

130 lines
2.8 KiB
Groovy

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: 'maven'
apply plugin: 'java'
apply plugin: 'com.jfrog.bintray'
version = '0.7.0'
group = 'com.github.jruby-gradle'
sourceCompatibility = 1.7
if (System.env.RELEASE != '1') {
version = "${version}-SNAPSHOT"
}
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'
jrubyExec group: 'rubygems', name: 'rspec', version: '2.13+'
jrubyExec group: 'rubygems', name: 'coveralls', version: '0.6.7+'
}
configurations {
runtime.exclude module: 'storm-core'
jrubyExec.extendsFrom compile
}
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
task spec(type: JRubyExec) {
group 'JRuby'
description 'Run the RSpec examples'
jrubyArgs '-S'
script 'rspec'
}
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
// vim: ft=groovy et ts=4 sw=4