Skip to content

Commit ff6d735

Browse files
author
R. Tyler Croy
committed
Merge pull request #48 from ysb33r/master
JRubyWar, JRubyJar removed
2 parents de88a31 + c34a039 commit ff6d735

File tree

9 files changed

+40
-255
lines changed

9 files changed

+40
-255
lines changed

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.github.jruby-gradle'
13-
version = '0.1.0'
13+
version = '0.1.1'
1414

1515
if (System.env.RELEASE != '1') {
1616
version = "${version}-SNAPSHOT"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Aug 15 18:13:15 BST 2014
1+
#Fri Aug 22 00:43:11 BST 2014
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-all.zip
Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.jrubygradle
22

33
import org.gradle.testfixtures.ProjectBuilder
4+
import org.junit.Ignore
45
import spock.lang.*
56
import static org.gradle.api.logging.LogLevel.LIFECYCLE
67

@@ -23,33 +24,39 @@ class JRubyPluginIntegrationSpec extends Specification {
2324
project.apply plugin: 'com.github.jruby-gradle.base'
2425
}
2526

26-
@IgnoreIf({TESTS_ARE_OFFLINE})
27-
def "jrubyWar task needs to add jruby-complete jar"() {
28-
given: "That we have a test version that is different that the compiled-in defaultVersion"
29-
final String useVersion = '1.7.3'
30-
assert useVersion != project.jruby.defaultVersion
31-
new File(TESTROOT,'libs').mkdirs()
32-
new File(TESTROOT,'classes/main').mkdirs()
33-
34-
when: "We change the default version and the rubyWar task is executed (via copy)"
35-
project.jruby {
36-
defaultVersion useVersion
37-
}
38-
def jrw = project.tasks.jrubyWar
39-
project.evaluate()
40-
jrw.copy()
41-
def jar = project.configurations.jrubyWar.files.find { it.toString().find('jruby-complete') }
42-
def jarMatch = (jar !=null) ? (jar =~ /.*(jruby-complete-.+.jar)/) : jar
43-
44-
then: "We expect the task to have completed succesfully"
45-
jrw.outputs.files.singleFile.exists()
46-
47-
and: "We expect to have a jruby-complete-XXX.jar"
48-
jar != null
49-
50-
and: "jruby-complete-XXX.jar must match ${useVersion}"
51-
jarMatch != null
52-
"jruby-complete-${useVersion}.jar".toString() == jarMatch[0][1]
27+
@Ignore
28+
def "dummy test - need to decide what to do with jrubywar test"() {
29+
expect:
30+
true
5331
}
32+
//@IgnoreIf({TESTS_ARE_OFFLINE})
33+
// @Ignore
34+
// def "jrubyWar task needs to add jruby-complete jar"() {
35+
// given: "That we have a test version that is different that the compiled-in defaultVersion"
36+
// final String useVersion = '1.7.3'
37+
// assert useVersion != project.jruby.defaultVersion
38+
// new File(TESTROOT,'libs').mkdirs()
39+
// new File(TESTROOT,'classes/main').mkdirs()
40+
//
41+
// when: "We change the default version and the rubyWar task is executed (via copy)"
42+
// project.jruby {
43+
// defaultVersion useVersion
44+
// }
45+
// def jrw = project.tasks.jrubyWar
46+
// project.evaluate()
47+
// jrw.copy()
48+
// def jar = project.configurations.jrubyWar.files.find { it.toString().find('jruby-complete') }
49+
// def jarMatch = (jar !=null) ? (jar =~ /.*(jruby-complete-.+.jar)/) : jar
50+
//
51+
// then: "We expect the task to have completed succesfully"
52+
// jrw.outputs.files.singleFile.exists()
53+
//
54+
// and: "We expect to have a jruby-complete-XXX.jar"
55+
// jar != null
56+
//
57+
// and: "jruby-complete-XXX.jar must match ${useVersion}"
58+
// jarMatch != null
59+
// "jruby-complete-${useVersion}.jar".toString() == jarMatch[0][1]
60+
// }
5461
}
5562

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

Lines changed: 0 additions & 37 deletions
This file was deleted.

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

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class JRubyPlugin implements Plugin<Project> {
1313
static final String RUBYGEMS_RELEASE_URL = 'http://rubygems-proxy.torquebox.org/releases'
1414

1515
void apply(Project project) {
16-
project.apply plugin: 'java'
16+
// REMOVE: project.apply plugin: 'java'
17+
1718
project.extensions.create('jruby', JRubyPluginExtension, project)
1819

1920
if (!project.repositories.metaClass.respondsTo(project.repositories, 'rubygemsRelease')) {
@@ -29,8 +30,7 @@ class JRubyPlugin implements Plugin<Project> {
2930
}
3031

3132
project.configurations.create(JRubyExec.JRUBYEXEC_CONFIG)
32-
project.configurations.create(JRubyWar.JRUBYWAR_CONFIG)
33-
project.configurations.create(JRubyJar.JRUBYJAR_CONFIG)
33+
// MOVE: project.configurations.create(JRubyJar.JRUBYJAR_CONFIG)
3434
JRubyExecDelegate.addToProject(project)
3535

3636
// In order for jrubyWar to work we'll need to pull in the warbler
@@ -46,21 +46,9 @@ class JRubyPlugin implements Plugin<Project> {
4646
}
4747
}
4848

49-
project.dependencies {
50-
jrubyEmbeds group: 'com.lookout', name: 'warbler-bootstrap', version: '1.+'
51-
}
5249

53-
// In order to update the testing cycle we need to tell unit tests where to
54-
// find GEMs. We are assuming that if someone includes this plugin, that they
55-
// will be writing tests that includes jruby and that they might need some
56-
// GEMs as part of the tests.
57-
project.tasks.test {
58-
environment GEM_HOME : project.extensions.getByName('jruby').gemInstallDir
59-
dependsOn 'jrubyPrepareGems'
60-
}
6150

6251
JRubyExec.updateJRubyDependencies(project)
63-
JRubyWar.updateJRubyDependencies(project)
6452
}
6553

6654
project.task('jrubyClean', type: Delete) {
@@ -76,37 +64,6 @@ class JRubyPlugin implements Plugin<Project> {
7664
gems project.configurations.gems
7765
outputDir project.jruby.gemInstallDir
7866
}
79-
80-
project.task('jrubyCacheJars', type: Copy) {
81-
group TASK_GROUP_NAME
82-
description 'Cache .jar-based dependencies into .jarcache/'
83-
84-
from project.configurations.jrubyWar
85-
into ".jarcache"
86-
include '**/*.jar'
87-
}
88-
89-
project.task('jrubyPrepare') {
90-
group TASK_GROUP_NAME
91-
description 'Pre-cache and prepare all dependencies (jars and gems)'
92-
dependsOn project.tasks.jrubyCacheJars, project.tasks.jrubyPrepareGems
93-
}
94-
95-
// Only jRubyWar will depend on jrubyPrepare. Other JRubyWar tasks created by
96-
// build script authors will be under their own control
97-
// jrubyWar task will use jrubyWar as configuration
98-
project.task('jrubyWar', type: JRubyWar) {
99-
group JRubyPlugin.TASK_GROUP_NAME
100-
description 'Create a JRuby-based web archive'
101-
dependsOn project.tasks.jrubyPrepare
102-
classpath project.configurations.jrubyWar
103-
}
104-
105-
project.task('jrubyJar', type: JRubyJar) {
106-
group JRubyPlugin.TASK_GROUP_NAME
107-
dependsOn project.tasks.jrubyPrepare
108-
dependsOn project.tasks.classes
109-
}
11067
}
11168

11269
}

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

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/test/groovy/com/github/jrubygradle/JRubyJarSpec.groovy

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/test/groovy/com/github/jrubygradle/JRubyPluginTest.groovy

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@ class JRubyPluginTest {
3434
assertTrue(project.tasks.jrubyPrepareGems instanceof JRubyPrepareGems)
3535
}
3636

37-
@Test
38-
public void jrubyPluginAddsJarTasks() {
39-
assertTrue(project.tasks.jrubyCacheJars instanceof AbstractCopyTask)
40-
}
41-
42-
@Test
43-
public void jrubyPluginAddsPrimaryTasks() {
44-
assertTrue(project.tasks.jrubyPrepare instanceof Task)
45-
assertTrue(project.tasks.jrubyWar instanceof War)
46-
assertTrue(project.tasks.jrubyJar instanceof Jar)
47-
assertTrue(project.tasks.jrubyClean instanceof Delete)
48-
}
49-
5037
@Test
5138
public void jrubyPluginSetsRepositoriesCorrectly() {
5239
project.evaluate()

src/test/groovy/com/github/jrubygradle/JRubyWarSpec.groovy

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)