forked from fluentmigrator/fluentmigrator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a build file that mirrors the ruby file
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
Showing
1 changed file
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |