antbuilder

How to pass arguments to ant.java() method in Groovy

一笑奈何 提交于 2020-01-06 05:04:12
问题 I am trying to convert an ant <java> task to groovy. I am using the following code: def ant = new AntBuilder(); ant.java(classpath:'jar_file_path', classname:'Main', fork:'true') I also have a list of command line arguments to be passed to the method. Q1. How should I pass the command line arguments to the method in groovy? Q2. Any documentation on groovy which can get me started quickly? 回答1: You should be able to do: def ant = new AntBuilder(); ant.java(classpath:'jar_file_path', classname:

How to pass arguments to ant.java() method in Groovy

白昼怎懂夜的黑 提交于 2020-01-06 05:03:18
问题 I am trying to convert an ant <java> task to groovy. I am using the following code: def ant = new AntBuilder(); ant.java(classpath:'jar_file_path', classname:'Main', fork:'true') I also have a list of command line arguments to be passed to the method. Q1. How should I pass the command line arguments to the method in groovy? Q2. Any documentation on groovy which can get me started quickly? 回答1: You should be able to do: def ant = new AntBuilder(); ant.java(classpath:'jar_file_path', classname:

Zip specific files with AntBuilder

て烟熏妆下的殇ゞ 提交于 2019-12-11 15:09:07
问题 I need to zip a collection of files from different location into one zip, keeping their initial relations. For example, I need only a1 and b2 from the following folder structure Top -- A -- a1 -- a2 -- B -- b1 b2 and i want the zip file to look like: Top -- A -- a1 -- B -- b2 How can I do that using AntBuilder? I've tried: def deploymentFiles = [ "$HOME/Songs/a.tsv", "$HOME/Songs/b.tsv", ] def ant = new AntBuilder() def zipFile = new File("deployment_zipFile.zip") ant.zip( destFile: "$

Scan directories in groovy with ant builder file scanner

流过昼夜 提交于 2019-12-08 05:43:40
问题 I want to use fileScanner of AntBuilder to go over directories. My code looks like: scanner = new AntBuilder().fileScanner { fileset(dir:sourcedir, casesensitive:false) { include(name:pattern) type(type:'dir') } } I want to loop with the scanner just on directories, for example: for (file in scanner) { assert file.directory == true } Any idea ? Thanks!!!!!!!! 回答1: Here's how to do it with fileScanner scanner = new AntBuilder().fileScanner { fileset(dir:sourcedir, casesensitive:false) {

Zip files/Directories in Groovy with AntBuilder

泪湿孤枕 提交于 2019-12-03 22:49:56
问题 I am trying to zip files and directories in Groovy using AntBuilder. I have the following code: def ant = new AntBuilder() ant.zip(basedir: "./Testing", destfile:"${file}.zip",includes:file.name) This zips the file "blah.txt", but not the file "New Text Document.txt". I think the issue is the spaces. I've tried the following: ant.zip(basedir: "./Testing", destfile:"${file}.zip",includes:"${file.name}") ant.zip(basedir: "./Testing", destfile:"${file}.zip",includes:"\"${file.name}\"") Neither

Zip files/Directories in Groovy with AntBuilder

时光毁灭记忆、已成空白 提交于 2019-12-01 00:25:57
I am trying to zip files and directories in Groovy using AntBuilder. I have the following code: def ant = new AntBuilder() ant.zip(basedir: "./Testing", destfile:"${file}.zip",includes:file.name) This zips the file "blah.txt", but not the file "New Text Document.txt". I think the issue is the spaces. I've tried the following: ant.zip(basedir: "./Testing", destfile:"${file}.zip",includes:"${file.name}") ant.zip(basedir: "./Testing", destfile:"${file}.zip",includes:"\"${file.name}\"") Neither of the above resolved the issue. I'm using Ant because it will zip directories, and I don't have access

Proguard tells me 'Please correct the above warnings first.'. How to address references of external jars?

喜你入骨 提交于 2019-11-30 07:55:05
问题 How can I address the warnings? Log says [proguard] Note: duplicate definition of library class... ... [proguard] Note: there were 370 duplicate class definitions. [proguard] Initializing... [proguard] Warning: abc.cba..: can't find superclass or interface xyz.zyx.... ... [proguard] Note: the configuration refers to the unknown class 'android.app.backup.BackupAgentHelper'... ... [proguard] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1