Difference apply from vs apply plugin
Asked Answered
I

2

46

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

Incardinate answered 31/3, 2015 at 20:46 Comment(0)
I
34

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

Incardinate answered 28/5, 2018 at 13:44 Comment(0)
M
38

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.

Mischance answered 31/3, 2015 at 20:50 Comment(1)
I don't think I get the explanation on the website. Are script plugins slower? Is there an article or a discussion that expands on it more than the documentation does?Mccaslin
I
34

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

Incardinate answered 28/5, 2018 at 13:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.