当前位置:网站首页>gradle打包tar、ZIP时,如何在最终的压缩包中包含一些空目录
gradle打包tar、ZIP时,如何在最终的压缩包中包含一些空目录
2022-04-22 05:49:00 【bglmmz】
有时候,我们希望最终的压缩包被解压时,能解压出一些系统缺省的空白目录。这样,在打包时,我们就需要创建这些空目录。
//create empty folders in distribution root
into('') {
//create root for empty folders
def emptyRoot = new File("$buildDir/emptyFoldersRoot")
emptyRoot.mkdirs()
//create empty folders
project.file("$buildDir/emptyFoldersRoot/logs").mkdirs()
project.file("$buildDir/emptyFoldersRoot/import").mkdirs()
project.file("$buildDir/emptyFoldersRoot/export").mkdirs()
from {emptyRoot}
}
这样,在最后的tar里面,就包含了 logs, import, export三个包名,解压后就有这三个空目录了。
版权声明
本文为[bglmmz]所创,转载请带上原文链接,感谢
https://blog.csdn.net/bglmmz/article/details/116046808
边栏推荐
猜你喜欢
随机推荐
C learning experience of commission, thread and timer
2021-10-08
FastApi(二)
快应用模糊搜索
笔记:unordered_map的理解与使用
茉莉X4矿池链接方法
Apex上拉菜单(编辑、置顶、删除、取消)
内存和缓存的区别
npm install
Automatically obtain the specified path folder and delete the folder and sub files
OOP 7大设计原则
redis介绍
Pytest(一)
通过js创建单元格(while循环)
重读Scrapy:Spider篇_CrawlSpider的使用分析
盒子塌陷 和 margin塌陷
PHP 打开文件,写入文件内容fopen,feof,fgets
Jeecgboot online development 2
Custom display of C catch error message
Intel SGX初步学习理解笔记(持续更新)









