views:

435

answers:

2

I'm trying to use jsmin with nant - and it just uses stdin and stdout for input and output. The nant 'exec' task allows you to redirect the output to a file, but not get the input from a file.

I have tried with a 'commandline' using '>' and '<' to direct the input and output, but nant just goes away and doesn't come back :(

I can't believe no-one's tried to do this before. Please help! :)

A: 

I believe NAnt does support input from a file. Since the build file is XML you must use the xml encoded "<".

<exec program="somefile.exe" workingdir=".">
  <arg value="&lt; input.txt" />
</exec>
acloutier
I did this. Nant just seems to wait forever for input.
Ian Grainger
+1  A: 

From http://www.mail-archive.com/[email protected]/msg04575.html. You should be able to do something similar to:

        <exec program="cmd.exe" workingdir=".">
                <arg value="/c cacls" />
                <arg value="${mdb.file}" />
                <arg value="/E" />
                <arg value="/G testpc\aspnet:F" />
                <arg value="&lt; y.txt" />
        </exec>
acloutier
I'm afraid I probably won't test this now, but thanks very much for finding this for me! I assume this answer is correct.I've discovered that nant concat doesn't keep files in order, so I'm going to have to modify JSMin code to get input from a set of files anyway.
Ian Grainger