forked from dotnet/ef6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EFTools.msbuild
219 lines (183 loc) · 13.4 KB
/
EFTools.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), BuildEFTools.cmd))\tools\EntityFramework.settings.targets"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<BuildProperties>Platform=$(Platform)</BuildProperties>
<VSTest>$(VSINSTALLDIR)\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe</VSTest>
<BuildTargets>Build</BuildTargets>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildThisFileDirectory)</SolutionDir>
<SkipEnvSetup></SkipEnvSetup>
<LogsDir>$(SolutionDir)logs\</LogsDir>
<SkipStrongNamesXml>tools\EFToolsSkipStrongNames.xml</SkipStrongNamesXml>
<IsDev14OrLower Condition="'$(VisualStudioVersion)' == '11.0' OR '$(VisualStudioVersion)' == '12.0' OR '$(VisualStudioVersion)' == '14.0'">True</IsDev14OrLower>
</PropertyGroup>
<ItemGroup>
<Projects Include="$(SolutionDir)src\EntityFramework\EntityFramework.csproj" />
<Projects Include="$(SolutionDir)src\EntityFramework.SqlServer\EntityFramework.SqlServer.csproj" />
<Projects Include="$(SolutionDir)src\EntityFramework.SqlServerCompact\EntityFramework.SqlServerCompact.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\XmlCore\XmlCore.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\DesignXmlCore\DesignXmlCore.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignModel\EntityDesignModel.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesign\EntityDesign.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignBootstrapPackage\EntityDesignBootstrapPackage.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignDatabaseGeneration\EntityDesignDatabaseGeneration.csproj" />
<Projects Condition="$(VisualStudioVersion)=='11.0'" Include="$(SolutionDir)src\EFTools\EntityDesignDataSourceWizardExtension\EntityDesignDataSourceWizardExtension.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignEntityDesigner\EntityDesigner.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignExtensibility\EntityDesignExtensibility.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignPackage\EntityDesignPackage.csproj" />
<Projects Include="$(SolutionDir)src\EFTools\EntityDesignerVersioningFacade\EntityDesignerVersioningFacade.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(BuildCoreOnly)' != 'true'">
<Projects Include="$(SolutionDir)test\EFTools\InProcTests\InProcTests.csproj" />
<Projects Include="$(SolutionDir)test\EFTools\E2ETests\E2ETests.csproj" />
<Projects Include="$(SolutionDir)test\EFTools\FunctionalTests\FunctionalTests.csproj" />
<Projects Include="$(SolutionDir)test\EFTools\TestInfrastructure\TestInfrastructure.csproj" />
<Projects Include="$(SolutionDir)test\EFTools\UnitTests\UnitTests.csproj" />
</ItemGroup>
<ItemGroup>
<TestHostProjects Include="$(SolutionDir)tools\VsIdeHostAdapter\Framework\VsIdeTestHostFramework.csproj" />
<TestHostProjects Include="$(SolutionDir)tools\VsIdeHostAdapter\TargetAddIn\VsIdeTestHostAddin.csproj" />
<TestHostProjects Include="$(SolutionDir)tools\VsIdeHostAdapter\Installer\Installer.wixproj" />
</ItemGroup>
<ItemGroup>
<XunitAssembly Include="test\EFTools\UnitTests\bin\$(Configuration)\EFDesigner.UnitTests.dll" />
<XunitAssembly Include="test\EFTools\FunctionalTests\bin\$(Configuration)\EFDesigner.FunctionalTests.dll" />
</ItemGroup>
<Import Project="$(SolutionDir)\tools\EFTools.common.tasks" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<Target Name="Clean">
<MSBuild Targets="Clean"
Projects="@(Projects)" />
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="Clean"
Projects="@(TestHostProjects)" />
<MSBuild Targets="Clean"
Projects="$(SolutionDir)\src\EFTools\Setup\GenerateMsiInputs\GenerateMsiInputs.msbuild" />
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="Clean"
Projects="$(SolutionDir)\src\EFTools\Setup\EFToolsMsi\EFToolsMsi.wixproj" />
</Target>
<Target Name="CreateDirectories">
<MakeDir Directories="$(LogsDir)"/>
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<PropertyGroup>
<RequireRestoreConsent>false</RequireRestoreConsent>
</PropertyGroup>
<Message Text="Restoring NuGet packages..." Importance="High" />
<Exec Command="$(NuGetCommand) restore EFTools.sln"
LogStandardErrorAsError="true" />
</Target>
<Import Project="tools\SkipStrongNames.targets" />
<Target Name="BuildFrameworkPackages">
<MSBuild Projects="$(RepositoryRoot)EF.msbuild" Targets="Package" Properties="Configuration=$(Configuration)" />
</Target>
<Target Name="BuildDesigner" DependsOnTargets="CreateDirectories;CheckSkipStrongNames">
<MSBuild Targets="$(BuildTargets)"
Projects="@(Projects)"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
</Target>
<Target Name="BuildTestHost">
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not allow add-ins. Skipping building test host."
Importance="High" />
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="Build"
Projects="@(TestHostProjects)"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
</Target>
<Target Name="GenerateInstallerInputs" DependsOnTargets="BuildFrameworkPackages">
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not use MSI installer. Skipping generating MSI installer inputs."
Importance="High" />
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="GenerateMsiInputs"
Projects="$(SolutionDir)src\EFTools\setup\GenerateMsiInputs\GenerateMsiInputs.msbuild"
BuildInParallel="false"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
</Target>
<Target Name="BuildInstaller" DependsOnTargets="GenerateInstallerInputs">
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not use MSI installer. Skipping building the MSI installer."
Importance="High" />
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="$(BuildTargets)"
Projects="$(SolutionDir)src\EFTools\setup\EFToolsMsi\EFToolsMsi.wixproj"
BuildInParallel="false"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
</Target>
<Target Name="Build" DependsOnTargets="BuildDesigner;BuildTestHost;BuildInstaller" />
<Target Name="Rebuild">
<MSBuild Projects="$(MSBuildProjectFile)" Properties="BuildTargets=Rebuild;Configuration=$(Configuration)" Targets="Clean;Build" />
</Target>
<Target Name="InstallTestHost" DependsOnTargets="CreateDirectories;BuildTestHost">
<PropertyGroup>
<TestHostPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6FDF32A2-AC01-477f-A9DF-738BC836EE53}</TestHostPath>
<TestHostPath Condition="$(VisualStudioVersion)=='12.0'">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D39AE4C3-21C4-40DE-9F35-53A83803F8DB}</TestHostPath>
<TestHostPath Condition="$(VisualStudioVersion)=='11.0'">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{710EEA0D-C40D-4245-B3FA-C883AAD83A65}</TestHostPath>
<TestHostQuery>$([MSBuild]::GetRegistryValueFromView('$(TestHostPath)', 'DisplayName', null, RegistryView.Registry64, RegistryView.Registry32))</TestHostQuery>
<TestHostInstalled>$(TestHostQuery.StartsWith('VS IDE Test Host for Visual Studio'))</TestHostInstalled>
</PropertyGroup>
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not allow add-ins. Skipping installing test host."
Importance="High" />
<Exec Condition="'$(IsDev14OrLower)' == 'True' AND '$(TestHostInstalled)' != 'True'"
Command='msiexec /qb /i $(OutputPath)VsIdeTestHost.msi /L*v $(LogsDir)VsIdeTestHost.msi.log' />
</Target>
<Target Name="UninstallTestHost">
<PropertyGroup>
<TestHostUnistallGuid Condition=" '$(VisualStudioVersion)' == '11.0' ">{710EEA0D-C40D-4245-B3FA-C883AAD83A65}</TestHostUnistallGuid>
<TestHostUnistallGuid Condition=" '$(VisualStudioVersion)' == '12.0' ">{D39AE4C3-21C4-40DE-9F35-53A83803F8DB}</TestHostUnistallGuid>
<TestHostUnistallGuid Condition=" '$(TestHostUnistallGuid)' == '' ">{6FDF32A2-AC01-477f-A9DF-738BC836EE53}</TestHostUnistallGuid>
</PropertyGroup>
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not allow add-ins. Skipping uninstalling test host."
Importance="High" />
<Exec Condition="'$(IsDev14OrLower)' == 'True'"
Command='msiexec /qb /x $(TestHostUnistallGuid) /L*v $(LogsDir)VsIdeTestHost.msi.uninstall.log' />
</Target>
<Target Name="Install" DependsOnTargets="Rebuild">
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not use MSI installer. Skipping installing the MSI."
Importance="High" />
<Exec Condition="'$(IsDev14OrLower)' == 'True'"
Command='msiexec /qb /i $(OutputPath)en\EFTools.msi SKIPENVIRONMENTSETUP="$(SkipEnvSetup)" /L*v $(LogsDir)EFTools.msi.log' />
<!-- This is included here so that we have the correct .PDBs for the last EFTools _installed_ (not just built) -->
<ItemGroup>
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.BootstrapPackage.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.DatabaseGeneration.pdb" />
<EFDesignerSymbolFiles Condition="$(VisualStudioVersion)=='11.0'" Include="$(OutputPath)Microsoft.Data.Entity.Design.DataSourceWizardExtension.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.EntityDesigner.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.Extensibility.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.Model.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.Package.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Entity.Design.VersioningFacade.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.Data.Tools.Design.XmlCore.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)Microsoft.VisualStudio.Data.Tools.Design.XmlCore.pdb" />
<EFDesignerSymbolFiles Include="$(OutputPath)EntityFramework.pdb" />
</ItemGroup>
<Copy Condition="'$(Configuration)' == 'Debug'" SourceFiles="@(EFDesignerSymbolFiles)" DestinationFolder="$(OutputPath)\en\Symbols" />
</Target>
<Target Name="Test" DependsOnTargets="Install;InstallTestHost;ReRunXUnitTests;ReRunInProcTests;ReRunE2ETests" />
<UsingTask TaskName="Xunit.Runner.MSBuild.xunit"
AssemblyFile="packages\xunit.1.9.2\lib\net20\xunit.runner.msbuild.dll" />
<Target Name="ReRunXUnitTests">
<xunit Assemblies="@(XunitAssembly)" Xml="$(OutputPath)TestResults.xml" />
</Target>
<Target Name="ReRunInProcTests">
<MakeDir Directories="$(SolutionDir)TestResults\InProcTests\"/>
<Exec Command='"$(VSTest)" $(SolutionDir)test\EFTools\InProcTests\bin\$(Configuration)\EFDesigner.InProcTests.dll /Settings:$(SolutionDir)test\EFTools\InProcTests\EFDesignerInProcTests.testsettings /InIsolation /logger:trx'
WorkingDirectory="$(SolutionDir)TestResults\InProcTests\"/>
</Target>
<Target Name="ReRunE2ETests">
<MakeDir Directories="$(SolutionDir)TestResults\E2ETests\"/>
<Exec Condition="'$(TestCaseFilter)'!=''" Command='"$(VSTest)" EFDesigner.E2ETests.dll /Settings:..\..\EFToolsE2ETests.testsettings /InIsolation /logger:trx /TestCaseFilter:$(TestCaseFilter)'
WorkingDirectory="$(SolutionDir)test\EFTools\E2ETests\bin\$(Configuration)\"/>
<Exec Condition="'$(TestCaseFilter)'==''" Command='"$(VSTest)" EFDesigner.E2ETests.dll /Settings:..\..\EFToolsE2ETests.testsettings /InIsolation /logger:trx'
WorkingDirectory="$(SolutionDir)test\EFTools\E2ETests\bin\$(Configuration)\"/>
</Target>
<Target Name="ReRunTests" DependsOnTargets="BuildDesigner;ReRunXUnitTests;ReRunInProcTests;ReRunE2ETests" />
</Project>