java - gradle中,into中的from是什么意思?

 泥土人走泥u加水 发布于 2022-11-01 00:51

在看教程时,看到这样一个例子。

task dist(type: Zip) {
    dependsOn spiJar
    from 'src/dist'
    into('libs') {
        from spiJar.archivePath
        from configurations.runtime
    }
}

artifacts {
   archives dist
}

不知道into中的from是什么意思?

3 个回答
  • 把某个文件夹下的文件(from)打包到其他文件夹(into)下

    2022-11-01 00:51 回答
  • 可以看下dsl文档zip中的into描述是这样的into(destPath, configureClosure),第一个参数接收一个路径,第二个参数接收一个闭包,官方的说明是
    `
    Creates and configures a child CopySpec with a destination directory inside the archive for the files
    `
    也就是说可以把里面这两个当成附加项,为第一个参数指定的libs附加其它位置(可以是上面from路径之外的)的文件进去

    2022-11-01 00:51 回答
  • 以zip类型发布Jar包,依赖了任务spiJar,从目录(from)src/dist 添加到(打包进)(into)build/libs/

    2022-11-01 00:51 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有