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:
parent
5fdde70ae1
commit
e2f3a0ab4c
101
build.gradle
101
build.gradle
|
@ -1,41 +1,70 @@
|
||||||
//
|
//
|
||||||
// Primary gradle file for building and testing redstorm
|
// Primary gradle file for building and testing redstorm
|
||||||
//
|
//
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
plugins {
|
dependencies {
|
||||||
id "com.github.jruby-gradle.jar" version "0.1.2"
|
classpath 'com.github.jruby-gradle:jruby-gradle-jar-plugin:1.0.3'
|
||||||
// https://github.com/jruby-gradle/jruby-gradle-jar-plugin/issues/18
|
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:1.0.3'
|
||||||
id "com.github.jruby-gradle.base" version "0.1.4"
|
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2"
|
||||||
id "com.github.johnrengelman.shadow" version "1.1.2"
|
}
|
||||||
id "com.jfrog.bintray" version "0.6"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'java'
|
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'
|
group = 'com.github.jruby-gradle'
|
||||||
sourceCompatibility = 1.7
|
|
||||||
|
|
||||||
// Any time we're not expicitly saying "build me a release build" we'll change
|
// Any time we're not expicitly saying "build me a release build" we'll change
|
||||||
// the version to -SNAPSHOT
|
// the version to -SNAPSHOT
|
||||||
if (System.env.RELEASE != '1') {
|
if (!(System.env.TRAVIS_TAG as Boolean)) {
|
||||||
version = "${version}-SNAPSHOT"
|
version = "${version}-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
import com.github.jrubygradle.JRubyExec
|
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 {
|
dependencies {
|
||||||
// These compile dependencies are required just to compile our Java-based
|
// These compile dependencies are required just to compile our Java-based
|
||||||
// redstorm code
|
// redstorm code
|
||||||
compile group: 'com.github.jnr', name: 'jffi', version: '1.2.7'
|
compile 'com.github.jnr:jffi:[1.2.7,1.3)'
|
||||||
compile group: 'org.apache.storm',
|
compile 'org.apache.storm:storm-core:0.9.2-incubating'
|
||||||
name: 'storm-core',
|
// We don't yet support JRuby 9k so we'll limit ourselfs to the 1.7.x
|
||||||
version: '0.9.2-incubating'
|
compile "org.jruby:jruby-complete:[1.7.20,1.8)"
|
||||||
|
|
||||||
// Gem dependencies needed to run our Ruby development tasks like 'spec'
|
// Gem dependencies needed to run our Ruby development tasks like 'spec'
|
||||||
jrubyExec group: 'rubygems', name: 'rspec', version: '2.13+'
|
jrubyExec 'rubygems:rspec:2.99.0+'
|
||||||
jrubyExec group: 'rubygems', name: 'coveralls', version: '0.6.7+'
|
jrubyExec 'rubygems:coveralls:0.6.7+'
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -51,7 +80,6 @@ task compileRedstormJRuby(type: JRubyExec) {
|
||||||
outputs.dir(generatedDir)
|
outputs.dir(generatedDir)
|
||||||
|
|
||||||
workingDir 'lib/red_storm'
|
workingDir 'lib/red_storm'
|
||||||
jrubyArgs '-S'
|
|
||||||
script 'jrubyc'
|
script 'jrubyc'
|
||||||
scriptArgs '--prefix', 'red_storm',
|
scriptArgs '--prefix', 'red_storm',
|
||||||
'--java',
|
'--java',
|
||||||
|
@ -70,38 +98,20 @@ project.compileJava.dependsOn compileRedstormJRuby
|
||||||
task spec(type: JRubyExec) {
|
task spec(type: JRubyExec) {
|
||||||
group 'JRuby'
|
group 'JRuby'
|
||||||
description 'Run the RSpec examples'
|
description 'Run the RSpec examples'
|
||||||
jrubyArgs '-S'
|
|
||||||
script 'rspec'
|
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 {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
srcDirs 'src/main',
|
srcDirs "src/main",
|
||||||
"${buildDir}/generated/java"
|
"${buildDir}/generated/java"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In addition to all of the compiled java sources, we need to include the Ruby
|
// 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 {
|
bintray {
|
||||||
user = project.bintrayUser
|
user = project.bintrayUser
|
||||||
key = project.bintrayKey
|
key = project.bintrayKey
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
bintrayUser=
|
||||||
|
bintrayKey=
|
||||||
|
sourceCompatibility=1.7
|
||||||
|
targetCompatibility=1.7
|
||||||
|
jrubyVersion=1.7.21
|
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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
|
||||||
|
|
Loading…
Reference in New Issue