简体   繁体   中英

Converting kotlin DSL back to groovy?

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()

Shot in the dark:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM