forked from mono/entityframework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EF.msbuild
127 lines (112 loc) · 6.71 KB
/
EF.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Package;Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<SolutionFile>EntityFramework.sln</SolutionFile>
<BuildProperties>Platform=$(Platform)</BuildProperties>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildThisFileDirectory)</SolutionDir>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<Target Name="Clean">
<MSBuild Targets="Clean"
Projects="$(SolutionFile)"
Properties="Configuration=$(Configuration);$(BuildProperties)" />
<MSBuild Targets="Clean"
Projects="$(SolutionFile)"
Properties="Configuration=ReleaseNet40;$(BuildProperties)" />
</Target>
<Target Name="RestorePackages">
<PropertyGroup>
<RequireRestoreConsent>false</RequireRestoreConsent>
</PropertyGroup>
<ItemGroup>
<RestoreProjFiles Include="src\EntityFramework.SqlServerCompact\*.csproj" />
<RestoreProjFiles Include="test\EntityFramework\FunctionalTests\*.csproj" />
<RestoreProjFiles Include="test\EntityFramework\FunctionalTests.Transitional\*.csproj" />
<RestoreProjFiles Include="test\EntityFramework\UnitTests\*.csproj" />
<RestoreProjFiles Include="test\EntityFramework\VBTests\*.vbproj" />
</ItemGroup>
<Message Text="Restoring NuGet packages..." Importance="High" />
<MSBuild Projects="@(RestoreProjFiles)" Targets="RestorePackages" Properties="RequireRestoreConsent=$(RequireRestoreConsent)" />
</Target>
<Target Name="RestoreSolutionPackages" DependsOnTargets="CheckPrerequisites" AfterTargets="RestorePackages">
<PropertyGroup>
<PackagesConfig>$([System.IO.Path]::Combine($(NuGetToolsPath), "packages.config"))</PackagesConfig>
<SolutionRequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</SolutionRequireConsentSwitch>
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(SolutionRequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>
</PropertyGroup>
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true" />
</Target>
<Target Name="Build">
<MSBuild Targets="Build"
Projects="$(SolutionFile)"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
<MSBuild Targets="Build"
Projects="$(SolutionFile)"
Properties="Configuration=ReleaseNet40;$(BuildProperties);BuildPackages=false" />
</Target>
<Target Name="Rebuild">
<MSBuild Targets="Rebuild"
Projects="$(SolutionFile)"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
<MSBuild Targets="Rebuild"
Projects="$(SolutionFile)"
Properties="Configuration=ReleaseNet40;$(BuildProperties);BuildPackages=false" />
</Target>
<Target Name="CheckSkipStrongNames" DependsOnTargets="RestoreSolutionPackages">
<MSBuild Targets="CheckSkipStrongNames"
Projects="tools\EF.skipstrongnames.targets" />
</Target>
<Target Name="EnableSkipStrongNames" DependsOnTargets="RestoreSolutionPackages">
<MSBuild Targets="EnableSkipStrongNames"
Projects="tools\EF.skipstrongnames.targets" />
</Target>
<Target Name="DisableSkipStrongNames" DependsOnTargets="RestoreSolutionPackages">
<MSBuild Targets="DisableSkipStrongNames"
Projects="tools\EF.skipstrongnames.targets" />
</Target>
<Target Name="Test" DependsOnTargets="CheckSkipStrongNames;Rebuild">
<MSBuild Projects="tools\EF.xunit.targets"
Properties="Configuration=$(Configuration);$(BuildProperties)" />
</Target>
<Target Name="Package" DependsOnTargets="UpdateVersionNumber;Rebuild">
<MSBuild Targets="Build"
Projects="src\EntityFramework.PowerShell\EntityFramework.PowerShell.csproj"
Properties="Configuration=$(Configuration);$(BuildProperties);Platform=AnyCPU;InternalsInvisble=true;RunCodeAnalysis=false" />
<MSBuild Targets="Build"
Projects="src\EntityFramework.PowerShell\EntityFramework.PowerShell.csproj"
Properties="Configuration=ReleaseNet40;$(BuildProperties);Platform=AnyCPU;InternalsInvisble=true;RunCodeAnalysis=false" />
</Target>
<Target Name="UpdateVersionNumber" Condition=" '$(BUILD_NUMBER)' != '' ">
<PropertyGroup>
<DatePart>2$([System.DateTime]::Now.ToString("MMdd"))</DatePart>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyFileVersion>6.0.$(DatePart).$(BUILD_NUMBER)</AssemblyFileVersion>
<AssemblyInfoVersion>6.0.0-beta1-$(DatePart)</AssemblyInfoVersion>
</PropertyGroup>
<ItemGroup>
<Lines Include="using System.Reflection%3b"/>
<Lines Include="[assembly:AssemblyVersion("$(AssemblyVersion)")]"/>
<Lines Include="[assembly:AssemblyFileVersion("$(AssemblyFileVersion)")]"/>
<Lines Include="[assembly:AssemblyInformationalVersion("$(AssemblyInfoVersion)")]" />
</ItemGroup>
<WriteLinesToFile File="src\SharedAssemblyVersionInfo.cs"
Lines="@(Lines)"
Overwrite="true"
Encoding="UTF-8" />
<XmlPoke XmlInputPath="src\NuGet\EntityFramework\EntityFramework.nuspec"
Query="//x:package/x:metadata/x:version"
Value="$(AssemblyInfoVersion)"
Namespaces="<Namespace Prefix='x' Uri='http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd' />" />
<XmlPoke XmlInputPath="src\NuGet\EntityFramework.SqlServerCompact\EntityFramework.SqlServerCompact.nuspec"
Query="//x:package/x:metadata/x:version"
Value="$(AssemblyInfoVersion)"
Namespaces="<Namespace Prefix='x' Uri='http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd' />" />
</Target>
<Target Name="CodeCoverage" DependsOnTargets="RestoreSolutionPackages;Build">
<MSBuild Projects="tools\EF.opencover.targets"
Properties="Configuration=$(Configuration);$(BuildProperties)" />
</Target>
</Project>