Skip to content

Commit

Permalink
Added a build file that mirrors the ruby file
Browse files Browse the repository at this point in the history
to enable building without being forced to install
ruby.

The build file mirrors the rake file in functionallity
exect for the last step which is to add create a
nuget package but this is a minor change but
not needed as this is targeted at easy local builds
  • Loading branch information
abusby committed Nov 25, 2011
1 parent 1b62d7e commit 426dc24
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions default.msbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Paths to various parts of the build -->
<PropertyGroup>
<OutputDir>dist</OutputDir>
<Productname>fluentmigrator</Productname>
<SolutionFile>$(MSBuildProjectDirectory)\FluentMigrator (2010).sln</SolutionFile>
</PropertyGroup>

<ItemGroup>
<Platform Include="x86" />
<Platform Include="Any CPU" />
</ItemGroup>

<ItemGroup>
<Version Include="v3.5" />
<Version Include="v4.0" />
</ItemGroup>

<PropertyGroup>
<Configuration Condition="$(Configuration)==''">Release</Configuration>
</PropertyGroup>

<!-- Deletes the output folders from pervious builds for a clean build -->
<Target Name="_Clean" Condition="Exists($(OutputDir))">
<Message Text="Removing old build Files" />
<RemoveDir Directories="$(OutputDir)" />
</Target>

<!-- Generate the diffent combinations of platforms and version -->
<Target Name="_GenerateDeploymentMatrix" DependsOnTargets="_Clean">
<CreateItem Include="@(Platform)" AdditionalMetadata="Version=%(Version.Identity)">
<Output ItemName="CompileTarget" TaskParameter="Include"/>
</CreateItem>
</Target>

<!-- Default Target for kicking of the build process -->
<Target Name="Build" DependsOnTargets="_GenerateDeploymentMatrix">
<MSBuild Projects="$(MSBuildProjectFile)" Targets="_BuildForFlavor" Properties="Platform=%(CompileTarget.Identity);Version=%(CompileTarget.Version);" />
</Target>


<Choose>
<When Condition="'$(Version)'=='v4.0'">
<ItemGroup>
<ConfigFileToDelete Include="$(OutputDir)\console-$(Platform)-$(Version)\Migrate.exe.config" />
<ConfigFileToRename Include="$(OutputDir)\console-$(Platform)-$(Version)\app.40.config" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<ConfigFileToDelete Include="$(Empty)" />
<ConfigFileToRename Include="$(Empty)" />
</ItemGroup>
</Otherwise>
</Choose>



<!-- Create the top level dist directory -->
<Target Name="_CreateDistDirectory" DependsOnTargets="_Clean">
<MakeDir Directories="$(OutputDir)" />
</Target>


<!-- Create a directory for each build flavor -->
<Target Name="_CreateDeploymentDirectory">
<MakeDir Directories="$(OutputDir)\console-$(Platform)-$(Version)" />
</Target>

<!-- Build each flavor and move them to there final directory -->
<Target Name="_Build" DependsOnTargets="_CreateDeploymentDirectory">
<Message Importance="High" Text="Build the console app for target .NET Framework version $(Version) on $(Platform)" />
<MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(Configuration);Platform=$(Platform);TargetFrameworkVersion=$(Version);" />
</Target>
<Target Name="_CopyToDistDir" DependsOnTargets="_Build">
<Message Text="Copying Output For .NET Framework version $(Version) on $(Platform)" />
<ItemGroup>
<FilesToDeploy Include="
src/FluentMigrator.Console/bin/Release/*.*;
src/FluentMigrator.Nant/bin/Release/FluentMigrator.Nant.*;
src/FluentMigrator.MSBuild/bin/Release/FluentMigrator.MSBuild.*;
"/>
</ItemGroup>
<Copy SourceFiles="@(FilesToDeploy)" DestinationFolder="$(OutputDir)\console-$(Platform)-$(Version)\%(RecursiveDir)" />
</Target>

<Target Name="_ReplaceAppConfigWithCorrectVersion" DependsOnTargets="_CopyToDistDir">
<Delete Files="@(ConfigFileToDelete)" />
<Copy SourceFiles="@(ConfigFileToRename )" DestinationFiles="$(OutputDir)\console-$(Platform)-$(Version)\Migrate.exe.config" />
<Delete Files="$(OutputDir)\console-$(Platform)-$(Version)\app.40.config" />
</Target>

<Target Name="_BuildForFlavor" DependsOnTargets="_ReplaceAppConfigWithCorrectVersion">

</Target>





</Project>

0 comments on commit 426dc24

Please sign in to comment.