gradle 笔记

2023-11-19

1. 各种options

Simon@ZOUYUN-PC /f/AndroidstudioProjects/KeyguardTest (master)
$ gradle --help

USAGE: gradle [option...] [task...]

-?, -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.

2. Tasks

  gradle projects 查看项目

  gradle tasks --all  查看task

  gradle help --task someTask 可以获取到 task 的详细信息

  gradle dependencies 会列出项目每个task的依赖列表, 可以通过 --configuration 指定具体的task
    eg.  gradle -q app:dependencies --configuration compile   
       gradle -q -p app/ dependencies --configuration compile
      指定具体的项目可以用 -p 指定项目路径, 或者 projectName:taskName

  gradle properties 可以获取项目所有属性列表

  

 

3.配置

  build.gradle 

  gradle.properties  属性配置

  settings.gradle  子项目配置

 

参考: https://github.com/waylau/Gradle-2-User-Guide/blob/master/SUMMARY.md

转载于:https://www.cnblogs.com/iori-zy/p/4330554.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

gradle 笔记 的相关文章

随机推荐

  • Transformer学习笔记

    一 Transformer诞生背景 Transformer模型是解决序列转录问题的一大创新 在Transformer模型之前 序列转录模型都或多或少的基于复杂的循环或卷积神经网络 循环神经网络的计算是时序性的 位置的计算必须基于之前所有位置
  • 微信小程序数据 \n 换行符失效解决办法

    最近遇到一个问题 使用uni app写小程序时 拿到一个字符串 后台返回的 需要在 n 处换行 但是直接使用 let title 黄鹤楼送 n孟浩然之广陵
  • 使用python对银行信息管理系统的简单实现

    一 首先是用户属性的类 class account object 储存用户信息的类 def init self id1 name tel money self id id1 账户 self name name 姓名 self tel tel
  • mo管理器java_Android开发之通过包管理器获取安装应用信息

    最近在自己写一个APP 有一个模块需要获取手机应用的一些信息 坑还是有 但都基本踩过了 自己把他实现了出来 实现方法还是很需要掌握的 底部弹出的对话框中四个选项的实现不多做说明 主要讲讲如何获取这些安装的应用信息 好了 不多说 看看效果图
  • 1024,干程序才懂得节日!

    1024程序员节 1024程序员节是广大程序员的共同节日 1024是2的十次方 二进制计数的基本计量单位之一 针对程序员经常周末加班与工作日熬夜的情况 部分互联网机构倡议每年的10月24日为1024程序员节 在这一天建议程序员拒绝加班 程序
  • 【C/C++】报错问题积累

    1 出现Deprecated declaration XXX give arg types c文件中 有没有参数的函数时 声明需要加void即 main c void fun main h void fun void
  • androidX 在AndroidMainfest里面加入provider后编译不通过

  • 【three.js练习程序】创建简单物理地形

  • ubuntu 18.04 双系统安装

    下载镜像 Ubuntu 18 04 6 LTS Bionic Beaver 磁盘分区用于ubuntu存储 在C盘中分出200M用于ubuntu的引导启动 C盘已经分出200M空间 D盘分配出160G用于存储文件 U盘制作系统盘 刻录软件 推
  • linux下TUN或TAP虚拟网卡的使用

    tun tap 驱动程序实现了虚拟网卡的功能 tun表示虚拟的是点对点设备 tap表示虚拟的是以太网设备 这两种设备针对网络包实施不同的封装 利用tun tap 驱动 可以将tcp ip协议栈处理好的网络分包传给任何一个使用tun tap驱
  • ClickHouse安装(集群版)

    ClickHouse安装 集群版 一 准备工作 1 设置hostname 2 hosts映射 3 关闭防火墙 4 同步时间 5 关闭selinux 6 安装好zookeeper 7 重启 二 搭建ClickHouse集群 1 下载安装包 2
  • c++类模板与继承详解

    c 类模板 继承 详解 类模板和类模板之间 类模板和类之间可以互相继承 它们之间的派生关系有以下四种情况 1 类模板继承类模板 2 类模板继承模板类 3 类模板继承普通类 4 普通类继承模板类 include
  • 【linux】shell 编程之字符串与数组

    前言 对字符串的操作在众多的编程语言中可以说是最基础的了 字符串 String 就是一系列字符的组合 字符串是 Shell 编程中最常用的数据类型之一 除了数字和字符串 也没有其他类型了 一 shell 中字符串的几种格式 在shell中
  • 吃透Chisel语言.18.Chisel模块详解(五)——Chisel中使用Verilog模块

    Chisel模块详解 五 Chisel中使用Verilog模块 上一篇文章讲述了用函数实现轻量级模块的方法 可以大幅度提升编码效率 Chisel中也提供了一些好用的函数 方便我们编写代码 也方便Chisel编译器优化生成的硬件电路 在Chi
  • Blender 之修改器代码分析

    转载 Blender 之修改器代码分析 KAlO2 博客园 Blender 之修改器代码分析 Blender的修改器 modifier 模块 默认界面右下块 Property 面板的扳手 分类 修改 生成 形变 模拟 列出所有的修改器 也可
  • 使用七牛云Python SDK来实现自动下载所有文件

    安装七牛云Python SDK 在终端中输入以下命令 pip install qiniu 连接七牛云存储 创建下载链接并下载文件 示例代码如下 import os from qiniu import Auth BucketManager 配
  • iOS和macOS上Swift编写的EOS区块链开源框架SwiftyEOS

    SwiftyEOS是一个用于与EOS交互的开源框架 用Swift编写 可以在iOS和macOS上使用 特点 EOS密钥对生成 私钥导入 签名哈希 基本的RPC API 链 历史 可查询客户端 交易 EOS token 转账 帮助类处理iOS
  • C/C++语言实现WiFi(socket)数据收发(客户端和服务端)

    目录 客户端 client 服务端 server C C 实现TCP通信 接收WIFI数据 编程环境 VC 6 0 手机端 使用WiFi调试助手 提示 整个过程在局域网中进行 很多编程语言都可以实现socket通信 本博客将通过C C 实现
  • Unity小游戏-勇闯小岛(PC) 项目展示+完整项目源码

    游戏录像 游戏玩法 主角可以变换四种状态 玩家通过四种状态特有的技能来击败眼前的怪物闯关 切换到棕色 有一个一直围绕自己旋转的大摆斧攻击敌人 切换到绿色 可以抵挡一切的投掷物 但是无法攻击敌人 切换到粉色 切换瞬间可以发出飞镖 切换到蓝色
  • gradle 笔记

    1 各种options Simon ZOUYUN PC f AndroidstudioProjects KeyguardTest master gradle help USAGE gradle option task h help Show