非弃用的 PackagingOptions?
Non-deprecated PackagingOptions?
根据当前 documentation,在我看来所有的打包选项都已弃用?那么,应该用什么?
例如目前我使用
packagingOptions {
merge 'META-INF/NOTICE.md'
merge 'META-INF/LICENSE.md'
}
但合并描述为 deprecated:
根据源码注释:
@Deprecated(
"This property is deprecated. Use resources.merges instead.",
replaceWith = ReplaceWith("resources.merges")
)
val merges: MutableSet<String>
@Deprecated(
"This method is deprecated. Use resources.merges.add() instead.",
replaceWith = ReplaceWith("resources.merges.add(pattern)")
)
fun merge(pattern: String)
这样,就变成了:
// In build.gradle.kts
android {
packagingOptions {
resources {
merges.add("META-INF/NOTICE.md")
}
}
}
根据当前 documentation,在我看来所有的打包选项都已弃用?那么,应该用什么?
例如目前我使用
packagingOptions {
merge 'META-INF/NOTICE.md'
merge 'META-INF/LICENSE.md'
}
但合并描述为 deprecated:
根据源码注释:
@Deprecated(
"This property is deprecated. Use resources.merges instead.",
replaceWith = ReplaceWith("resources.merges")
)
val merges: MutableSet<String>
@Deprecated(
"This method is deprecated. Use resources.merges.add() instead.",
replaceWith = ReplaceWith("resources.merges.add(pattern)")
)
fun merge(pattern: String)
这样,就变成了:
// In build.gradle.kts
android {
packagingOptions {
resources {
merges.add("META-INF/NOTICE.md")
}
}
}