应用gradle插件有什么区别 [英] What the difference in applying gradle plugin

查看:143
本文介绍了应用gradle插件有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不理解gradle插件块

I don't understand gradle plugins block

apply plugin: 'someplugin1'
apply plugin: 'maven'

和另外一个:

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.

推荐答案

plugins块是应用插件的较新方法,并且它们必须在

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.

新的plugins方法不适用于多项目配置(subprojectsallprojects),但适用于每个子项目的构建配置.

The new plugins method does not work in multi-project configurations (subprojects, allprojects), but will work on the build configuration for each child project.

我认为随着功能的发展,plugins配置方法将取代旧的方法,但是在这一点上,两者可以同时使用.

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.

这篇关于应用gradle插件有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆