Ensure that setting of the jrubyVersion for the topology jar works properly
This contains some workarounds until jruby-gradle/redstorm#11 is fixed which will allow us to work on JRuby 9k, until then we'll default to the latest stable JRuby 1.7.x branch Fixes #23
This commit is contained in:
parent
a6d92230c9
commit
ca083054b4
|
@ -16,9 +16,22 @@ class JRubyStormJar extends JRubyJar {
|
|||
/** parent from which this task will inherit some configuration */
|
||||
JRubyStorm parentTask
|
||||
|
||||
/**
|
||||
* Return the version of JRuby safe for usage in redstorm
|
||||
*/
|
||||
@Override
|
||||
String getJrubyVersion() {
|
||||
final String inheritedVersion = super.getJrubyVersion()
|
||||
|
||||
/* if our parent has a default version that's 1.7.x, use it */
|
||||
if (inheritedVersion.matches(/1.7.(\d+)/)) {
|
||||
return inheritedVersion
|
||||
}
|
||||
/* Default to 1.7.22 <https://github.com/jruby-gradle/redstorm/issues/11> */
|
||||
return '1.7.22'
|
||||
}
|
||||
|
||||
String mainClass = REDSTORM_MAIN
|
||||
/* Default to 1.7.22 <https://github.com/jruby-gradle/redstorm/issues/11> */
|
||||
String jrubyVersion = '1.7.22'
|
||||
|
||||
@Override
|
||||
String getConfiguration() {
|
||||
|
|
|
@ -37,4 +37,25 @@ class JRubyStormJarSpec extends Specification {
|
|||
expect: "that it has no special appendix in the filename"
|
||||
task.appendix == ''
|
||||
}
|
||||
|
||||
@Issue('https://github.com/jruby-gradle/redstorm/issues/11')
|
||||
@Issue('https://github.com/jruby-gradle/jruby-gradle-storm-plugin/issues/23')
|
||||
def 'jrubyVersion should be default to 1.7.xx'() {
|
||||
given:
|
||||
JRubyStormJar task = project.task('spock', type: JRubyStormJar)
|
||||
|
||||
expect:
|
||||
task.jrubyVersion == '1.7.22'
|
||||
}
|
||||
|
||||
def "Setting jrubyVersion should override the default"() {
|
||||
given:
|
||||
final String version = '1.7.21'
|
||||
JRubyStormJar task = project.task('spock', type: JRubyStormJar) {
|
||||
jrubyVersion version
|
||||
}
|
||||
|
||||
expect:
|
||||
task.jrubyVersion == version
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue