Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleaning up, reorganizing, and commenting the various targets

  • Loading branch information...
commit 38581df764645f393297f3b08f05f78aec2907cf 1 parent 5d4ddf2
@davidalpert authored
Showing with 23 additions and 5 deletions.
  1. +9 −3 src/Build.xml
  2. +14 −2 src/Greeter.Console/Greeter.Console.csproj
View
12 src/Build.xml
@@ -1,21 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(ProjectDir)Build.Profile.$(BuildProfile).xml" Condition="$(BuildProfile) != ''"/>
+<Project ToolsVersion="4.0" DefaultTargets="CIBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- A list of all the UIProjects to build -->
<ItemGroup>
<UIProject Include="$(MSBuildProjectDirectory)\Greeter.Console\Greeter.Console.csproj">
<BuildProfile>Console</BuildProfile>
</UIProject>
</ItemGroup>
- <Target Name="Build" DependsOnTargets="Clean">
+ <!-- The CI build target that kicks off all the UIProjects to build to the ~/bin/{Profile}/ folder -->
+ <Target Name="CIBuild" DependsOnTargets="Clean">
<MSBuild Projects="@(UIProject)" Targets="Clean;Build" Properties="OutDir=$(MSBuildProjectDirectory)\..\bin\%(BuildProfile)\"/>
</Target>
+ <!-- The primary clean target that tries to removes the ~/bin/ folder -->
<Target Name="Clean">
<RemoveDir Directories="$(MSBuildProjectDirectory)\..\bin" ContinueOnError="true"/>
</Target>
+ <!-- This includes the BuildProfile-specific dependency lists when invoked with a build profile -->
+ <Import Project="$(ProjectDir)Build.Profile.$(BuildProfile).xml" Condition="$(BuildProfile) != ''"/>
+
+ <!-- This target is called by the UIProject AfterBuild targets to build the dependencies to the proper OutDir -->
<Target Name="BuildDependencies">
<Message Text="Building %(Module.FullPath) to OutDir=$(BuildOutputPath)\" Importance="high"/>
<MSBuild Projects="@(Module)" Targets="Build" Properties="OutDir=$(BuildOutputPath)\"/>
View
16 src/Greeter.Console/Greeter.Console.csproj
@@ -87,15 +87,27 @@
</Target>
-->
<Target Name="AfterBuild">
+
+ <!-- Define the build profile to use when building this project's dependent modules -->
<PropertyGroup>
- <MasterBuildScript>$(MSBuildProjectDirectory)\..\Build.xml</MasterBuildScript>
+ <BuildProfile>Console</BuildProfile>
</PropertyGroup>
+ <!-- Convert this project's OutDir to an absolute path in case it is defined in this project file as "bin\Debug" -->
<ConvertToAbsolutePath Paths="$(OutDir)">
<Output TaskParameter="AbsolutePaths" PropertyName="AbsoluteOutDir"/>
</ConvertToAbsolutePath>
+ <PropertyGroup>
+ <MasterBuildScriptFolder>$(MSBuildProjectDirectory)\..\</MasterBuildScriptFolder>
+ <BuildDependenciesProperties>
+ ProjectDir=$(MasterBuildScriptFolder);
+ BuildProfile=$(BuildProfile);
+ BuildOutputPath=$(AbsoluteOutDir)
+ </BuildDependenciesProperties>
+ </PropertyGroup>
+
<Message Text="Building: $(MasterBuildScript)" />
- <MSBuild Projects="$(MasterBuildScript)" Targets="BuildDependencies" Properties="ProjectDir=$(MSBuildProjectDirectory)\..\;BuildProfile=Console;BuildOutputPath=$(AbsoluteOutDir)" />
+ <MSBuild Projects="$(MasterBuildScriptFolder)Build.xml" Targets="BuildDependencies" Properties="$(BuildDependenciesProperties)"/>
</Target>
</Project>
Please sign in to comment.
Something went wrong with that request. Please try again.