Skip to content

Commit cbe5199

Browse files
committed
Add solution, build scripts, Nuget.Config, global.json, and versions required to get WPF test building locally.
1 parent 478e317 commit cbe5199

22 files changed

+8879
-0
lines changed

Build.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*"

Directory.Build.props

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project>
2+
<!-- Normalize $(TestWpfArcadeSdkPath) by appending a '\' to it if one is missing -->
3+
<PropertyGroup Condition="'$(TestWpfArcadeSdkPath)'!=''">
4+
<WpfArcadeSdkPath>$(TestWpfArcadeSdkPath)</WpfArcadeSdkPath>
5+
<WpfArcadeSdkPath Condition="!$(WpfArcadeSdkPath.EndsWith('\'))">$(TestWpfArcadeSdkPath)\</WpfArcadeSdkPath>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Condition="'$(TestWpfArcadeSdkPath)'=='' And Exists('$(MSBuildThisFileDirectory)eng\WpfArcadeSdk\')">
9+
<WpfArcadeSdkPath>$(MSBuildThisFileDirectory)eng\WpfArcadeSdk\</WpfArcadeSdkPath>
10+
</PropertyGroup>
11+
<!-- Select Sdk.props from test location or eng\WpfArcadeSdk\. If neither exists, then fall back to the use of one
12+
obtained using MSBuild's Sdk resolver -->
13+
<PropertyGroup Condition="Exists('$(WpfArcadeSdkPath)')">
14+
<WpfArcadeSdkProps>$(WpfArcadeSdkPath)Sdk\Sdk.props</WpfArcadeSdkProps>
15+
<WpfArcadeSdkTargets>$(WpfArcadeSdkPath)Sdk\Sdk.targets</WpfArcadeSdkTargets>
16+
</PropertyGroup>
17+
18+
19+
<Import Project="$(WpfArcadeSdkProps)"
20+
Condition="Exists('$(WpfArcadeSdkProps)') And Exists('$(WpfArcadeSdkTargets)')"/>
21+
22+
<Import Sdk="Microsoft.DotNet.Arcade.Wpf.Sdk"
23+
Project="Sdk.props"
24+
Condition="!Exists('$(WpfArcadeSdkProps)') Or !Exists('$(WpfArcadeSdkTargets)')"/>
25+
26+
<PropertyGroup>
27+
<WpfTestsRoot>$(MsBuildThisFileDirectory)</WpfTestsRoot>
28+
<BinariesRoot>$(WpfTestsRoot)bin\</BinariesRoot>
29+
<PublishRoot>$(WpfTestsRoot)publish\</PublishRoot>
30+
<ObjRoot>$(BinariesRoot)obj\</ObjRoot>
31+
<PackagesRoot>$(BinariesRoot)packages\</PackagesRoot>
32+
<PlatformFolder>x86</PlatformFolder>
33+
<PlatformFolder Condition="'$(Platform)' == 'x64'">x64</PlatformFolder>
34+
</PropertyGroup>
35+
36+
</Project>

Directory.Build.targets

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
4+
<Import Project="$(WpfArcadeSdkTargets)"
5+
Condition="Exists('$(WpfArcadeSdkProps)') And Exists('$(WpfArcadeSdkTargets)')"/>
6+
7+
<Import Sdk="Microsoft.DotNet.Arcade.Wpf.Sdk"
8+
Project="Sdk.targets"
9+
Condition="!Exists('$(WpfArcadeSdkProps)') Or !Exists('$(WpfArcadeSdkTargets)')"/>
10+
</Project>

Microsoft.DotNet.Wpf.Test.sln

Lines changed: 5479 additions & 0 deletions
Large diffs are not rendered by default.

NuGet.config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
6+
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
7+
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
8+
<add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" />
9+
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
10+
<add key="dotnet6-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json" />
11+
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
12+
</packageSources>
13+
<disabledPackageSources />
14+
</configuration>

eng/Versions.props

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VersionPrefix>4.8.0</VersionPrefix>
5+
<PreReleaseVersionLabel>rc2</PreReleaseVersionLabel>
6+
</PropertyGroup>
7+
<PropertyGroup>
8+
<SystemIOPackagingVersion>5.0.0-rc.1.20370.4</SystemIOPackagingVersion>
9+
<SystemDiagnosticsPerformanceCounterVersion>5.0.0-rc.1.20370.4</SystemDiagnosticsPerformanceCounterVersion>
10+
<SystemThreadingAccessControlVersion>5.0.0-rc.1.20370.4</SystemThreadingAccessControlVersion>
11+
<SystemTextEncodingCodePagesVersion>5.0.0-rc.1.20370.4</SystemTextEncodingCodePagesVersion>
12+
<SystemManagementVersion>5.0.0-rc.1.20370.4</SystemManagementVersion>
13+
<SystemDataSqlClientVersion>5.0.0-alpha.1.19563.6</SystemDataSqlClientVersion>
14+
<ServiceProcessServiceControllerVersion>5.0.0-rc.1.20370.4</ServiceProcessServiceControllerVersion>
15+
<SystemDataOleDbVersion>5.0.0-rc.1.20370.4</SystemDataOleDbVersion>
16+
<SystemDataOdbcVersion>5.0.0-rc.1.20370.4</SystemDataOdbcVersion>
17+
<MicrosoftDotNetArcadeWpfSdkVersion>6.0.0-alpha.1.21071.6</MicrosoftDotNetArcadeWpfSdkVersion>
18+
</PropertyGroup>
19+
<!-- NuGet Package Versions -->
20+
<PropertyGroup>
21+
<MicrosoftPrivateWinformsVersion>5.0.0-rc.1.20372.4</MicrosoftPrivateWinformsVersion>
22+
</PropertyGroup>
23+
<!-- Packages that come from https://github.com/dotnet/coreclr -->
24+
<PropertyGroup>
25+
<MicrosoftNETCoreRuntimeCoreCLRVersion>5.0.0-alpha1.19562.1</MicrosoftNETCoreRuntimeCoreCLRVersion>
26+
<MicrosoftNETCoreILDAsmVersion>5.0.0-rc.1.20370.4</MicrosoftNETCoreILDAsmVersion>
27+
<MicrosoftNETCoreILAsmVersion>5.0.0-rc.1.20370.4</MicrosoftNETCoreILAsmVersion>
28+
</PropertyGroup>
29+
<!-- Packages that come from https://github.com/dotnet/core-setup -->
30+
<PropertyGroup>
31+
<MicrosoftNETCoreAppVersion>5.0.0-rc.1.20370.4</MicrosoftNETCoreAppVersion>
32+
<MicrosoftNETCorePlatformsVersion>5.0.0-rc.1.20370.4</MicrosoftNETCorePlatformsVersion>
33+
<SystemDrawingCommonVersion>5.0.0-rc.1.20370.4</SystemDrawingCommonVersion>
34+
<SystemDirectoryServicesVersion>5.0.0-rc.1.20370.4</SystemDirectoryServicesVersion>
35+
<SystemReflectionMetadataLoadContextVersion>5.0.0-rc.1.20370.4</SystemReflectionMetadataLoadContextVersion>
36+
</PropertyGroup>
37+
<!-- Packages that come from https://github.com/dotnet/corefx via core-setup coherency parent dependency -->
38+
<PropertyGroup>
39+
<MicrosoftWin32RegistryPackageVersion>5.0.0-rc.1.20370.4</MicrosoftWin32RegistryPackageVersion>
40+
<SystemCodeDomPackageVersion>5.0.0-rc.1.20370.4</SystemCodeDomPackageVersion>
41+
<SystemConfigurationConfigurationManagerPackageVersion>5.0.0-rc.1.20370.4</SystemConfigurationConfigurationManagerPackageVersion>
42+
<SystemDiagnosticsEventLogPackageVersion>5.0.0-rc.1.20370.4</SystemDiagnosticsEventLogPackageVersion>
43+
<SystemReflectionEmitPackageVersion>5.0.0-alpha.1.19563.6</SystemReflectionEmitPackageVersion>
44+
<SystemReflectionTypeExtensionsPackageVersion>4.6.0-preview4.19176.11</SystemReflectionTypeExtensionsPackageVersion>
45+
<SystemSecurityAccessControlPackageVersion>5.0.0-rc.1.20370.4</SystemSecurityAccessControlPackageVersion>
46+
<SystemSecurityCryptographyXmlPackageVersion>5.0.0-rc.1.20370.4</SystemSecurityCryptographyXmlPackageVersion>
47+
<SystemSecurityPermissionsPackageVersion>5.0.0-rc.1.20370.4</SystemSecurityPermissionsPackageVersion>
48+
<SystemSecurityPrincipalWindowsPackageVersion>5.0.0-rc.1.20370.4</SystemSecurityPrincipalWindowsPackageVersion>
49+
<SystemWindowsExtensionsPackageVersion>5.0.0-rc.1.20370.4</SystemWindowsExtensionsPackageVersion>
50+
</PropertyGroup>
51+
<!-- Packages that come from https://github.com/dotnet/arcade -->
52+
<PropertyGroup>
53+
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20424.23</MicrosoftDotNetApiCompatVersion>
54+
<MicrosoftDotNetCodeAnalysisPackageVersion>5.0.0-beta.20424.23</MicrosoftDotNetCodeAnalysisPackageVersion>
55+
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20424.23</MicrosoftDotNetGenAPIVersion>
56+
</PropertyGroup>
57+
<!-- Packages that come from https://github.com/dotnet/corefxlab -->
58+
<PropertyGroup>
59+
<SystemReflectionTypeLoaderPackageVersion>0.1.0-preview2-181205-2</SystemReflectionTypeLoaderPackageVersion>
60+
</PropertyGroup>
61+
<!-- Maintain System.CodeDom PackageVersion at 4.4.0. See https://github.com/Microsoft/msbuild/issues/3627 -->
62+
<PropertyGroup>
63+
<SystemCodeDomPackageVersionForPresentationBuildTasks>4.4.0</SystemCodeDomPackageVersionForPresentationBuildTasks>
64+
</PropertyGroup>
65+
<!-- Other Packages that require manual updating-->
66+
<PropertyGroup>
67+
<MicrosoftBuildPackageVersion>16.0.461</MicrosoftBuildPackageVersion>
68+
<MicrosoftBuildFrameworkPackageVersion>16.0.461</MicrosoftBuildFrameworkPackageVersion>
69+
<MicrosoftBuildUtilitiesCorePackageVersion>16.0.461</MicrosoftBuildUtilitiesCorePackageVersion>
70+
<MicrosoftBuildLocatorPackageVersion>1.2.2</MicrosoftBuildLocatorPackageVersion>
71+
<XUnitVersion>2.4.0</XUnitVersion>
72+
<XUnitRunnerConsoleVersion>$(XUnitVersion)</XUnitRunnerConsoleVersion>
73+
<XUnitRunnerVisualStudioVersion>$(XUnitVersion)</XUnitRunnerVisualStudioVersion>
74+
<!--
75+
This is the version of the test infrastructure package is compiled against. This should be
76+
removed as part of https://github.com/dotnet/wpf/issues/816
77+
-->
78+
<MicrosoftDotNetWpfTestPackageVersion>1.0.0-beta.19263.1</MicrosoftDotNetWpfTestPackageVersion>
79+
<!-- These versions are specified in global.json -->
80+
<StrawberryPerlVersion>5.28.1.1-1</StrawberryPerlVersion>
81+
<NetFramework48RefAssembliesVersion>0.0.0.1</NetFramework48RefAssembliesVersion>
82+
</PropertyGroup>
83+
<PropertyGroup>
84+
<RestoreSources>
85+
$(RestoreSources);
86+
https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json;
87+
https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json;
88+
https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json;
89+
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
90+
</RestoreSources>
91+
</PropertyGroup>
92+
<!--Package names-->
93+
<PropertyGroup>
94+
<SystemReflectionMetadataLoadContextPackage>System.Reflection.MetadataLoadContext</SystemReflectionMetadataLoadContextPackage>
95+
<MicrosoftPrivateWinformsPackage>Microsoft.Private.Winforms</MicrosoftPrivateWinformsPackage>
96+
<SystemDrawingCommonPackage>System.Drawing.Common</SystemDrawingCommonPackage>
97+
<SystemDirectoryServicesPackage>System.DirectoryServices</SystemDirectoryServicesPackage>
98+
<SystemIOPackagingPackage>System.IO.Packaging</SystemIOPackagingPackage>
99+
<SystemReflectionMetadataLoadContextPackage>System.Reflection.MetadataLoadContext</SystemReflectionMetadataLoadContextPackage>
100+
<SystemDataSqlClientPackage>System.Data.SqlClient</SystemDataSqlClientPackage>
101+
<ServiceProcessServiceControllerPackage>System.ServiceProcess.ServiceController</ServiceProcessServiceControllerPackage>
102+
</PropertyGroup>
103+
<PropertyGroup>
104+
<MicrosoftDotNetWpfGitHubVersion>6.0.0-alpha.1.21071.6</MicrosoftDotNetWpfGitHubVersion>
105+
</PropertyGroup>
106+
</Project>

eng/common/build.ps1

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
[CmdletBinding(PositionalBinding=$false)]
2+
Param(
3+
[string][Alias('c')]$configuration = "Debug",
4+
[string]$platform = $null,
5+
[string] $projects,
6+
[string][Alias('v')]$verbosity = "minimal",
7+
[string] $msbuildEngine = $null,
8+
[bool] $warnAsError = $true,
9+
[bool] $nodeReuse = $true,
10+
[switch][Alias('r')]$restore,
11+
[switch] $deployDeps,
12+
[switch][Alias('b')]$build,
13+
[switch] $rebuild,
14+
[switch] $deploy,
15+
[switch][Alias('t')]$test,
16+
[switch] $integrationTest,
17+
[switch] $performanceTest,
18+
[switch] $sign,
19+
[switch] $pack,
20+
[switch] $publish,
21+
[switch] $clean,
22+
[switch][Alias('bl')]$binaryLog,
23+
[switch][Alias('nobl')]$excludeCIBinarylog,
24+
[switch] $ci,
25+
[switch] $prepareMachine,
26+
[string] $runtimeSourceFeed = '',
27+
[string] $runtimeSourceFeedKey = '',
28+
[switch] $help,
29+
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
30+
)
31+
32+
# Unset 'Platform' environment variable to avoid unwanted collision in InstallDotNetCore.targets file
33+
# some computer has this env var defined (e.g. Some HP)
34+
if($env:Platform) {
35+
$env:Platform=""
36+
}
37+
function Print-Usage() {
38+
Write-Host "Common settings:"
39+
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
40+
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
41+
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
42+
Write-Host " -binaryLog Output binary log (short: -bl)"
43+
Write-Host " -help Print help and exit"
44+
Write-Host ""
45+
46+
Write-Host "Actions:"
47+
Write-Host " -restore Restore dependencies (short: -r)"
48+
Write-Host " -build Build solution (short: -b)"
49+
Write-Host " -rebuild Rebuild solution"
50+
Write-Host " -deploy Deploy built VSIXes"
51+
Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)"
52+
Write-Host " -test Run all unit tests in the solution (short: -t)"
53+
Write-Host " -integrationTest Run all integration tests in the solution"
54+
Write-Host " -performanceTest Run all performance tests in the solution"
55+
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
56+
Write-Host " -sign Sign build outputs"
57+
Write-Host " -publish Publish artifacts (e.g. symbols)"
58+
Write-Host " -clean Clean the solution"
59+
Write-Host ""
60+
61+
Write-Host "Advanced settings:"
62+
Write-Host " -projects <value> Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)"
63+
Write-Host " -ci Set when running on CI server"
64+
Write-Host " -excludeCIBinarylog Don't output binary log (short: -nobl)"
65+
Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build"
66+
Write-Host " -warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
67+
Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
68+
Write-Host ""
69+
70+
Write-Host "Command line arguments not listed above are passed thru to msbuild."
71+
Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
72+
}
73+
74+
. $PSScriptRoot\tools.ps1
75+
76+
function InitializeCustomToolset {
77+
if (-not $restore) {
78+
return
79+
}
80+
81+
$script = Join-Path $EngRoot 'restore-toolset.ps1'
82+
83+
if (Test-Path $script) {
84+
. $script
85+
}
86+
}
87+
88+
function Build {
89+
$toolsetBuildProj = InitializeToolset
90+
InitializeCustomToolset
91+
92+
$bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' }
93+
$platformArg = if ($platform) { "/p:Platform=$platform" } else { '' }
94+
95+
if ($projects) {
96+
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
97+
# Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty.
98+
[string[]] $msbuildArgs = $properties
99+
100+
# Resolve relative project paths into full paths
101+
$projects = ($projects.Split(';').ForEach({Resolve-Path $_}) -join ';')
102+
103+
$msbuildArgs += "/p:Projects=$projects"
104+
$properties = $msbuildArgs
105+
}
106+
107+
MSBuild $toolsetBuildProj `
108+
$bl `
109+
$platformArg `
110+
/p:Configuration=$configuration `
111+
/p:RepoRoot=$RepoRoot `
112+
/p:Restore=$restore `
113+
/p:DeployDeps=$deployDeps `
114+
/p:Build=$build `
115+
/p:Rebuild=$rebuild `
116+
/p:Deploy=$deploy `
117+
/p:Test=$test `
118+
/p:Pack=$pack `
119+
/p:IntegrationTest=$integrationTest `
120+
/p:PerformanceTest=$performanceTest `
121+
/p:Sign=$sign `
122+
/p:Publish=$publish `
123+
@properties
124+
}
125+
126+
try {
127+
if ($clean) {
128+
if (Test-Path $ArtifactsDir) {
129+
Remove-Item -Recurse -Force $ArtifactsDir
130+
Write-Host 'Artifacts directory deleted.'
131+
}
132+
exit 0
133+
}
134+
135+
if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) {
136+
Print-Usage
137+
exit 0
138+
}
139+
140+
if ($ci) {
141+
if (-not $excludeCIBinarylog) {
142+
$binaryLog = $true
143+
}
144+
$nodeReuse = $false
145+
}
146+
147+
if ($restore) {
148+
InitializeNativeTools
149+
}
150+
151+
Build
152+
}
153+
catch {
154+
Write-Host $_.ScriptStackTrace
155+
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
156+
ExitWithExitCode 1
157+
}
158+
159+
ExitWithExitCode 0

0 commit comments

Comments
 (0)