Skip to content

Commit 8440a30

Browse files
committed
2 parents d12a48d + 9ab8182 commit 8440a30

File tree

7 files changed

+41
-22
lines changed

7 files changed

+41
-22
lines changed

CHANGELOG.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
# Changelog
22

3-
## v2.0.3
4-
5-
* s
3+
## v2.1.1
4+
5+
* Removed `jruby.gemrepo_url` extension point (*hopefully*) before anybody
6+
started using it. Renamed to `jruby.defaultGemRepo` to line up better with
7+
changes that will come in to support [multiple rubygem
8+
repos](https://github.com/rtyler/jruby-gradle-plugin/issues/13)
9+
10+
## v2.1.0
11+
12+
* [#18](https://github.com/rtyler/jruby-gradle-plugin/issues/18) allow
13+
changing the Gem installation directory by setting `jruby.gemInstallDir` in
14+
a gradle file
15+
* [#16](https://github.com/rtyler/jruby-gradle-plugin/pull/16) add the
16+
`JRubyExec` task type for executing Ruby code with the embedded JRuby
17+
dependency.
18+
* [#14](https://github.com/rtyler/jruby-gradle-plugin/pull/14) allow a user to
19+
set/choose the version of JRuby they wish to use with the plugin
620

721
## v2.0.2
822

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JRuby Gradle plugin
22

3-
[![Build Status](https://buildhive.cloudbees.com/job/rtyler/job/jruby-gradle-plugin/badge/icon)](https://buildhive.cloudbees.com/job/rtyler/job/jruby-gradle-plugin/) [![Download](https://api.bintray.com/packages/rtyler/jruby/jruby-gradle-plugin/images/download.png)](https://bintray.com/rtyler/jruby/jruby-gradle-plugin/\_latestVersion)
3+
[![Build Status](https://buildhive.cloudbees.com/job/rtyler/job/jruby-gradle-plugin/badge/icon)](https://buildhive.cloudbees.com/job/rtyler/job/jruby-gradle-plugin/) [![Download](https://api.bintray.com/packages/rtyler/jruby/jruby-gradle-plugin/images/download.png)](https://bintray.com/rtyler/jruby/jruby-gradle-plugin/\_latestVersion) [![Gitter chat](https://badges.gitter.im/rtyler/jruby-gradle-plugin.png)](https://gitter.im/rtyler/jruby-gradle-plugin)
44

55
The purpose of plugin is to encapsulate useful [Gradle](http://www.gradle.org/)
66
functionality for JRuby projects. Use of this plugin replaces the need for both
@@ -46,7 +46,7 @@ buildscript {
4646
repositories { jcenter() }
4747
4848
dependencies {
49-
classpath group: 'com.lookout', name: 'jruby-gradle-plugin', version: '2.0.+'
49+
classpath group: 'com.lookout', name: 'jruby-gradle-plugin', version: '2.1.+'
5050
}
5151
}
5252
```
@@ -186,7 +186,7 @@ You can then use that custom Gem repository with:
186186
apply plugin: 'com.lookout.jruby'
187187
188188
// Set our custom Gem repository
189-
jruby.gemrepo_url = 'http://localhost:8989/releases'
189+
jruby.defaultGemRepo = 'http://localhost:8989/releases'
190190
191191
dependencies {
192192
gems group: 'com.lookout', name: 'custom-gem', version: '1.0.+'

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
}
1111

1212
group = 'com.lookout'
13-
version = '2.0.3'
13+
version = '2.1.0'
1414

1515
if (System.env.RELEASE != '1') {
1616
version = "${version}-SNAPSHOT"

src/main/groovy/com/lookout/jruby/GemUtils.groovy

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ import org.gradle.api.file.DuplicateFileCopyingException
1111
*/
1212
class GemUtils {
1313
static Boolean extractGem(Project p, File gem) {
14-
def gemname = gemFullNameFromFile(gem.getName())
15-
File extract_dir = new File("./vendor/gems/$gemname")
14+
String gemName = gemFullNameFromFile(gem.getName())
15+
String installDir = p.jruby.gemInstallDir
16+
File extractDir = new File("./${installDir}/gems/${gemName}")
1617

17-
if (extract_dir.exists()) {
18+
if (extractDir.exists()) {
1819
return
1920
}
2021

2122
p.exec {
2223
executable "gem"
23-
args 'install', gem, '--install-dir=./vendor', '--no-ri', '--no-rdoc'
24+
args 'install', gem, "--install-dir=./${installDir}", '--no-ri', '--no-rdoc'
2425
}
2526
}
2627

@@ -33,13 +34,17 @@ class GemUtils {
3334
* @param overwrite Allow overwrite of an existing gem folder
3435
* @return
3536
*/
36-
static void extractGem(Project project, def jRubyClasspath, File gem,File destDir,boolean overwrite) {
37-
def gemname = gemFullNameFromFile(gem.name)
38-
File extract_dir = new File(destDir,gemname)
37+
static void extractGem(Project project,
38+
def jRubyClasspath,
39+
File gem,
40+
File destDir,
41+
boolean overwrite) {
42+
String gemName = gemFullNameFromFile(gem.name)
43+
File extractDir = new File(destDir, gemName)
3944

40-
if (extract_dir.exists()) {
45+
if (extractDir.exists()) {
4146
if(overwrite) {
42-
project.delete extract_dir
47+
project.delete extractDir
4348
} else {
4449
throw new DuplicateFileCopyingException("Gem ${gem.name} already exists")
4550
}

src/main/groovy/com/lookout/jruby/JRubyPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class JRubyPlugin implements Plugin<Project> {
1616
maven {
1717
// The url is in a closure to ensure that we can overwrite this
1818
// at runtime and have the right value come through.
19-
url { project.jruby.gemrepo_url }
19+
url { project.jruby.defaultGemRepo }
2020
}
2121

2222
// Required to pull in our warbler-bootstrap dependency
@@ -99,7 +99,7 @@ class JRubyPlugin implements Plugin<Project> {
9999
from "$project.buildDir/classes/main"
100100
// Bring our vendored gems into the created war file
101101
webInf {
102-
from 'vendor'
102+
from project.jruby.gemInstallDir
103103
into 'gems'
104104
}
105105

src/main/groovy/com/lookout/jruby/JRubyPluginExtension.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package com.lookout.jruby
33
import org.gradle.api.Project
44

55
class JRubyPluginExtension {
6-
76
// More details here: <http://rubygems-proxy.torquebox.org/>
8-
def String gemrepo_url = "http://rubygems-proxy.torquebox.org/releases"
9-
7+
String defaultGemRepo = 'http://rubygems-proxy.torquebox.org/releases'
8+
String gemrepo_url = defaultGemRepo
9+
String gemInstallDir = 'vendor'
1010
String defaultVersion = '1.7.13'
1111
String execVersion = defaultVersion
1212

src/test/groovy/com/lookout/jruby/JRubyPluginTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class JRubyPluginTest {
5555
@Test
5656
public void jrubyPluginCustomGemRepoUrl() {
5757
def url = 'http://junit.maven/releases'
58-
project.jruby.gemrepo_url = url
58+
project.jruby.defaultGemRepo = url
5959
assertTrue(hasRepositoryUrl(project, url))
6060
}
6161

0 commit comments

Comments
 (0)