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:
R. Tyler Croy 2015-09-09 15:33:56 -07:00
parent a6d92230c9
commit ca083054b4
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 36 additions and 2 deletions

View File

@ -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() {

View File

@ -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
}
}