Running build against multiple projects with different build arguments

I have a series of projects that need to be compiled and published, deployed to separate directories with separate MSBuild arguments. Be that as it may, I have separate builds for each. For example, project 1:

MSBuild Arguments: /target:myTarget /property:PublishDir=\\1.1.1.1\PublishDir1

and project 2:

MSBuild Arguments: /target:myTarget /property:PublishDir=\\1.1.1.2\PublishDir2

However, I would like to combine them into one assembly. The problem is that although TFS will allow me to specify multiple projects in the assembly, MSBuild arguments apply to all projects. Is there a quick way to force an explicit set of build arguments for each project, or do I need to create a new build template for this?

+1
source share
2 answers

, , .

, , . . . MsBuild Argument.

/p:DeployOnBuild=true;PublishProfile=Dev
+1

MSBuild .proj , :

<Project ToolsVersion="4.0" DefaultTargets="Rebuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Rebuild" >
<!--Execute proj1-->
<MSBuild Projects="Proj1.csproj" Properties="Configuration=Debug;PublishDir=\\1.1.1.2\PublishDir1;></MSBuild> 
<!--Execute proj2-->
<MSBuild Projects="Proj2.csproj" Properties="Configuration=Debug;PublishDir=\\1.1.1.2\PublishDir2;></MSBuild> 
</Target>
</Project>

tfs .proj .

+1

Source: https://habr.com/ru/post/1545326/


All Articles