I've added an item to my Tools menu using the XML below that runs custom actions for my project.
<?xml version="1.0" encoding="UTF-8"?>
<toolSet name="My Project Utilities">
<tool name="test" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="false">
<exec>
<option name="COMMAND" value="C:\path\to\ant.bat" />
<option name="PARAMETERS" value="my_task -Dmodule.dir=$ProjectFileDir$\my.module" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/my.working.dir/foo" />
</exec>
</tool>
</toolSet>
When I try to run this task, I get this error:
Error running test:
Cannot start process, the working directory C:\projects\something\my.working.dir\foo does not exist
The problem is $ProjectFileDir$
points to the wrong directory, C:\projects\something
, and I need it to point to C:\projects
. Is there a way to change the value of $ProjectFileDir
without modifying the value of WORKING_DIRECTORY
in my XML?