• gradle是什么?

先看下文档中的介绍   https://docs.gradle.org/current/userguide/what_is_gradle.html

Gradle is an open-source build automation tool that is designed to be flexible enough to build almost any type of software.

gradle是开源的自动编译工具,可以方便自由的编译任何软件。

然后进行了一些笼统的介绍,其中提到了一些需要注意的地方,贴出来如下,感觉这个提醒短期内也用不到。

The most notable restriction is that dependency management currently only supports Maven- and Ivy-compatible repositories and the filesystem.

最需要注意的一点是依赖包管理目前只支持Maven- and Ivy-compatible repositories and the filesystem。

  • 用gradle编译一个Android实例

参考https://docs.gradle.org/current/samples/sample_building_android_apps.html

贴出来如下:

Building Android Apps Sample

This sample shows how a simple Android application written in Java can be built with Gradle. The application was created following the Build your first app guide.

Groovy中gradle的内容为
app/build.gradle :
 
plugins {
id('com.android.application') version '7.1.1'
} repositories {
google()
mavenCentral()
} android {
compileSdkVersion 30
defaultConfig {
applicationId 'org.gradle.samples'
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName '1.0'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
} dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

To build the application:

$ ./gradlew build

最新文章

  1. JAVA类与对象
  2. C# Socket连接 无法访问已释放的对象
  3. linux中who命令显示的tty、pts和(:0)(:0.0)是什么意思
  4. Hadoop基础教程之分布式环境搭建
  5. ArcEngine10:ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS components.
  6. JavaScript DOM编程艺术 - 读书笔记1-3章
  7. HashMap和Hashtable的同和不同
  8. 密钥public/private key登陆linux
  9. nodejs6下使用koa2
  10. LeetCode算法题-Subdomain Visit Count(Java实现)
  11. Asp.Net SignalR Hub中的上下文对象
  12. python -- 字符串 for循环
  13. C# 多线程传递参数或多个参数
  14. 【论文笔记】CBAM: Convolutional Block Attention Module
  15. SQL Server ->> 调用系统内建扩展存储过程"master.dbo.xp_delete_file"删除过期备份文件
  16. HTTP协议返回状态码说明
  17. [LeetCode] 1.Two Sum - Swift
  18. Vue 兄弟组件通信(不使用Vuex)
  19. (转)java位运算
  20. zookeeper3.4.5集群安装

热门文章

  1. 搭建Git服务器教程(整理自腾讯云开发者实验室)
  2. sublime text中开启本地服务器
  3. Django中多数据库的配置,实现分库分表,主从复制,读写分离
  4. 手机在线编程软件Anycodes
  5. zookeeper要点总结
  6. php 安装 自带扩展
  7. PHP解密支付宝小程序的加密数据,手机号等。
  8. SQLServer 编程总结
  9. Day 23 23.2:逆向前期准备
  10. 【4】Postman之Tests(断言)