什么是应用插件:'java' [英] What is apply plugin: 'java'
问题描述
Gradle的构建脚本为您提供了Groovy的全部功能。
我碰到以下命令:
apply plugin:'java'
我试图从Groovy的角度去寻找它意味着什么,但我不知道。是否有Groovy等价物?
您看到的是Groovy为方法调用提供的语法糖。 [方法调用中没有大括号&隐式映射强制]
$ b
apply plugin:'java'
与 apply([插件:'java'])
apply()
。默认情况下,API和项目
实例在Gradle构建脚本中可用。 (在Groovy术语中,项目
)
As said in the Gradle documentation, section 6.4:
Gradle's build scripts give you the full power of Groovy.
I come across the following command:
apply plugin: 'java'
I tried to googling to encquire what it means at the Groovy point of view, but I have no idea. Is there a Groovy equivalent at all?
What you see is a syntactic sugar provided by Groovy for a method call. [No braces in method calls & implicit map coercion]
apply plugin: 'java'
is same as apply([plugin: 'java'])
apply()
is available in Gradle's Project API and project
instance is available in Gradle build script by default. (In Groovy terms, operations in build.gradle
is delegated to project
)
这篇关于什么是应用插件:'java'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!