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,在工程目录里查看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 单元测试和日志输出包下载了。

更多相关文章

  1. Android利用Http下载文件
  2. Ubuntu环境下Android源码下载及编译方法
  3. android开发环境搭建和部署
  4. 实现录音,播放,以及Socket的上传和下载。。【处女作】
  5. android创建桌面快捷方式(启动目标非项目的启动页)
  6. android弹出对话框
  7. Ubuntu搭建Eclipse+JDK+SDK的Android
  8. ubuntu-11.04下android开发环境搭建
  9. [连载 1/15] Android(安卓)从入门到精通Example 之 TextBox

随机推荐

  1. Eclipse便于开发Android的快捷键大全
  2. 《Android内核剖析》读书笔记 第6章 应用
  3. 关于Android回调的理解
  4. Android(安卓)TextView文字太多显示的最
  5. 当我们讨论流畅度的时候,我们究竟在说什么
  6. iPhone 6 16G不够用?给iPhone 6扩容的技
  7. 05Android学习从零单排之Androidmultimed
  8. Android完整知识体系路线(菜鸟-资深-大牛
  9. App模块化及工程扩展
  10. [Android基础] VideoView