Bugs item #2981389, was opened at 2010-04-02 18:25 Message generated for change (Comment added) made by fmhome You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=2981389&group_id=31650
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Tasks Group: None Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: fmhome (fmhome) Assigned to: Charles Chan (cchan_qa) Summary: zip task should create a folder Initial Comment: The current zip task in Nant v0.90 In the following example; zipfile should create a folder structure ( ${root.dir}/${which.platform} ) with the zip file in that folder. Currently, one has to use the mkdir task first to create the folder structure ${root.dir}/${which.platform} <zip zipfile="${root.dir}/${archive}/test.zip"> <fileset basedir="${stage.dir}"> <include name="**/**"/> </fileset> </zip> ---------------------------------------------------------------------- Comment By: fmhome (fmhome) Date: 2010-04-10 08:07 Message: Thanks to everyone who were involved and for considering to fix this as an improvement. ---------------------------------------------------------------------- Comment By: Charles Chan (cchan_qa) Date: 2010-04-10 07:56 Message: Fixed in CVS: src/NAnt.Compression/Tasks/ZipTask.cs: 1.42 tests/NAnt.Compression/Tasks/ZipTaskTest.cs: 1.14 Please try in the next NAnt release. Dominik: I will create a separate issue for CompileBase.cs ---------------------------------------------------------------------- Comment By: Dominik Guder (dogu) Date: 2010-04-09 22:01 Message: Hi, that's ok. In addition you also might check "CompilerBase.cs". Currently output dir must be created in advance. If not, a simple <csc> task will fail ---------------------------------------------------------------------- Comment By: Charles Chan (cchan_qa) Date: 2010-04-09 14:25 Message: After reviewing the latest comments, the team agrees it's is a good idea to make sure the <zip> is consistent with the <copy> task. Also, it's true that Ant's implementation of the <zip> task does in fact create the parent folder as well (line 623): http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java?revision=910825&view=markup I will assign this to myself and fix in an upcoming release. ---------------------------------------------------------------------- Comment By: fmhome (fmhome) Date: 2010-04-08 20:19 Message: I understand what you are trying to say but, I think the code should be consistent across the board. If you look at the "Copy Task" It does the same and create the folder structure, if it doesn't exist already. Eventhough, you are copying 1 file. Also, to make my case stronger. The same zip task in ant creates the folder structure as well. Take a look at the ant examples here... http://ant.apache.org/manual/CoreTasks/zip.html Also, the NAnt zip task do not have a proper error message when it fails if the directory structure is not created in advance. I would and I am sure quite a few more people would appreciate if this can be modified. Thanks. ---------------------------------------------------------------------- Comment By: Dominik Guder (dogu) Date: 2010-04-05 14:15 Message: Hi, I see your point, but I don't see that zip task is responsible to create any parent directories if they not exists. Maybe someone will see this different, but zip task should deal with zip files not with dir layout. So I don't see any needs to change this. (This will also duplicate code.) ---------------------------------------------------------------------- Comment By: fmhome (fmhome) Date: 2010-04-05 09:17 Message: Sorry for the confusion here... Let me clarify this issue. The issue is with zipfile attribute of zip task. <zip zipfile="${root.dir}/${archive}/test.zip"> When the task is excuted, the task doesn't create the ${root.dir}/${archive} folder structure and fail, unless the structure is already there. Sometime, users want to put the final zip file in a different folder. Otherwise one has to use mkdir to create the dir structure first then call the zip task. IMO... This is an un-necesary additional step. ---------------------------------------------------------------------- Comment By: Dominik Guder (dogu) Date: 2010-04-03 05:28 Message: I know that this would be helpfull, but IMHO when you are zipping a folder (in windows) with winzip when you won't get this main directory added to zip. But you might take a look into docu: http://nant.sourceforge.net/release/latest/help/types/zipfileset.html use <fileset basedir="${stage.dir}" prefix="${which.platform}"> to create your toplevel directory hth Dominik ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=2981389&group_id=31650 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers