Thanks for the response. Please see below. Also, I have not subscribed to the
list yet, so, doing copy and paste for now, the indent may not be obvious,
sorry about that.
Thorsten Scherler
Sun, 21 Jan 2007 11:13:09 -0800
On Fri, 2007-01-19 at 16:23 -0500, Li, Don wrote:
> I'm wondering if cocoon or ant supports a command like "keep", to keep
> a directory and its associated files created by another app during
> "forrest clean" process.
>
Out of the box no. Well let´s say yes it is because if we analyze the
result of the command it should do NOTHING as I understand it.
If you want to develop such a task it should not be hard. You just need
to specify better what should be deleted.
>
>
> <!-- Please note, I'm using the "clean" subset command, "clean-site"
> for demo and clarity sake -->
>
> <!-- as is -->
>
> <target name="clean-site" depends="init-props"
>
> description="* Clean the project generated documents directory">
>
> <delete failonerror="false" dir="${project.site-dir}"/>
>
> <delete failonerror="false" file="${project.brokenlinkfile}"/>
>
> </target>
>
>
>
> <!-- to be or desirable state -->
>
> <target name="clean-site" depends="init-props"
>
> description="* Clean the project generated documents directory">
>
> <delete failonerror="false" dir="${project.site-dir}"/>
Here you need to specify which dirs you want to delete. The delete
command will act the following way. Imaging you have the "normal"
FORREST build structure.
I assume ${project.site-dir} is equivalent to build/site. Then you
should not use this root if you have files/dirs in there that you want
to keep.
>
> <delete failonerror="false" file="${project.brokenlinkfile}"/>
>
> <!-- NEW -- >
>
> <keep failonerror="false" dir="${project.site-keep-dir}"/>
>
Assuming the "keep" dir is a dir under build/site that cannot work
because you already have delete it in the step before using your given
example.
>
>
> <!-- project.site-keep-dir is defined elsewhere in this xml file
> -->
>
> </target>
>
>
>
> Is this approach doable?
No, with my assumption not.
However why not:
<target name="clean-site-keep" depends="init-props"
description="copies the keep dir and clean the project generated
documents directory">
<!-- NEW -- >
<!-- project.site-keep-dir-src
and destination (des) is defined elsewhere in this xml file -->
<copy failonerror="false" dir="${project.site-keep-dir-src}"
todir="${project.site-keep-dir-des}"/>
<delete failonerror="false" dir="${project.site-dir}"/>
<delete failonerror="false" file="${project.brokenlinkfile}"/>
</target>
-----------------------
BY DL
How about this?
Add the copy command to the last action of "building a new site" hence least
impact on the current process?
Question, forrest's projecthelp option indicates that doing
forrest
Or
forrest site
produces the same result, that is, to build a new site.
however, in the forrest.xml file, I don't see any specification about "site"
(action), I see action(target) like "clean", "clean-site", "run" etc. Does
that mean everything else is for building a (new) site (for "site" action)?
And before I do
<copy failonerror="false" dir="${project.site-keep-dir-src}"
todir="${project.site-keep-dir-des}"/>
I would need to define both project.site-keep-dir-src and
project.site-keep-dir-des. Would it suffice if I define them in this same
forrest.build.xml file before running this command?
------------------------
That should do want you want. Have a look at the ant manual.
-------------
Do key word search for "ant" did not produce any sort of meaning result for its
manual, where else could I dig (not to download the whole package and then
extract...)?
---------
Once again, many thanks.
HTH
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)