Gradle 学习笔记(1)
2015-10-16 00:00
387 查看
摘要: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html 备注下
gradle 的Helloworld,做个备注
Example 6.1. Your first build script
执行命令
Example 6.2. Execution of a build script
Output of
参数列表:
-?, -h, --help Shows this help message.
-a, --no-rebuild Do not rebuild project dependencies.
-b, --build-file Specifies the build file.
-c, --settings-file Specifies the settings file.
--configure-on-demand Only relevant projects are configured in this build run. This means faster build for large multi-project builds. [incubating]
--continue Continues task execution after a task failure.
-D, --system-prop Set system property of the JVM (e.g. -Dmyprop=myvalue).
-d, --debug Log in debug mode (includes normal stacktrace).
--daemon Uses the Gradle daemon to run the build. Starts the daemon if not running.
--foreground Starts the Gradle daemon in the foreground. [incubating]
-g, --gradle-user-home Specifies the gradle user home directory.
--gui Launches the Gradle GUI.
-I, --init-script Specifies an initialization script.
-i, --info Set log level to info.
-m, --dry-run Runs the builds with all task actions disabled.
--no-color Do not use color in the console output.
--no-daemon Do not use the Gradle daemon to run the build.
--offline The build should operate without accessing network resources.
-P, --project-prop Set project property for the build script (e.g. -Pmyprop=myvalue).
-p, --project-dir Specifies the start directory for Gradle. Defaults to current directory.
--parallel Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. [incubating]
--parallel-threads Build projects in parallel, using the specified number of executor threads. [incubating]
--profile Profiles build execution time and generates a report in the <build_dir>/reports/profile directory.
--project-cache-dir Specifies the project-specific cache directory. Defaults to .gradle in the root project directory.
-q, --quiet Log errors only.
--recompile-scripts Force build script recompiling.
--refresh-dependencies Refresh the state of dependencies.
--rerun-tasks Ignore previously cached task results.
-S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions.
-s, --stacktrace Print out the stacktrace for all exceptions.
--stop Stops the Gradle daemon if it is running.
-u, --no-search-upward Don't search in parent folders for a settings.gradle file.
-v, --version Print version info.
-x, --exclude-task Specify a task to be excluded from execution.
gradle 的Helloworld,做个备注
Example 6.1. Your first build script
新建文件 『build.gradle』 (gradle默认构建 使用"build.gradle",其他名称可以通过"-b" 参数指定)
task hello { doLast { println 'Hello world!' } }
执行命令
Example 6.2. Execution of a build script
Output of
gradle -q hello
> gradle -q hello Hello world!
参数列表:
-?, -h, --help Shows this help message.
-a, --no-rebuild Do not rebuild project dependencies.
-b, --build-file Specifies the build file.
-c, --settings-file Specifies the settings file.
--configure-on-demand Only relevant projects are configured in this build run. This means faster build for large multi-project builds. [incubating]
--continue Continues task execution after a task failure.
-D, --system-prop Set system property of the JVM (e.g. -Dmyprop=myvalue).
-d, --debug Log in debug mode (includes normal stacktrace).
--daemon Uses the Gradle daemon to run the build. Starts the daemon if not running.
--foreground Starts the Gradle daemon in the foreground. [incubating]
-g, --gradle-user-home Specifies the gradle user home directory.
--gui Launches the Gradle GUI.
-I, --init-script Specifies an initialization script.
-i, --info Set log level to info.
-m, --dry-run Runs the builds with all task actions disabled.
--no-color Do not use color in the console output.
--no-daemon Do not use the Gradle daemon to run the build.
--offline The build should operate without accessing network resources.
-P, --project-prop Set project property for the build script (e.g. -Pmyprop=myvalue).
-p, --project-dir Specifies the start directory for Gradle. Defaults to current directory.
--parallel Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. [incubating]
--parallel-threads Build projects in parallel, using the specified number of executor threads. [incubating]
--profile Profiles build execution time and generates a report in the <build_dir>/reports/profile directory.
--project-cache-dir Specifies the project-specific cache directory. Defaults to .gradle in the root project directory.
-q, --quiet Log errors only.
--recompile-scripts Force build script recompiling.
--refresh-dependencies Refresh the state of dependencies.
--rerun-tasks Ignore previously cached task results.
-S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions.
-s, --stacktrace Print out the stacktrace for all exceptions.
--stop Stops the Gradle daemon if it is running.
-u, --no-search-upward Don't search in parent folders for a settings.gradle file.
-v, --version Print version info.
-x, --exclude-task Specify a task to be excluded from execution.
相关文章推荐
- 十月最受瞩目,轻码云将亮相第四届安卓全球开发者大会
- pta-数据结构与算法题目集(中文)--4-4 链式表的按序号查找
- Django初试
- InvocationHandler 动态代理
- 2015年最新苹果开发者账号注册流程详解
- SQL Server中 DateDiff计算时间差
- 字节码中的两个方法<init>,<clinit>
- HDFS客户端的权限错误:Permission denied
- OAuth2.0认证和授权原理
- OAuth2.0认证和授权原理(续)
- svn妙用
- AppleWatch开发入门六——Glance(预览)扩展的应用
- 单链表的归并排序
- 自定义spinner下拉框样式,并实现三级联动
- subversion服务器搭建
- Universal Image Loader库使用方法
- bzoj1798【ahoi2009】维护序列
- Android学习实践:12.列表ListView
- iOS面试题汇总
- 003-scanf函数使用和表达式-C语言笔记