forked from fluentmigrator/fluentmigrator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.msbuild
103 lines (80 loc) · 3.64 KB
/
default.msbuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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>