Skip to content

Commit

Permalink
Remove annotation on the gemWorkDir to prevent exec tasks from being …
Browse files Browse the repository at this point in the history
…'up-to-date'

Fixes #91
  • Loading branch information
R. Tyler Croy committed Dec 14, 2014
1 parent 9f6c74b commit 6bcfe7a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/groovy/com/github/jrubygradle/JRubyExec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class JRubyExec extends JavaExec {
@Input
String jrubyVersion


/** Directory to use for unpacking GEMs.
* This is optional. If not set, then an internal generated folder will be used. In general the latter behaviour
* is preferred as it allows for isolating different {@code JRubyExec} tasks. However, this functionality is made
Expand All @@ -77,11 +76,11 @@ class JRubyExec extends JavaExec {
* @since 0.1.9
*/
@Optional
@OutputDirectory
File getGemWorkDir() {
gemWorkDir ? project.file(gemWorkDir) : tmpGemDir()
}


JRubyExec() {
super()
super.setMain 'org.jruby.Main'
Expand Down

2 comments on commit 6bcfe7a

@ysb33r
Copy link
Contributor

@ysb33r ysb33r commented on 6bcfe7a Dec 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the wrong fix. I am not sure what you original build.gradle looked like, but I think you are compensating for the problem in the wrong place.

@rtyler
Copy link
Member

@rtyler rtyler commented on 6bcfe7a Dec 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simple task like:

task spec(type: JRubyExec) {
    group 'JRuby'
    description 'Execute the RSpecs in JRuby'
    jrubyArgs '-S'
    script 'rspec'
}

Will only ever run once without this change. The only way around that is to ensure that the gemWorkDir is being removed every single run of tests. Unfortunately since there aren't files that need to be "build" there's no realistic way that I know of to execute the task contigent on an "input" changing

Please sign in to comment.