gradle's new plugins dsl syntax

前端 未结 1 1152
醉梦人生
醉梦人生 2021-01-17 01:55

I\'m currently learning gradle build tool, specifically the new plugins DSL syntax, in the documentation. In the link, the author mentioned

I understand t

相关标签:
1条回答
  • 2021-01-17 02:37

    Project interface inherits from PluginAware interface, and this is where 'plugins' feature is handled : see method specification https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/PluginAware.html#getPlugins--

    But in fact, the plugins { } syntax is not related to a property or methods from Project class: its a kind of script block which is handled by Gradle in a special way, like buildScript block. You will find details about that in the official documentation there: https://docs.gradle.org/current/dsl/org.gradle.plugin.use.PluginDependenciesSpec.html

    Note: I recommend that you to check the DSL documentation instead of the Javadoc (or in addition to the Javadoc): I think it provides better description of what you can use when writting build scripts, with examples. The 'plugins' property for example is documented there : https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#org.gradle.api.Project:plugins

    regards.

    0 讨论(0)
提交回复
热议问题