Provides common traits for JRuby script execution across the JRubyExec
task and {@project.jrubyexec} extension.
This trait is primarily meant as a plugin-internal interface/implementation which allows
for the asy set up and invocation of a JRuby environment unlike JRubyExec
it is not meant to directly set up or execute a Ruby script.
It's functions are primarily:
* Prepare Ruby gem dependencies
* Prepare JVm (jar) dependencies
* Set up the execution environment
After that, it is up to the actual subclass extending JRubyExecAbstractTask to
decide how it wants to execute JRuby
Type | Name and description |
---|---|
java.io.File |
_convertGemWorkDir(org.gradle.api.Project project) |
java.util.List<java.lang.String> |
_convertJrubyArgs() |
java.io.File |
_convertScript() |
java.util.List<java.lang.String> |
_convertScriptArgs() |
void |
configuration(org.gradle.api.artifacts.Configuration newConfiguration) |
void |
configuration(java.lang.String newConfiguration) |
void |
gemWorkDir(java.lang.Object workingDir) Set alternative GEM unpack directory to use |
java.lang.String |
getComputedPATH(java.lang.String originalPath) Return the computed `PATH` for the task |
java.lang.String |
getConfiguration() |
java.io.File |
getGemWorkDir() Returns the directory that will be used to unpack Gems into |
java.util.Map |
getPreparedEnvironment(java.util.Map env) |
void |
jrubyArgs(java.lang.Object... args) Add arguments for jruby |
void |
prepareDependencies(org.gradle.api.Project project) Prepare the Ruby and Java dependencies for the configured configuration |
void |
prepareDependencies(org.gradle.api.Project project, OverwriteAction overwrite) Prepare dependencies with a custom overwrite behavior |
void |
script(java.lang.Object scr) Set script to execute. |
void |
scriptArgs(java.lang.Object... args) Add arguments for script |
void |
scriptArgs(groovy.lang.Closure c) Add arguments for script in a closure style |
void |
setScript(java.lang.Object scr) Set script to execute. |
Allow JRubyExec to inherit a Ruby env from the shell (e.g. RVM)
JRubyExec
)Set alternative GEM unpack directory to use
workingDir
- New working directory (convertible to file)Return the computed `PATH` for the task
Returns the directory that will be used to unpack Gems into
Add arguments for jruby
args
- Additional arguments to be passed to JRuby itself.Prepare the Ruby and Java dependencies for the configured configuration This method will determine the appropriate dependency overwrite behavior from the Gradle invocation. In effect, if the --refresh-dependencies flag is used, already installed gems will be overwritten.
project
- The currently executing projectPrepare dependencies with a custom overwrite behavior
Set script to execute.
scr
- Path to script. Can be any object that is convertible to File.Add arguments for script
args
- Arguments to be aqdded to script argumentsAdd arguments for script in a closure style
args
- Arguments to be aqdded to script argumentsSet script to execute.
scr
- Path to script. Can be any object that is convertible to File.