我是新手,我在build.gradle.kts中发现依赖项because clauses/statements
dependencies { implementation("commons-io:commons-io") { because("IOUtils") } implementation("org.apache.commons:commons-text") { because("StringEscapeUtils") }
我在任何Gradle dependencies documentation中都找不到这样的原因,因为条款
这仅仅是一个类似于添加Java文档的自定义子句,并且可以重命名为任何字符串为myreason("""my reason is other""")
或者becasue
语句是Gradle使用的吗?
答案 0 :(得分:3)
您可以在org.gradle.api.artifacts.Dependency
界面上找到它
@Incubating
@Nullable
String getReason()
Returns a reason why this dependency should be used, in particular with regards to its version. The dependency report will use it to explain why a specific dependency was selected, or why a specific dependency version was used.
Returns:
a reason to use this dependency
Since:
4.6
@Incubating
void because(@Nullable
String reason)
Sets the reason why this dependency should be used.
Since:
4.6