Mac下Gradle环境的配置
2014-05-21 22:23
281 查看
前言:
每一种语言发展到一定阶段都会有自动化工具的出现,比如javascript的npm,java的maven等等,android的gradle听说已久,而在最近的一个项目中看到了setting.gradle需要使用gradle工具进行下载配置,所以又在网上找了篇教程,自己慢慢琢磨起来。
1、下载
官网下载:http://www.gradle.org/get-started
参考文档:
For running Gradle, add
your
Usually, this is sufficient to run Gradle.
配置成功
Gradle 是以 Groovy 语言为基础,面向Java应用为主。基于DSL(领域特定语言)语法的自动化构建工具。
在项目中,如果又setting.gradle,直接在项目文件加下输入:gradle build即可构建项目。
项目报错如下:
尝试修改了build.gradle还是不行:
所以很无奈,又重新装了一遍1.10的版本了。
安装完成又出现错误
3、进一步学习
maven/ant/gradle构建项目的工具,因为都没有系统的学习过,想再以后的工作中细心研究研究,因为项目管理还是需要的。
每一种语言发展到一定阶段都会有自动化工具的出现,比如javascript的npm,java的maven等等,android的gradle听说已久,而在最近的一个项目中看到了setting.gradle需要使用gradle工具进行下载配置,所以又在网上找了篇教程,自己慢慢琢磨起来。
1、下载
官网下载:http://www.gradle.org/get-started
参考文档:
For running Gradle, add
GRADLE_HOME/bin to
your
PATHenvironment variable.
Usually, this is sufficient to run Gradle.
GRADLE_HOME="/usr/local/share/gradle-1.12" export PATH=$PATH:$GRADLE_HOME/bin
配置成功
~ gradle -version ------------------------------------------------------------ Gradle 1.12 ------------------------------------------------------------ Build time: 2014-04-29 09:24:31 UTC Build number: none Revision: a831fa866d46cbee94e61a09af15f9dd95987421 Groovy: 1.8.6 Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 Ivy: 2.2.0 JVM: 1.7.0_51 (Oracle Corporation 24.51-b03) OS: Mac OS X 10.9.2 x86_642、Gradle简介
Gradle 是以 Groovy 语言为基础,面向Java应用为主。基于DSL(领域特定语言)语法的自动化构建工具。
在项目中,如果又setting.gradle,直接在项目文件加下输入:gradle build即可构建项目。
项目报错如下:
* Where: Build file '/Users/lishuming/opensource/andriod/SomeProjects/rubychina4android/app/build.gradle' line: 1 * What went wrong: A problem occurred evaluating project ':app'. > Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/lishuming/opensource/andriod/SomeProjects/rubychina4android/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
尝试修改了build.gradle还是不行:
➜ rubychina4android git:(master) ✗ gradle build FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'rubychina4android'. > Could not resolve all dependencies for configuration ':classpath'. > Could not find com.android.tools.build:gradle:1.12. Required by: :rubychina4android:unspecified * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED
所以很无奈,又重新装了一遍1.10的版本了。
安装完成又出现错误
FAILURE: Build failed with an exception. * Where: Build file '/Users/lishuming/opensource/andriod/SomeProjects/rubychina4android/app/build.gradle' line: 1 * What went wrong: A problem occurred evaluating project ':app'. > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 5.283 secs待解决。。。
3、进一步学习
maven/ant/gradle构建项目的工具,因为都没有系统的学习过,想再以后的工作中细心研究研究,因为项目管理还是需要的。
相关文章推荐
- mac下配置gradle的环境变量
- mac终端配置gradle环境变量
- MAC下配置jdk,gradle环境
- 改动mac环境变量,并配置gradle
- Mac上配置Gradle环境变量
- Mac配置Gradle环境
- 环境配置_mac上开发_Java,Android,Gradle,Maven,Hosts
- Mac下配置Gradle环境变量
- Mac Android开发环境变量的配置(java、sdk、ndk、gradle)
- 修改mac环境变量,并配置gradle
- Mac下配置Gradle环境
- Mac Android开发环境变量的配置(java、sdk、ndk、gradle)
- Mac上配置gradle环境
- Mac中配置gradle环境及使用android studio打包jar包与arr包的方法
- Mac - 配置 JDK 环境变量 & Gradle 安装
- Mac 下 Gradle 环境配置
- mac环境下配置gradle\maven
- mac gradle 环境变量配置
- mac gradle 环境变量的配置
- mac环境下配置gradle 环境变量