检测可能位置错误的 Gradle 方法调用。
Gradle buildscripts 包含许多嵌套闭包,使得代码结构类似于标记语言。 由于 DSL 语言的行为,可以在外部闭包中编写的方法也可以在内部闭包中使用。 此类方法在其范围之外编写时可能没有任何意义。示例:
repositories {
// 'repositories' 的委托具有方法 'exclusiveContent',可在此处编写
maven {
// 'maven' 的委托具有方法 'content',可在此处编写
// 但也可使用 'exclusiveContent'
exclusiveContent {} // 报告 'exclusiveContent'
}
}