ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Holzwarth <chuck_holzwa...@yahoo.com>
Subject Re: Variables and zip file comments
Date Tue, 04 Dec 2007 16:03:14 GMT
I finally got the commenting of zip files working the way I want but am still having to add
a file to the zip to get the comment added. I create the list of zip files as a property file:

<target name="__create_zip_file_list">
        <if>
                <available file="${__zFlistFname}"/>
            <then>
                <echo file="${__zFlistFname}" append="true">,${__zFileToAdd}</echo>
            </then>
            <else>
                <echo file="${__zFlistFname}">${__PropertyName}=${__zFileToAdd}</echo>
            </else>
       </if>
</target>

Then once all of the zip files have been created, I:

<loadproperties srcfile="${release_dir}/complete/comment_FileList_${build_time}.properties"/>
<antcall target="__comment_zip_file">
    <param name="__zFpath" value="${release_dir}/complete"/>
    <param name="__zFlist" value="${complete.file.list}"/>
</antcall>

Then I use antcall to call the target that updates the zip file comment:
<antcall target="__comment_zip_file">
    <param name="__zFpath" value="${release_dir}/complete"/>
    <param name="__zFlist" value="${complete.file.list}"/>
</antcall>


Inside __comment_zip_file:
I set the a variable with the comment text:

<var name="_Comment" value="${_RelCoord}
${_FileList}
Special instructions:
The file: ${_release_comment_file} is the same file in all of the zip files and extracts to
the same directory structure.
It is safe overwrite the existing file.
"/>

This sets the variable, but it does not include the carriage returns. I create a file containing
the comment info and call the zip task to add the comment:
<for list="${__zFlist}" param="File" trim="true">
<sequential>
    <zip destfile="${__zFpath}/@{File}"    update="true" comment="${_Comment}">
        <zipfileset dir="${__zFpath}" includes="${_release_comment_file}" prefix="xxx"/>
        </zip>
</sequential>

I am using ant from eclipse 3.2.2.
Is there a way to add a comment to a zip file without adding a file?
Is there a way to have the comment variable retain the carriage returns?
 
Thank you,
Chuck Holzwarth



      ____________________________________________________________________________________
Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  http://overview.mail.yahoo.com/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message