Adjust dependencies to express more lenient ranges of JRuby and jffi

This commit also includes lots of refactoring of the build.gradle to be a bit
cleaner and reflect some of my learnings since I originally wrote the file :)
This commit is contained in:
R. Tyler Croy 2015-08-17 11:07:55 -07:00
parent 5fdde70ae1
commit e2f3a0ab4c
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 58 additions and 51 deletions

View File

@ -1,41 +1,70 @@
//
// Primary gradle file for building and testing redstorm
//
buildscript {
repositories {
jcenter()
}
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.4"
id "com.github.johnrengelman.shadow" version "1.1.2"
id "com.jfrog.bintray" version "0.6"
dependencies {
classpath 'com.github.jruby-gradle:jruby-gradle-jar-plugin:1.0.3'
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:1.0.3'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2"
}
}
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'com.github.jruby-gradle.jar'
apply plugin: 'com.jfrog.bintray'
version = '0.7.2'
version = '0.7.3'
group = 'com.github.jruby-gradle'
sourceCompatibility = 1.7
// Any time we're not expicitly saying "build me a release build" we'll change
// the version to -SNAPSHOT
if (System.env.RELEASE != '1') {
if (!(System.env.TRAVIS_TAG as Boolean)) {
version = "${version}-SNAPSHOT"
}
import com.github.jrubygradle.JRubyExec
jruby {
/* jrubyVersion defined in gradle.properties */
defaultVersion jrubyVersion
execVersion jrubyVersion
}
repositories {
jcenter()
// These two repositories are for storm dependencies
maven { url 'http://clojars.org/repo/' }
maven { url 'http://conjars.org/repo/' }
}
configurations {
// 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
runtime.exclude module: 'storm-core'
// Make sure that any task using the jrubyExec configuration inherits the
// dependencies enumerated in the `compile` configuration
jrubyExec.extendsFrom compile
}
dependencies {
// These compile dependencies are required just to compile our Java-based
// redstorm code
compile group: 'com.github.jnr', name: 'jffi', version: '1.2.7'
compile group: 'org.apache.storm',
name: 'storm-core',
version: '0.9.2-incubating'
compile 'com.github.jnr:jffi:[1.2.7,1.3)'
compile 'org.apache.storm:storm-core:0.9.2-incubating'
// We don't yet support JRuby 9k so we'll limit ourselfs to the 1.7.x
compile "org.jruby:jruby-complete:[1.7.20,1.8)"
// Gem dependencies needed to run our Ruby development tasks like 'spec'
jrubyExec group: 'rubygems', name: 'rspec', version: '2.13+'
jrubyExec group: 'rubygems', name: 'coveralls', version: '0.6.7+'
jrubyExec 'rubygems:rspec:2.99.0+'
jrubyExec 'rubygems:coveralls:0.6.7+'
}
////////////////////////////////////////////////////////////////////////////////
@ -51,7 +80,6 @@ task compileRedstormJRuby(type: JRubyExec) {
outputs.dir(generatedDir)
workingDir 'lib/red_storm'
jrubyArgs '-S'
script 'jrubyc'
scriptArgs '--prefix', 'red_storm',
'--java',
@ -70,38 +98,20 @@ project.compileJava.dependsOn compileRedstormJRuby
task spec(type: JRubyExec) {
group 'JRuby'
description 'Run the RSpec examples'
jrubyArgs '-S'
script 'rspec'
dependsOn compileJava
}
check.dependsOn spec
////////////////////////////////////////////////////////////////////////////////
repositories {
mavenCentral()
// These two repositories are for storm dependencies
maven { url 'http://clojars.org/repo/' }
maven { url 'http://conjars.org/repo/' }
}
configurations {
// 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
runtime.exclude module: 'storm-core'
// Make sure that any task using the jrubyExec configuration inherits the
// dependencies enumerated in the `compile` configuration
jrubyExec.extendsFrom compile
}
sourceSets {
main {
java {
srcDirs 'src/main',
"${buildDir}/generated/java"
main {
java {
srcDirs "src/main",
"${buildDir}/generated/java"
}
}
}
}
// In addition to all of the compiled java sources, we need to include the Ruby
@ -121,15 +131,6 @@ artifacts {
}
// 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

6
gradle.properties Normal file
View File

@ -0,0 +1,6 @@
bintrayUser=
bintrayKey=
sourceCompatibility=1.7
targetCompatibility=1.7
jrubyVersion=1.7.21

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip