Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using Visual Studio 2010 on Windows 7 64-bits.</p> <p>I found a solution that's better to my liking, I'm chaining commands together with <code>&amp;&amp; ^</code>, for example, editing my .vcxproj xml file like so:</p> <pre><code> &lt;PreBuildEvent&gt; &lt;Command&gt;echo "hello 1" &amp;amp;&amp;amp; ^ echo "hello 2" &amp;amp;&amp;amp; ^ echo "hello 3"&lt;/Command&gt; &lt;Message&gt;Performaing pre-build actions ...&lt;/Message&gt; &lt;/PreBuildEvent&gt; </code></pre> <p>I've chained three commands together. The '&amp;&amp;' tells the shell to stop executing if the previous command errors out.</p> <p>Note, in the .xml file, one can't use <code>&amp;&amp;</code> directly, so <strong>'&amp; amp;&amp; amp;'</strong> must be used instead. Also note the use of the <code>^</code> character, this is the cmd shell's line continuation character (like BASH's <code>\</code> char).</p> <p>Each new command must start at the beginning of the line. Using this approach, one can chain as many commands as one wants, but if any fail, the rest in the chain won't get executed.</p> <p>Here's my actual usecase, I'm performing some environment checks with a Python script, followed by copying my pre-compiled header's debug file to another sub-project's directory:</p> <pre><code> &lt;PreBuildEvent&gt; &lt;Command&gt;C:\Python27\python.exe "$(SolutionDir)check_path.py" 32 &amp;amp;&amp;amp; ^ copy "$(SolutionDir)h1ksim_lib\vc$(PlatformToolsetVersion).pdb" "$(IntDir)" /-Y &gt; nul&lt;/Command&gt; &lt;Message&gt;Performaing pre-build actions ...&lt;/Message&gt; &lt;/PreBuildEvent&gt; </code></pre> <p>The <code> > nul </code> usage on the copy command prevents any output showing up in the build window, so my teammates won't get freaked out when it says <code>0 file(s) copied.</code></p> <p>Reference to sharing pre-compiled headers between sub-projects is here:</p> <p><a href="https://stackoverflow.com/questions/645747/sharing-precompiled-headers-between-projects-in-visual-studio">Sharing precompiled headers between projects in Visual Studio</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload