Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference apply from vs apply plugin

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

like image 824
Ari Avatar asked Mar 31 '15 20:03

Ari


People also ask

What is apply from in Gradle?

#1 Use 'apply' to structure the script content In Gradle apply command can be used to apply not only plugins, but also script files (*). In this way you can divide your main build. gradle file into smaller parts, and move extra tasks like jacoco report and findbugs to the separate files.

What is the difference between plugins and dependencies in Gradle?

Gradle will use the added plugins at the time of building the App. Dependecies are used to add some addtional code to your source code, so a dependency will make some extra code (like Classes in Java) in the form of library available for your source code.

Which are the two types of plugins in Gradle?

There are two types of plugins one is script plugin and second is binary plugin.

What is Android plugin Application?

apply plugin: 'android' specifies that It's an Android project but it does not specify Its an Application or Library project. To make life easier you can tell gradle the type of project and indicate which plugin should be used. I recommend to use apply plugin: 'com. android.


1 Answers

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.

like image 195
Amnon Shochot Avatar answered Sep 22 '22 22:09

Amnon Shochot