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 Java
apply plugin: 'java' // In this section you declare where to find the dependencies of your project
repositories {
// 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 code
dependencies {
// 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 单元測试和日志输出包下载了。

最新文章

  1. ASP.NET学习链接
  2. eclipse绘制activiti无法生成图形
  3. 怎么在win7的64位旗舰版上配置coocs2d-x 3.2的android环境并且打包APK
  4. 使用Aspose插件对Excel操作
  5. HTML认识
  6. C#中将ListView中数据导出到Excel
  7. BZOJ 4318: OSU! 期望DP
  8. python--zeros函数和ones函数
  9. RSA加密算法 C++实现
  10. wait/notify 实现多线程交叉备份
  11. dijk
  12. intent详解(一)
  13. leetcode-数组中只出现一次的数字
  14. 【搭建】MongoDB在Linux环境的搭建
  15. [Unity优化]批处理03:静态批处理
  16. Spring再接触 Annotation part2
  17. Windows Docker 安装
  18. 过滤数组中的空数组array_filter()
  19. Shell - 简明Shell入门14 - 操作符(Operator)
  20. java 中java.util.Arrays类---常用函数记录

热门文章

  1. Three Garlands~Educational Codeforces Round 35
  2. Python实现求矩阵路径最小和,使用动态规划
  3. linux 某个路径创建快捷方式
  4. Java并发容器--ConcurrentLinkedQueue
  5. HDU2669 Romantic
  6. request.getScheme()的使用方法
  7. 杭电oj2031、2033、2070、2071、2075、2089、2090、2092、2096-2099
  8. AC日记——The Child and Sequence codeforces 250D
  9. CSS浮动属性,知道原理就很简单,灵活控制块级元素在一行内显示
  10. Python的并发并行[2] -> 队列[1] -> 使用队列进行任务控制