I don't understand gradle plugins block
apply plugin: 'someplugin1' apply plugin: 'maven'
and other one:
plugins { id 'org.hidetake.ssh' version '1.1.2' }
In first block We have some plugin name. in second one package and version. I don't understand where I should use first block and when second one.
Applying a plugin to a project allows the plugin to extend the project's capabilities. It can do things such as: Extend the Gradle model (e.g. add new DSL elements that can be configured) Configure the project according to conventions (e.g. add new tasks or configure sensible defaults)
Android Gradle plugin 7.2.
Gradle is the build system. You can use it with a lot of plugins. One of these is the Android Gradle plugin. It is used to provide processes and configurable settings that are specific to building and testing Android applications.
The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
The plugins
block is the newer method of applying plugins, and they must be available in the Gradle plugin repository. The apply
approach is the older, yet more flexible method of adding a plugin to your build.
The new plugins
method does not work in multi-project configurations (subprojects
, allprojects
), but will work on the build configuration for each child project.
I would think that as functionality progresses, the plugins
configuration method will overtake the older approach, but at this point both can be and are used concurrently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With