简体   繁体   English

将 kotlin DSL 转换回 groovy?

[英]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.我希望能够将我的 groovy gradle 文件转换为 kotlin,但它有 400 多行,目前尚不可行。

I'd like to know how to write this kotlin code in groovy:我想知道如何在 groovy 中编写此 kotlin 代码:

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 = []

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SourceSets-Groovy-> Kotlin DSL - SourceSets - Groovy -> Kotlin DSL 循环所有 SourceSets - Groovy -> Kotlin DSL - Loop all SourceSets - Groovy -> Kotlin DSL 将 gradle 转换为 kotlin dsl 时面临问题 - facing issue in converting gradle to kotlin dsl 如何从 kotlin dsl 正确调用 groovy gradle 方法 - How to properly call groovy gradle method from kotlin dsl 将多模块 gradle 脚本转换为 kotlin dsl 时遇到问题 - Trouble converting multi-module gradle script to kotlin dsl 在没有库的情况下转换为 JSONObject 并返回 Kotlin - Converting to JSONObject and back in Kotlin without Library 如何将保护级别 build.gradle 的文件从 Gradle Groovy 迁移到 Gradle Kotlin DSL - How to migrate protect level build.gradle file from Gradle Groovy to Gradle Kotlin DSL 如何在 Android Studio Bumblebee 中将 build.gradle 从 Groovy 迁移到 Kotlin DSL? - How to Migrate build.gradle from Groovy to Kotlin DSL in Android Studio Bumblebee? 如何创建Kotlin DSL - DSL语法Kotlin - How to create Kotlin DSL - DSL syntax Kotlin 将Kotlin文件转换为java,向其添加Java代码并转换回Kotlin,就像将代码直接添加到Kotlin文件一样? - Is converting a Kotlin file to java, adding java code to it and converting back to Kotlin same as adding code directly to the Kotlin file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM