gradle学习笔记
一直想着花时间学习下gradle,今天有空。入门一下。参考:极客学院gradle使用指南,官方文档:gradle-2.12/docs/userguide/installation.html,以及百度阅读的官方文档中文译本:gradle翻译
手下下载gradle的zip,然后根据极客学院的教程手动打一遍。
测试代码:https://github.com/chenxing12/l4gradle
笔记:
Chapter 4. Using the Gradle Command-Line
each task only is executed only once;
- you can exclude a task from being executed using the -x command-line option and providing the name of the task to execute;
- By default,Gradle will abort execution and fail the build as soon as any task fails.This allows the build to complete sooner,but hides other failures that would have occured.In order to discover as many failures as possible in a single build execution,you can use the --continue option.
- 默认,执行遇到错误即停止,这是为了尽快build,但会隐藏其他未执行的错误。为了发现更多的错误,使用--continue选项。
- You can also abbreviate each word in a camel task name.For example,you can execute task compileTest by running gradle compileTest or gradle cT.
- 你可以使用缩写代替task name。比如驼峰。
- When you run the gradle command,it looks for a build file in the current directory.You can user the -b option to select another build file.If you use -b option then settings.gradle fil eis not used.
- 在当前目录下执行gradle命令会寻找当前目录下的build file。你可以使用-b选项来指定另一个file。
- Alternatively,you can use the -p option to specify the project directory to use.For multi-project builds you should user -p option instead of -b option.
- 使用-p选项来指定运行的项目目录。
- Obtaining infomation about projects.gradle -q projects
- 获取项目列表,在build.gradle使用descroption= 'your desc'
- Running gradle tasks gives you a list of the main tasks of the seleted projet.This report shows the default tasks for the project,if any,and description for each task.
- 获取tasks列表。使用task_name{description='your desc' group = 'your group'}来描述task
- Running gradle help --task task_name gives you detailed information about a specific task or multiple matching the given task name in your multiproject build.
- 通过gradle help --task taskname来查看task详情
- Running gradle dependencies gives you a list of the dependecies of the selected project,broken down by configuration.For each configuration,the direct and transitive dependencies of that configuration are shown in a tree.
- 通过gradle dependencies来查看依赖。
- Since a dependency report can get large,it can be useful to restrict the report to a particular configuration.This is a achieved with the optional --configuration parameter.
- 通过--configuration 来显示特定的依赖
- Running gradle properties gives you a list of the properties of the selected project.This is a snippet from the output
Chapter 6. The Gradle Daemon
- A daemon is a computer program that runs as a background process,rather than being under the diret control of an interactive user.
- 守护进程(后台程序)是一个计算机程序:作为后台程序运行而不是直接被用户操控。
- Which one to use is up to personal preference.
- 使用哪个决定于个人偏向。
Chapter 7. Dependency Management Basics
- Very roughly,dependency management is made up of two pieces.Firstly,Gradle needs to known about the things that your project needs to build or run,in order to find them.We call these incoming files the dependecies of the project.Secondly,Gradle nees to build and upload the things that your project produces.We call these outgoing files the publications of the project.Let's look at these ewo pieces in more detail:
- 大概的讲,依赖管理由两部分组成。第一,gradle需要知道你的项目构建或运行所需要的东西,为了找到他们。我们称呼他们这些将要获得的files为项目依赖。第二,gradle需要创建和上传你的项目的产品。我们程这些外出的files为项目的发布。让我们更详细的看看这两个部分:
单词:
guarantee详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- n. 保证;担保;保证人;保证书;抵押品
- vt. 保证;担保
indicate详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- vt. 表明;指出;预示;象征
phase详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- n. 相;阶段;[天] 位相
- vt. 使定相;逐步执行
- vi. 逐步前进
summary详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- adj. 简易的;扼要的
- n. 概要,摘要,总结
profile详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- n. 侧面;轮廓;外形;剖面;简况
- vt. 描…的轮廓;扼要描述
- vi. 给出轮廓
snippet详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- n. 小片;片断;不知天高地厚的年轻人
typically详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- adv. 代表性地;作为特色地
related详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- adj. 有关系的,有关联的;讲述的,叙述的
- v. 叙述(relate过去式)
investigate详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- v. 调查;研究
extremely详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- adv. 非常,极其;极端地
insight详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- n. 洞察力;洞悉
- n. (Insight)人名;(英)因赛特
visualise ['vɪʒʊəlˌaɪz]
详细»
- vt. 使…可见;使…具体化(等于visualize)
- vi. 想象;显现
restrict详细»
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
/Youdao/Dict4/6.3.69.3031/resultui/images/nosound.gif)
- vt. 限制;约束;限定
look for 报错
- 寻找
specify
vt. 指定;详细说明;列举;把…列入说明书
encounter 报错
- vt. 遭遇,邂逅;遇到
- n. 遭遇,偶然碰见
- vi. 遭遇;偶然相遇
occur
- vi. 发生;出现;存在
advantage详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- n. 优势;利益;有利条件
- vi. 获利
- vt. 有利于;使处于优势
tremendous详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- adj. 极大的,巨大的;惊人的
transparent详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- adj. 透明的;显然的;坦率的;易懂的
argue详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- vi. 争论,辩论;提出理由
- vt. 辩论,争论;证明;说服
- n. (Argue)人名;(英、法)阿格
valid详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- adj. 有效的;有根据的;合法的;正当的
curve详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- n. 曲线;弯曲;曲线球;曲线图表
- vt. 弯;使弯曲
- vi. 成曲形
- adj. 弯曲的;曲线形的
due to详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
- adv. 由于;应归于
expressive详细»
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
/Youdao/Dict/6.3.69.4001/resultui/images/nosound.gif)
gradle学习笔记的更多相关文章
- Gradle学习笔记之Groovy
[TOC] Gradle 的核心功能是由Java实现. 在这些功能之上, 有一个使用动态编程语言Groovy编写的领域特定语言(DSL). Gradle的构建脚本build.gradle和settin ...
- Android Gradle 学习笔记(五):Gradle 任务 Task
在之前的学习中,我们了解到Gradle的构建工作都是由Task组合完成的.本节我们就来介绍一下 Task - 任务. 一.多种方式创建任务 在Gradle中,我们可以有很多种方式来创建任务.为什么有这 ...
- Android Gradle 学习笔记(四):Gradle 构建脚本
本节我们从整体的角度来介绍一下Gradle. 一.setting.gradle 在Gradle中,定义了一个设置文件,用于初始化以及工程树的配置.设置文件的默认的名字就是setting.gradle, ...
- gradle学习笔记(1)
1. 安装 (1) 下载最新gradle压缩包,解压到某处.地址是:Gradle web site: (2) 添加环境变量: 1) 变量名:GRADLE_HOM ...
- Android Gradle 学习笔记(一):Gradle 入门
官网地址:https://gradle.org/. 一.配置 Gradle 环境 安装Gradle之前必须要配置好Java环境,要求JDK 6 以上,并且在环境变量配置好JAVA_HOME.查看Jav ...
- Gradle学习笔记(1)创建简单的Java项目
Gradle是一个基于Apache Ant和Apache Maven概念的项目自动化构建工具.它使用一种基于Groovy的特定领域语言(DSL)来声明项目设置,抛弃了基于XML的各种繁琐配置.当前 ...
- Android Gradle 学习笔记(六):Gradle 插件
Gradle 本身提供了一些基本的概念和整体核心的框架,其他用于描述真实使用场景的都可以通过插件扩展的方式来实现.这样就可以通过抽象的方式提供一个核心的框架,其他具体的功能和业务都通过插件扩展的方式来 ...
- Android Gradle 学习笔记(七):Android Gradle 插件
我们知道Android Gradle其实就是一个Gradle的一个第三方插件,它是由Google的Android团队开发的,基于Gradle构建的,和Android Studio完美搭配.相比于旧的构 ...
- Android Gradle 学习笔记(三):Gradle 日志
在第一节,我们使用到了gradle -q hello命令行来运行Hello World,并对Hello World进行了简单的分析,了解到 gradle -q hello 的意思是要执行的build. ...
随机推荐
- Ubantu 下安装 tensorflow
# 在 Linux 上: $ sudo apt-get install python-pip python-dev python-virtualenv $ virtualenv --system-si ...
- bootstrap基本模板
<!DOCTYPE html><!--html5文档格式--> <html lang="zh-CN"><!--申明语言是中文简体--> ...
- SSH学习笔记
Struts2登录模块处理流程: 浏览器发送请求http://localhost/appname/login.action,到web应用服务器: 容器接收到该请求,根据web.xml的配置,服务器将请 ...
- Kosaraju 算法查找强连通分支
有向图 G = (V, E) 的一个强连通分支(SCC:Strongly Connected Components)是一个最大的顶点集合 C,C 是 V 的子集,对于 C 中的每一对顶点 u 和 v, ...
- Backbone源码分析(三)
Backbone源码分析(一) Backbone源码分析(二) Backbone中主要的业务逻辑位于Model和Collection,上一篇介绍了Backbone中的Model,这篇文章中将主要探讨C ...
- ASP.Net开发基础温故知新学习笔记
申明:本文是学习2014版ASP.Net视频教程的学习笔记,仅供本人复习之用,也没有发布到博客园首页. 一.一般处理程序基础 (1)表单提交注意点: ①GET通过URL,POST通过报文体: ②需在H ...
- Redis系列(四)-低成本高可用方案设计
关于Redis高可用方案,看到较多的是keepalived.zookeeper方案. keepalived是主备模式,意味着总有一台浪费着.zookeeper工作量成本偏高. 本文主要介绍下使用官方s ...
- Atom使用纪要
一直在更新的原文地址奉上,欢迎PR:Atom使用纪要 官网地址: atom.io 目前(2015/7/29)Atom主题已有725个:Package已有2394 简单交代背景 Atom 是 Githu ...
- IE浏览器打开chorme浏览器,如何打开其他浏览器
看到这个标题是否感觉奇怪,为什么要用IE浏览器打开chorme或者火狐浏览器等,这个功能从开发者来说不是一个好的需求,但确实是真实存在的,有用公司的背景历史比较复杂,而且公司有过长期的开发历史,这导致 ...
- iOS-----写一个规范的单例--->
1.集成了一个宏 2.两句代码集成单例 3.一句代码调用单例 -------------> 1.集成了一个宏 //这里就要注意了,因为每个单例中,方法名可以不一样,那么我们就不能把名字写死,要灵 ...