Lazily include the redstorm jar to avoid compatibiity issues on Gradle 2.2

There's an issue with overriding copy() in Gradle 2.0 -> Gradle 2.2
    <https://issues.gradle.org/browse/GRADLE-3207>

    Caused by: groovy.lang.MissingMethodException: No signature of method: com.github.jrubygradle.storm.internal.JRubyStormJar_Decorated.copy() is applicable for argument types: () values: []
    Possible solutions: copy(), any(), any(groovy.lang.Closure), notify(), wait(), find()
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
        at com.github.jrubygradle.storm.internal.JRubyStormJar.copy(JRubyStormJar.groovy:43)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
This commit is contained in:
R. Tyler Croy 2015-08-14 18:53:51 -07:00
parent add7020757
commit 85fea21820
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 12 additions and 6 deletions

View File

@ -27,19 +27,25 @@ class JRubyStormJar extends JRubyJar {
JRubyStormJar() {
super()
appendix = ''
project.afterEvaluate {
this.includeRedstorm()
this.includeTopology()
}
}
@Override
void copy() {
if (parentTask) {
File redstorm = parentTask.configuration.find {
void includeRedstorm() {
from {
File redstorm = this.parentTask.configuration.find {
it.name.matches(/redstorm-(.*).jar/)
}
from { project.zipTree(redstorm) }
project.zipTree(redstorm)
}
}
void includeTopology() {
if (parentTask.topology) {
into('') { from parentTask.topology }
}
super.copy()
}
}