Difference apply from vs apply plugin

2019-03-22 22:49发布

Is there a difference except that:

apply from: - gets the (plugin).gradle from a URL

apply plugin: - gets the (plugin).gradle from the gradle plugin server

2条回答
Summer. ? 凉城
2楼-- · 2019-03-22 23:23

The actual difference between apply from: and apply plugin: is that the former is to be used for script plugins given a path to the local file system or a URL to a remote location, and the latter is used for binary plugins using the plugin id.

You can read more about it in Gradle documentation here.

查看更多
我只想做你的唯一
3楼-- · 2019-03-22 23:41

apply from:

  • calls the script directly as if it was part of the build file

See https://docs.gradle.org/current/userguide/plugins.html#sec:script_plugins

apply plugin:

  • calls the Plugin.apply() interface

See https://docs.gradle.org/current/userguide/plugins.html#sec:binary_plugins

查看更多
登录 后发表回答