Android Studio为啥要用Gradle

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android Studio为啥要用Gradle相关的知识,希望对你有一定的参考价值。

gradle是伴随着android Studio一起启用的一个新的Android build系统所用的build工具。
详情见官方文档,这个:http://tools.android.com/tech-docs/new-build-system/user-guide
还有这个:http://tools.android.com/tech-docs/new-build-system

Google通过提供了Android Gradle Plugin,使你可以很方便的实现以前用ant和ivy去做的事情。包括很多依赖关系和编译、测试等功能的支持。


上述官方文档里有回答你的问题,我就不班门弄斧了,直接引用:


Why Gradle?

Gradle is an advanced build system as well as an advanced build toolkit allowing to create custom build logic through plugins.

Here are some of its features that made us choose Gradle:

    Domain Specific Language (DSL) to describe and manipulate the build logic

    Build files are Groovy based and allow mixing of declarative elements through the DSL and using code to manipulate the DSL elements to provide custom logic.

    Built-in dependency management through Maven and/or Ivy.

    Very flexible. Allows using best practices but doesn’t force its own way of doing things.

    Plugins can expose their own DSL and their own API for build files to use.

    Good Tooling API allowing IDE integration

参考技术A gradle就和eclipse中的ant一样 没有这个无法编译 求采纳本回答被提问者和网友采纳

以上是关于Android Studio为啥要用Gradle的主要内容,如果未能解决你的问题,请参考以下文章

为什么要用Android Studio?

为什么要用Android Studio?

android studio 新建的工程为啥直接报红??

为啥android studio 模拟器开不起来了

为啥android studio向模拟器发送短信

Android studio中为啥明明写了权限还会报错