ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: creating a build file via another build file
Date Fri, 17 Aug 2007 11:58:13 GMT
You are embedding xml statements in <echo> and this is not allowed, you could use <echoxml>
But you have also a xml declaration in your echo
   <?xml version="1.0" encoding="UTF-8"?>
You could leave that or you have to use <echo> and encode the xml-charachter (<>&...).

I have a little perl script for masking - for my own need:
use Win32::Clipboard;
$CLIP = Win32::Clipboard();

$clip = $CLIP->Get();

$clip =~ s/</&lt;/g;
$clip =~ s/>/&gt;/g;
$clip =~ s/"/&quot;/g;


So you would write something like

<echo file...>
    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
    &lt;project name=&quot;deploy&quot; default=&quot;start&quot; basedir=&quot;.&quot;&gt;

    &lt;target name=&quot;first&quot;&gt;
        &lt;exec executable=&quot;svn&quot;&gt;
            &lt;arg value=&quot;co&quot;/&gt;
                &lt;arg value=&quot;; /&gt;


-----Urspr√ľngliche Nachricht-----
Von: Vihan Pandey [] 
Gesendet: Freitag, 17. August 2007 13:29
Betreff: creating a build file via another build file

        I have an a build file which generates another build file and then
executes it. I am creating the 2nd build file via an echo task to the file.
Something like this :

this is deploy.xml :

<?xml version="1.0" encoding="UTF-8"?>
<project name="xmlgen" default="init" basedir=".">

        <!-- Generate Deployment Script -->
        <target name="init">
        <echo file="build.xml.static-assets">
               <?xml version="1.0" encoding="UTF-8"?>
               <project name="deploy" default="start" basedir=".">

                       <target name="first">
                                          <exec executable="svn">
                                              <arg value="co"/>
                                              <arg value="" />

        <target name="execute">
          <exec executable="ant">
            <arg value="-f"/>
            <arg value="build.xml.static-assets"/>
            <arg value="start"/>


and doing :

# anf -f deploy.xml init

should generate build.xml.static-assets and execute it via :

# ant -f build.xml.static-assets start

Currently executing the same gives me an error:

``The content of elements must consist of well-formed character data or

the build.xml.static-assets works stand alone but I want that file to be
generated through another ant script. Any suggestions?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message