Skip to content

Commit e4aee24

Browse files
committed
Merge pull request #59 from ysb33r/master
Fixes #57, #58
2 parents c5da59d + d3f21d0 commit e4aee24

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,34 @@ in the ```jrubyexec``` closure will cause a failure
133133
As with `JRubyExec`, `args`, `setArgs` and `main` are illegal within the `jrubyexec` closure.
134134
All other methods should work.
135135

136+
### Running a Ruby PATH command
137+
138+
Because `JRubyExec` checks for the existence of the script, it might look at first whether running Ruby commands from
139+
`PATH` could be difficult. However, this is totally possible by utilising `jrubyArgs`. Here is an example of running
140+
`rake` as task.
141+
142+
```groovy
143+
task rake( type :JRubyExec ) {
144+
jrubyArgs '-S', 'rake'
145+
script '/path/to/Rakefile'
146+
scriptArgs 'target1', 'target2'
147+
}
148+
```
149+
150+
or even
151+
152+
```groovy
153+
ext {
154+
rake = { String target ->
155+
jrubyexec {
156+
jrubyArgs '-S', 'rake'
157+
script '/path/to/Rakefile'
158+
scriptArgs target
159+
}
160+
}
161+
}
162+
```
163+
136164
## JRubyPrepareGems - A task for unpacking GEMs
137165

138166
Unpacking occurs using the default `jruby` version as set by `jruby.execVersion`.

build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1+
buildscript {
2+
repositories { jcenter() }
3+
dependencies {
4+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'
5+
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
6+
}
7+
}
8+
19
apply plugin: 'groovy'
210
apply plugin: 'maven'
311
apply plugin: 'com.jfrog.bintray'
12+
apply plugin: 'provided-base'
413
apply from: 'gradle/integration-tests.gradle'
514

6-
// Pull in the bintray gradle plugin for uploading releases
7-
buildscript {
8-
repositories { jcenter() }
9-
dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' }
10-
}
1115

1216
group = 'com.github.jruby-gradle'
1317
version = '0.1.3'
18+
archivesBaseName = 'jruby-gradle-plugin'
1419

1520
if (System.env.RELEASE != '1') {
1621
version = "${version}-SNAPSHOT"
@@ -23,6 +28,7 @@ configurations {
2328
}
2429

2530
ext {
31+
jrubyVersion = '1.7.16'
2632
jrubyClassPathFromConfiguration = { Configuration cfg ->
2733
def f = cfg.files.find { it.name.startsWith('jruby-complete-') }
2834
return f?.absolutePath
@@ -32,14 +38,13 @@ ext {
3238
project.afterEvaluate {
3339
test {
3440
systemProperties TEST_JRUBY_CLASSPATH: "${jrubyClassPathFromConfiguration(configurations.testJRubyPrepare)}"
35-
3641
}
3742
}
3843

3944
// --- up to here
4045

4146
dependencies {
42-
testJRubyPrepare 'org.jruby:jruby-complete:1.7.15'
47+
testJRubyPrepare "org.jruby:jruby-complete:${jrubyVersion}"
4348
}
4449

4550

@@ -64,6 +69,8 @@ dependencies {
6469
integrationTestCompile (spockVersion) {
6570
exclude module : 'groovy-all'
6671
}
72+
73+
provided "org.jruby:jruby-complete:${jrubyVersion}"
6774
}
6875

6976
test {

src/main/groovy/com/github/jrubygradle/GemUtils.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class GemUtils {
150150
if(!fullGem) {
151151
exclude 'cache/**'
152152
exclude 'gems/*/test/**'
153+
exclude 'gems/*/tests/**'
153154
exclude 'build_info'
154155
}
155156
}

src/main/groovy/com/github/jrubygradle/JRubyPluginExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class JRubyPluginExtension {
77
/** The default version of jruby that will be used by jrubyWar
88
*
99
*/
10-
String defaultVersion = '1.7.15'
10+
String defaultVersion = '1.7.16'
1111

1212
/** Directory for jrubyPrepare to install .gem dependencies into
1313
*

0 commit comments

Comments
 (0)