Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is mean of 'apply from' in gradle?

When I run this gradle task

-Pcons=value anyTask --stacktrace --info --debug

It executes the build.gradle file. And this file contains the line

apply from:"another.gradle"

In this scenario when I run anyTask, does all the code in another.gradle work? Or is it just accessible?

like image 246
Mustafa Taşdemir Avatar asked Oct 16 '25 14:10

Mustafa Taşdemir


1 Answers

This is the way how script plugins are apllied. This is how it's described in the official docs.

Script plugins are additional build scripts that further configure the build and usually implement a declarative approach to manipulating the build. They are typically used within a build although they can be externalized and accessed from a remote location.

And

Script plugins are automatically resolved and can be applied from a script on the local filesystem or at a remote location. Filesystem locations are relative to the project directory, while remote script locations are specified with an HTTP URL. Multiple script plugins (of either form) can be applied to a given target.

like image 178
Stanislav Avatar answered Oct 18 '25 04:10

Stanislav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!