博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android Gradle基础实践
阅读量:4610 次
发布时间:2019-06-09

本文共 1777 字,大约阅读时间需要 5 分钟。

1,gradle是全新的一种IDE编程环境,Android Studio集成了Gradle IDE

2,要下载gradle(比方gradle-2.10)解压。配置环境变量。比方G:\Program       Files\Android\Android Studio\gradle\gradle-2.10

3。创建gradle项目

cmd 命令行里 mkdir projectName,创建工程文件夹

gradle init --type java-library 。创建使用java语言编写的模块

gradle init --type groovy-library ;创建使用groovy语言编写的模块

4。在project文件夹里查看build.gradle文件

/* * This build file was auto generated by running the Gradle 'init' task * by 'user' at '16-4-13 涓嬪崍2:05' with Gradle 2.10 * * This generated file contains a sample Java project to get you started. * For more details take a look at the Java Quickstart chapter in the Gradle * user guide available at https://docs.gradle.org/2.10/userguide/tutorial_java_projects.html */// Apply the java plugin to add support for Javaapply plugin: 'java'// In this section you declare where to find the dependencies of your projectrepositories {    // Use 'jcenter' for resolving your dependencies.    // You can declare any Maven/Ivy/file repository here.
mavenLocal() // maven本地库
maven{ url 'XXXXX'} //maven私服
mavenCentral() // 直接到网上下    jcenter()}// In this section you declare the dependencies for your production and test codedependencies {    // The production code uses the SLF4J logging API at compile time    compile 'org.slf4j:slf4j-api:1.7.13'    // Declare the dependency for your favourite test framework you want to use in your tests.    // TestNG is also supported by the Gradle Test task. Just change the    // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add    // 'test.useTestNG()' to your build script.    testCompile 'junit:junit:4.12'}

5。repositories是所以来的包配置;apply plugin: 'java' 是导入java模块

6,gradle dependencies 依据依赖里的配置下载对应的包

看到将junit:4.12和org.slf4j-api 单元測试和日志输出包下载了。

转载于:https://www.cnblogs.com/gccbuaa/p/7252625.html

你可能感兴趣的文章
如何删除xcode项目中不再使用的图片资源
查看>>
编写用例文档
查看>>
解决WPF两个图片控件显示相同图片因线程占用,其中一个显示不全的问题
查看>>
寻觅Azure上的Athena和BigQuery (二):神奇的PolyBase
查看>>
SSM——(一)
查看>>
wp_list_categories函数用法详解
查看>>
内疚的程序员
查看>>
移动互联网的六大发展趋势
查看>>
UIImageView填充模式(contentMode)
查看>>
RabbitMQ基础知识详解
查看>>
[转载]辜新星:时刻调整方向 找到人生的蓝海
查看>>
ubuntu16.04 64位中的32位兼容lib
查看>>
C++指针总结
查看>>
MYSQL动态查询拼接的表名的SQL脚本实现(MYSQL动态执行SQL脚本)
查看>>
PHP检测移动设备类mobile detection使用实例
查看>>
HDU 4255 A Famous Grid
查看>>
extern
查看>>
Bluetooth 报文知识点
查看>>
Json语法浅析
查看>>
shell脚本批量生成配置文件
查看>>