【问题标题】:Gradle processResources eachFile removing empty directoriesGradle processResources eachFile 删除空目录
【发布时间】:2017-12-04 15:12:01
【问题描述】:
src/main/resources/foo/bar/a.xml
                   hello/world/b.xml

为每个文件添加不同的前缀:

processResources {
    eachFile {details ->

       if (details.path.starts("foo/")) 
           details.path = "prefix1/" + details.path
       else
           details.path = "prefix2/" + details.path
    }
}

问题是:jar中包含原始目录。

foo/
foo/bar
hello/
hello/world

似乎 eachFile 迭代了不包括目录的文件。

【问题讨论】:

    标签: gradle directory copy rename


    【解决方案1】:

    includeEmptyDirs false 设置为processResources

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-05
      • 1970-01-01
      • 1970-01-01
      • 2014-01-29
      • 2012-05-31
      • 2016-10-16
      • 2020-09-19
      • 1970-01-01
      相关资源
      最近更新 更多