Skip to content

Commit

Permalink
cleaning up, reorganizing, and commenting the various targets
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalpert committed Jan 22, 2012
1 parent 5d4ddf2 commit 38581df
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/Build.xml
Original file line number Diff line number Diff line change
@@ -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)\"/>
Expand Down
16 changes: 14 additions & 2 deletions src/Greeter.Console/Greeter.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 38581df

Please sign in to comment.