【发布时间】:2017-12-01 01:20:40
【问题描述】:
Gradle:如何获取默认资源输出目录?
println sourceSets.main.resources.outputDir
错误:
Needs to set a non-null value before it can be retrieved
【问题讨论】:
标签: gradle directory resources output source-sets
Gradle:如何获取默认资源输出目录?
println sourceSets.main.resources.outputDir
错误:
Needs to set a non-null value before it can be retrieved
【问题讨论】:
标签: gradle directory resources output source-sets
【讨论】:
对于 kotlin DSL:
sourceSets.main.get().output.resourcesDir
【讨论】:
sourceSets.main.get().output.resourcesDir 是 File 类型。要将其转换为字符串,我们应该调用sourceSets.main.get().output.resourcesDir.toString()