visual studio 2012 - Sequencing project/solution build and cmd file executing in custom MSBuild file -


i need tie bunch of steps include building solutions, projects , running .cmd files using custom msbuild file.

my first pass @ below:

<project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    <propertygroup>       <configuration>release</configuration>       <platform>anycpu</platform>    </propertygroup>    <itemgroup>       <projectstobuild include="..\hosts\solution1.sln"></projectstobuild>       <projectstobuild include="..\..\solution2.sln"></projectstobuild>       <projectstobuild include="helper1.csproj"></projectstobuild>       <projectstobuild include="..\..\sandboxes\helper2.sln"></projectstobuild>       <exec include="" command="call getfiles.cmd"/>       <projectstobuild include="wix\proc\prod.wixproj"></projectstobuild>       <exec command="call final.cmd"/>    </itemgroup>    <target name="build">       <msbuild projects="@(projectstobuild)" targets="build">         <output itemname="projectoutputs" taskparameter="targetoutputs"/>     </msbuild>     <message text="@projectoutputs"/>    </target>        </project> 

this resulted in error since exec element in wrong place.

basically, need build solution1.sln, solution2.sln,helper1.csproj , helper2.sln (in sequence), then, run file getfiles.cmd, build prod.wixproj followed running final.cmd file.

i have looked @ msdn (here, here, here), a blog, , browsed through various stackoverflow questions (including this, this, this, this), none of them quite address trying do. first time have ever worked msbuild, possible may have missed something. appreciate pointers...

since itemgroup node can child of target node, break down itemgroup members separate targets, use defaulttargets attribute control sequence in built.

<?xml version="1.0" encoding="utf-8"?> <project defaulttargets="target1;target2;target3" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" toolsversion="3.5" >     <target name="target1">         <message text="target 1" />     </target>     <target name="target2">         <message text="target 2" />     </target>     <target name="target3">         <message text="target 3" />     </target> </project> 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -