Converting kotlin DSL back to groovy?

Viewed 1329

I'm having a difficult time figuring out the syntax for any of this. I'd love to be able to convert my groovy gradle file to kotlin, but it's 400+ lines and that's not feasible at the moment.

I'd like to know how to write this kotlin code in groovy:

filteringConfiguration {
        whitelist {
            add(SimpleClassnameFilter(".*".toRegex()))
        }
        blacklist {
            add(SimpleClassnameFilter("$^".toRegex()))
        }
    }
    testClassRegexes = listOf("^((?!Abstract).)*Test$")
    includeSerialRegexes = emptyList()
    excludeSerialRegexes = emptyList()
1 Answers

Shot in the dark:

filteringConfiguration {
    whitelist {
        add(new SimpleClassnameFilter(/.*/))
    }
    blacklist {
        add(new SimpleClassnameFilter(/$^/))
    }
}
testClassRegexes = [/^((?!Abstract).)*Test$/]
includeSerialRegexes = []
excludeSerialRegexes = []
Related