Difference apply from vs apply plugin

痴心易碎 提交于 2019-12-20 11:57:13

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/29378249/difference-apply-from-vs-apply-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!