File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
jruby-gradle-jar-plugin/src
integTest/groovy/com/github/jrubygradle/jar
main/groovy/com/github/jrubygradle/jar Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -263,4 +263,39 @@ task validateJar(type: Exec) {
263
263
/* see: https://github.com/jruby-gradle/jruby-gradle-plugin/issues/191 */
264
264
result. standardOutput. contains(' unexpected behavior' )
265
265
}
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
+ }
266
301
}
Original file line number Diff line number Diff line change @@ -274,6 +274,7 @@ class JRubyJar extends Jar {
274
274
void addEmbeddedDependencies (Configuration config ) {
275
275
/* To ensure that we can load our jars properly, we should always have
276
276
* jar-dependencies in our resolution graph */
277
+ project. dependencies. add(config. name, ' rubygems:jar-dependencies:[0.1.15,)' )
277
278
}
278
279
279
280
/* * Update the staging directory and tasks responsible for setting it up */
You can’t perform that action at this time.
0 commit comments