无法在Gradle中创建Zip存档 [英] Not able to create a Zip archive in Gradle

查看:133
本文介绍了无法在Gradle中创建Zip存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个简单的Zip存档,其中包含我的资源目录中的所有javascript文件。



以下是代码:

 任务zip(类型:Zip){
from('resources /'){
include'* .js'
}
到'resources'
}

这似乎不适用于一些原因。我听到很多人说你只需要从和创建一个存档。有人可以帮我吗?我正在使用Gradle v1.0。提前致谢。 .gradle.api.tasks.bundling.Zip.html#org.gradle.api.tasks.bundling.Zip:> docs ):

<$ p $ ('resources /')
将'* .js'
包含到'resources'中//注意这是一个任务zip(类型:Zip){
在存档中指定路径*
destinationDir文件('dir')//您希望将存档放置在
中的目录


I'm trying to create a simple Zip archive that contains all the javascript files in my resources directory

Here's the code:

  task zip(type:Zip){
    from ('resources/'){
        include '*.js'
    }
    into 'resources'
}

This does not seem to work for some reason. I've heard many people saying that all you need is a from and into to create an archive. Can someone help me here ? I'm using Gradle v1.0. Thanks in advance.

解决方案

Try something like this (docs):

task zip(type:Zip) {
 from ('resources/')
 include '*.js'
 into 'resources' // note that this specifies path *in* the archive
 destinationDir file('dir') // directory that you want your archive to be placed in
}

这篇关于无法在Gradle中创建Zip存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆