从Groovy DSL迁移至Kotlin DSL:namespace与unitTests配置转换求助
Android Groovy DSL 转 Kotlin DSL 配置示例
1. Namespace 配置
原Groovy DSL写法:
android { namespace "com.example" }
对应的Kotlin DSL写法:
android { namespace = "com.example" }
2. 单元测试配置
原Groovy DSL写法:
android { testOptions { unitTests.returnDefaultValues = true } }
对应的Kotlin DSL写法:
android { testOptions { unitTests.isReturnDefaultValues = true } }
内容的提问来源于stack exchange,提问作者Joe Dow
相关产品推荐
相关产品推荐

