Skip to content
This repository was archived by the owner on May 19, 2019. It is now read-only.

Commit 39a120d

Browse files
committed
Fixed the dependency 'jar' from 'java' plugin needs to have on 'jrubyPrepareGems'
1 parent 1d9c3ca commit 39a120d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/groovy/com/github/jrubygradle/jar/JRubyJarPlugin.groovy

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ class JRubyJarPlugin implements Plugin<Project> {
3333
project.tasks.whenTaskAdded { Task t ->
3434
if(t.name == 'test' && t instanceof Test) {
3535
project.configure(t,testConfiguration)
36-
} else if (t.name == 'jar' && t instanceof Jar) {
36+
}
37+
}
38+
}
39+
try {
40+
Task t = project.tasks.getByName('jar')
41+
if( t instanceof Jar) {
42+
t.dependsOn 'jrubyPrepareGems'
43+
}
44+
} catch(UnknownTaskException) {
45+
project.tasks.whenTaskAdded { Task t ->
46+
if (t.name == 'jar' && t instanceof Jar) {
3747
t.dependsOn 'jrubyPrepareGems'
3848
}
3949
}

0 commit comments

Comments
 (0)