Skip to content

Commit 190de1b

Browse files
author
R. Tyler Croy
authored
Merge pull request #274 from rtyler/jrubyjar-jar-dependencies
Allow JRubJar jar-dependencies to be upgraded
2 parents e946ad5 + e0ec117 commit 190de1b

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

jruby-gradle-jar-plugin/src/integTest/groovy/com/github/jrubygradle/jar/JRubyJarIntegrationSpec.groovy

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,39 @@ task validateJar(type: Exec) {
263263
/* see: https://github.com/jruby-gradle/jruby-gradle-plugin/issues/191 */
264264
result.standardOutput.contains('unexpected behavior')
265265
}
266+
267+
268+
@Issue('https://github.com/jruby-gradle/jruby-gradle-plugin/pull/271')
269+
def 'using a more recent jar-dependencies should work'() {
270+
given:
271+
buildFile << """
272+
repositories {
273+
maven { url 'http://rubygems.lasagna.io/proxy/maven/releases' }
274+
}
275+
dependencies {
276+
jrubyJar 'rubygems:jar-dependencies:0.2.3'
277+
}
278+
jrubyJar { initScript 'main.rb' }
279+
280+
task validateJar(type: Exec) {
281+
dependsOn jrubyJar
282+
environment [:]
283+
workingDir "\${buildDir}/libs"
284+
commandLine 'java', '-jar', jrubyJar.outputs.files.singleFile.absolutePath
285+
}
286+
"""
287+
288+
when:
289+
BuildResult result = GradleRunner.create()
290+
.withProjectDir(testProjectDir.root)
291+
.withArguments('validateJar', '--info')
292+
.build()
293+
294+
then:
295+
builtArtifacts && builtArtifacts.size() == 1
296+
297+
and:
298+
result.task(":validateJar").outcome == TaskOutcome.SUCCESS
299+
result.standardOutput.contains("Hello from JRuby")
300+
}
266301
}

jruby-gradle-jar-plugin/src/main/groovy/com/github/jrubygradle/jar/JRubyJar.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class JRubyJar extends Jar {
274274
void addEmbeddedDependencies(Configuration config) {
275275
/* To ensure that we can load our jars properly, we should always have
276276
* jar-dependencies in our resolution graph */
277-
project.dependencies.add(config.name, 'rubygems:jar-dependencies:0.1.15')
277+
project.dependencies.add(config.name, 'rubygems:jar-dependencies:[0.1.15,)')
278278
}
279279

280280
/** Update the staging directory and tasks responsible for setting it up */

0 commit comments

Comments
 (0)