[笔记] Android开发中的gradle是什么?
- 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.
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
For more information, we suggest reading Getting Started with Gradle. You can also find Android development related information inside the guides provided by the Android team.
最新文章
- JAVA类与对象
- C# Socket连接 无法访问已释放的对象
- linux中who命令显示的tty、pts和(:0)(:0.0)是什么意思
- Hadoop基础教程之分布式环境搭建
- ArcEngine10:ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS components.
- JavaScript DOM编程艺术 - 读书笔记1-3章
- HashMap和Hashtable的同和不同
- 密钥public/private key登陆linux
- nodejs6下使用koa2
- LeetCode算法题-Subdomain Visit Count(Java实现)
- Asp.Net SignalR Hub中的上下文对象
- python -- 字符串 for循环
- C# 多线程传递参数或多个参数
- 【论文笔记】CBAM: Convolutional Block Attention Module
- SQL Server ->;>; 调用系统内建扩展存储过程";master.dbo.xp_delete_file";删除过期备份文件
- HTTP协议返回状态码说明
- [LeetCode] 1.Two Sum - Swift
- Vue 兄弟组件通信(不使用Vuex)
- (转)java位运算
- zookeeper3.4.5集群安装