ClassCastException: Gradle treets Groovy GStringImpl as Java String


(Carlo Luib-Finetti) #1

There is a nice little tutorial on Groovy at http://groovykoans.org/ resp. https://github.com/nadavc/groovykoans. This worked with an Gradle 1.1, but now runs into a ClassCastException. I cannot figure out why I think it is due to this projects dynamic task definition based on a rule pattern…

java.lang.ClassCastException: org.codehaus.groovy.runtime.GStringImpl cannot be cast to java.lang.St
ring
        at org.gradle.api.tasks.util.PatternSet.getAsSpec(PatternSet.java:124)
        at org.gradle.api.tasks.util.PatternSet$IntersectionPatternSet.getAsSpec(PatternSet.java:102
)
        at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:114)
(...)

(René Groeschke) #2

Hello Carlo, Thanks for reporting, you’re running into a known issue: (GRADLE-2566). We already fixed this on master.

cheers, René