我正在尝试创建一个简单的 Zip 存档,其中包含我的资源目录中的所有 javascript 文件
这是代码:
task zip(type:Zip){
from ('resources/'){
include '*.js'
}
into 'resources'
}
由于某种原因,这似乎不起作用。我听过很多人说你只需要一个from
和into
创建一个档案。有人可以在这里帮助我吗?我正在使用 Gradle v1.0。提前致谢。
尝试这样的事情(文档):
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
}
task someTask << {
// other code...
task(zipResources, type: Zip) {
destinationDir new File(projectDir, 'resources')
archiveName 'resources.zip'
from 'src/main/webapp'
include '*.js'
}.execute()
task(zipSomethingElse, type: Zip) {
destinationDir buildDir
archiveName 'source-code.zip'
from 'src/main/java'
include '**/*.java'
}.execute()
// some other code...
}