Skip to content

Commit 7e13011

Browse files
committed
Proposed JRuby version can be optional
1 parent b308fd2 commit 7e13011

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

base-plugin/src/main/groovy/com/github/jrubygradle/JRubyExec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
184184
/** If it is required that a JRubyExec task needs to be executed with a different version of JRuby that the
185185
* globally configured one, it can be done by setting it here.
186186
*
187-
* @deprecated Use{@code jruby.getJrubyVersion( )} instead.
187+
* @deprecated Use{@code jruby.getProposedJRubyVersion( )} instead.
188188
*
189189
*/
190190
@Deprecated
191191
String getJrubyVersion() {
192-
deprecated('Use jruby.getJrubyVersion() rather getJrubyVersion()')
192+
deprecated('Use jruby.getProposedJRubyVersion() rather getProposedJRubyVersion()')
193193
jruby.jrubyVersion
194194
}
195195

base-plugin/src/main/groovy/com/github/jrubygradle/JRubyPluginExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class JRubyPluginExtension extends AbstractCombinedProjectTaskExtension {
111111
*/
112112
@Deprecated
113113
String getDefaultVersion() {
114-
deprecated('Use getJrubyVersion() rather than getDefaultVersion()')
114+
deprecated('Use getProposedJRubyVersion() rather than getDefaultVersion()')
115115
getJrubyVersion()
116116
}
117117

base-plugin/src/main/groovy/com/github/jrubygradle/JRubyPrepare.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class JRubyPrepare extends AbstractJRubyPrepare {
6262
* @return Intended version of JRuby.
6363
*/
6464
@Override
65-
protected String getJrubyVersion() {
65+
protected String getProposedJRubyVersion() {
6666
jruby.jrubyVersion
6767
}
6868

base-plugin/src/test/groovy/com/github/jrubygradle/JRubyExecTaskSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ class JRubyExecTaskSpec extends Specification {
7272
when:
7373
project.configure(execTask) {
7474
jruby.gemConfiguration configurationName
75-
jruby.jrubyVersion newVersion
75+
jruby.getProposedJRubyVersion newVersion
7676
}
7777
project.evaluate()
7878

7979
then:
80-
execTask.jruby.jrubyVersion != project.jruby.jrubyVersion
80+
execTask.jruby.jrubyVersion != project.jruby.getProposedJRubyVersion
8181

8282
and: "jrubyConfigurationName must point to this new configuration"
8383
execTask.jruby.getGemConfiguration().name == configurationName

core-plugin/src/main/groovy/com/github/jrubygradle/api/core/AbstractJRubyPrepare.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ abstract class AbstractJRubyPrepare extends DefaultTask implements JRubyAwareTas
110110
*
111111
* This method should not resolve any files to obtain the version.
112112
*
113-
* @return Intended version of JRuby.
113+
* @return Intended version of JRuby. Can be {@code null} if the version
114+
* is indirectly inferred via configuration.
114115
*/
115116
@Input
116-
abstract protected String getJrubyVersion()
117+
@Optional
118+
abstract protected String getProposedJRubyVersion()
117119

118120
@TaskAction
119121
void exec() {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=2.0.0-alpha.5
1+
version=2.0.0-alpha.6
22
group=com.github.jruby-gradle
33
copyrightYear=2014-2019
44

0 commit comments

Comments
 (0)