VS2008 Custom Rules: Can I run two rules on one input file?
-
Can I run two command line instructions on a file in a VS2008 project? I can set each command line instruction up as a rule in the .rules file (see below) but can only select one rule or the other not both. From the input files properties in VS2008 Project View I can select
GraphVizSVGRule
orGraphVizPNGRule
. I want to create both a .svg file and a .png file from the input .gv file (GraphViz) -
Can I run two command line instructions on a file in a VS2008 project? I can set each command line instruction up as a rule in the .rules file (see below) but can only select one rule or the other not both. From the input files properties in VS2008 Project View I can select
GraphVizSVGRule
orGraphVizPNGRule
. I want to create both a .svg file and a .png file from the input .gv file (GraphViz) -
The only method I have found to run more than one is to create a command script that accepts parameters, so you can pass in the file and directory names.
Use the best guess
Thanks, it's now working with the below as you suggested. Rule that calls batch file:
Batch file that creates svg and png from GraphViz gv file:
echo off
set "p=%~dps1"
set "px=Images\"
set "newp=%p%%px%"
set "newsvg=%newp%%~n1%.svg"
set "newpng=%newp%%~n1%.png"
set "source=%~s1"
echo Creating svg...
dot.exe -T svg %source% -o %newsvg%
echo Creating png...
dot.exe -T png %source% -o %newpng%