From 02feec9f9a6ee956ada5b293a039f03b40a3dc18 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Sat, 31 Jul 2021 13:07:13 +0530 Subject: [PATCH] Upgrade Build and CI scripts Rename Solution file. Update Azure DevOps CI script. Use VS2022 to build the project. Replace Cake Build tasks with PowerShell scripts. Remove Cake Build dependency for building the project. --- .gitignore | 192 +++++++----- Directory.Build.props | 2 + Directory.Build.rsp | 5 + GazeInputTest/GazeInputTest.csproj | 2 +- .../Common/XmlWriterHelper.cs | 2 + ...Microsoft.Toolkit.Uwp.Notifications.csproj | 6 +- ...Microsoft.Toolkit.Uwp.Notifications.nuspec | 60 ++-- .../Microsoft.Toolkit.Uwp.SampleApp.csproj | 2 +- .../Common/MetadataRegistrationBase.cs | 11 +- SmokeTests/SmokeTest.csproj | 2 +- SmokeTests/SmokeTest.sln | 3 +- ...ysis.ps1 => SmokeTest_AnalyzePackages.ps1} | 16 +- ...ion.ps1 => SmokeTest_DownloadPackages.ps1} | 6 +- SmokeTests/SmokeTests.proj | 14 +- UITests/UITests.App/UITests.App.csproj | 2 +- .../UITests.Tests.MSTest.csproj | 2 +- UITests/UITests.Tests.Shared/UITestBase.cs | 2 +- .../UITests.Tests.TAEF.csproj | 24 +- .../UnitTests.Notifications.UWP.csproj | 2 +- .../UnitTests.Notifications.WinRT.csproj | 2 +- UnitTests/UnitTests.UWP/UnitTests.UWP.csproj | 2 +- .../UnitTests.XamlIslands.UWPApp.csproj | 2 +- ...Toolkit.sln => WindowsCommunityToolkit.sln | 52 ++-- azure-pipelines.yml | 239 +++++++++------ build/Build.bat | 3 - build/Find-WindowsSDKVersions.ps1 | 168 ---------- build/Icon.png | Bin 0 -> 767 bytes build/Install-WindowsSDK.ps1 | 10 - build/Install-WindowsSdkISO.ps1 | 256 ---------------- build/Run-UITests.ps1 | 18 ++ build/Style-Xaml.ps1 | 4 + build/StyleXaml.bat | 3 - build/Update-Headers.ps1 | 100 ++++++ build/UpdateHeaders.bat | 3 - build/Windows.Toolkit.Common.props | 6 +- build/Windows.Toolkit.Common.targets | 6 +- build/Windows.Toolkit.GetBuildOutputs.targets | 51 ++++ build/Windows.Toolkit.UWP.Controls.props | 15 + build/Windows.Toolkit.UWP.Controls.targets | 48 +-- .../Windows.Toolkit.VisualStudio.Design.props | 2 - ...indows.Toolkit.VisualStudio.Design.targets | 16 +- build/build.cake | 177 ++--------- build/build.ps1 | 287 ------------------ build/tools/packages.config | 3 - nuget.config | 5 - 45 files changed, 648 insertions(+), 1185 deletions(-) create mode 100644 Directory.Build.rsp rename SmokeTests/{SmokeTestAnalysis.ps1 => SmokeTest_AnalyzePackages.ps1} (98%) rename SmokeTests/{SmokeTestDownloadNuGetVersion.ps1 => SmokeTest_DownloadPackages.ps1} (91%) rename Windows Community Toolkit.sln => WindowsCommunityToolkit.sln (98%) delete mode 100644 build/Build.bat delete mode 100644 build/Find-WindowsSDKVersions.ps1 create mode 100644 build/Icon.png delete mode 100644 build/Install-WindowsSDK.ps1 delete mode 100644 build/Install-WindowsSdkISO.ps1 create mode 100644 build/Run-UITests.ps1 create mode 100644 build/Style-Xaml.ps1 delete mode 100644 build/StyleXaml.bat create mode 100644 build/Update-Headers.ps1 delete mode 100644 build/UpdateHeaders.bat create mode 100644 build/Windows.Toolkit.GetBuildOutputs.targets create mode 100644 build/Windows.Toolkit.UWP.Controls.props delete mode 100644 build/build.ps1 delete mode 100644 build/tools/packages.config diff --git a/.gitignore b/.gitignore index f422ca85891..ae23e7af16d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,14 +7,11 @@ ~packages/ # User-specific files +*.rsuser *.suo *.user *.userosscache *.sln.docstates -*.filters - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs # Build results [Dd]ebug/ @@ -23,38 +20,63 @@ [Rr]eleases/ x64/ x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ +[Ee]xt/ +[Ll]og/ +[Ll]ogs/ -# Visual Studio 2015 cache/options directory +# Visual Studio 2015/2017 cache/options directory .vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c -# DNX +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core project.lock.json +project.fragment.lock.json artifacts/ +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk *.meta *.obj +*.iobj *.pch *.pdb +*.ipdb *.pgc *.pgd *.rsp @@ -64,7 +86,9 @@ artifacts/ *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log +*.tlog *.vspscc *.vssscc .builds @@ -79,17 +103,21 @@ _Chutzpah* ipch/ *.aps *.ncb +*.opendb *.opensdf *.sdf *.cachefile +*.VC.db +*.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx +*.sap -# TFS 2012 Local Workspace -$tf/ +# Visual Studio Trace Files +*.e2e # Guidance Automation Toolkit *.gpState @@ -99,84 +127,82 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in -.JustCode - # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover -# NCrunch -_NCrunch_* -.*crunch*.local.xml +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json -# MightyMoose -*.mm.* -AutoTest.Net/ +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info -# Web workbench (sass) -.sass-cache/ +# Visual Studio code coverage results +*.coverage +*.coveragexml # Installshield output folder [Ee]xpress/ -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -## TODO: Comment the next line if you want to checkin your -## web deploy settings but do note that will include unencrypted -## passwords -#*.pubxml - +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml *.publishproj +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore -**/packages/* +**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/packages/build/ +!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets -# Windows Store app package directory +# Windows Store app package directories and files AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!?*.[Cc]ache/ # Others ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.dbproj.schemaview +*.jfm *.pfx *.publishsettings -node_modules/ orleans.codegen.cs # RIA/Silverlight projects @@ -189,46 +215,54 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings +ServiceFabricBackup/ +*.rptproj.bak # Microsoft Fakes FakesAssemblies/ -# Node.js Tools for Visual Studio -.ntvs_analysis.dat +# CodeRush personal settings +.cr/personal -# Visual Studio 6 build log -*.plg +# MSBuild Binary and Structured Log +*.binlog -# Visual Studio 6 workspace options file -*.opt +# MFractors (Xamarin productivity tool) working folder +.mfractor/ -# LightSwitch generated files -GeneratedArtifacts/ -_Pvt_Extensions/ -ModelManifest.xml -BundleArtifacts -!/build -/build/tools/GitVersion.CommandLine -AppPackages +# Local History for Visual Studio +.localhistory/ -# NuGet V3 artifacts -*-packages.config -*.nuget.props -*.nuget.targets -project.lock.json -msbuild.binlog -*.project.lock.json -/build/tools/** -!/build/tools/packages.config +# Visual Studio History (VSHistory) files +.vshistory/ + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# MSBuild response files +!MSBuild.rsp +!Directory.Build.rsp # Generated file from .ttinclude **/Generated/TypeInfo.g.cs diff --git a/Directory.Build.props b/Directory.Build.props index c16e8639f2d..f548e7f5be6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -53,6 +53,8 @@ + + diff --git a/Directory.Build.rsp b/Directory.Build.rsp new file mode 100644 index 00000000000..0783b1a95be --- /dev/null +++ b/Directory.Build.rsp @@ -0,0 +1,5 @@ +-NoLogo +-MaxCPUCount +-BinaryLogger +-NodeReuse:True +-Verbosity:Normal \ No newline at end of file diff --git a/GazeInputTest/GazeInputTest.csproj b/GazeInputTest/GazeInputTest.csproj index 3d3a4b93482..e02f90d28ed 100644 --- a/GazeInputTest/GazeInputTest.csproj +++ b/GazeInputTest/GazeInputTest.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6} AppContainerExe Properties diff --git a/Microsoft.Toolkit.Uwp.Notifications/Common/XmlWriterHelper.cs b/Microsoft.Toolkit.Uwp.Notifications/Common/XmlWriterHelper.cs index caa8e9053b7..96ef30e3caf 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/Common/XmlWriterHelper.cs +++ b/Microsoft.Toolkit.Uwp.Notifications/Common/XmlWriterHelper.cs @@ -173,7 +173,9 @@ private static EnumStringAttribute GetEnumStringAttribute(Enum enumValue) object[] attrs = memberInfo[0].GetCustomAttributes(typeof(EnumStringAttribute), false); if (attrs != null && attrs.Length > 0) + { return attrs[0] as EnumStringAttribute; + } } return null; diff --git a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj index 76f8ab79baf..e0ebf6cbce9 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj +++ b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj @@ -5,12 +5,12 @@ Microsoft.Toolkit.Uwp.Notifications.nuspec - + 10.0.$(TargetPlatformRevision).0 - $(DefineConstants);NETFX_CORE + NETFX_CORE @@ -32,7 +32,7 @@ false $(DefineConstants);WINDOWS_UAP;WINRT $(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets - + UAP,Version=v10.0 Native,Version=v0.0 diff --git a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec index 8b96f8a3bd6..d32968bdf10 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec +++ b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec @@ -7,7 +7,7 @@ true MIT https://github.com/CommunityToolkit/WindowsCommunityToolkit - https://raw.githubusercontent.com/CommunityToolkit/WindowsCommunityToolkit/main/build/nuget.png + ReadMe.md Icon.png The official way to send toast notifications on Windows 10 via code rather than XML, with the help of IntelliSense. Supports all C# app types, including WPF, UWP, WinForms, and Console, even without packaging your app as MSIX. Also supports C++ UWP apps. @@ -23,9 +23,6 @@ - - - @@ -33,6 +30,16 @@ + + + + + + + + + + @@ -42,45 +49,40 @@ - - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + - - - - + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj index 62dbb7cfda7..2a1f88a2380 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj +++ b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {719C43C6-8753-4395-ADAA-2FCC70F76BF3} AppContainerExe Properties diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Common/MetadataRegistrationBase.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Common/MetadataRegistrationBase.cs index 000ecad7571..3f9573b9ff4 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Common/MetadataRegistrationBase.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Core.Design/Common/MetadataRegistrationBase.cs @@ -7,6 +7,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.IO; using System.Linq; using System.Reflection; using System.Xml.Linq; @@ -101,7 +102,15 @@ private void AddDescriptions(AttributeTableBuilder builder) XDocument xDoc; try { - xDoc = XDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream(XmlResourceName)); + var basePath = Path.GetDirectoryName(typeof(MetadataRegistrationBase).Assembly.Location); + string xmlDocPath = basePath; + for (int i = 0; i < 2; i++) + { + basePath = Path.GetDirectoryName(basePath); + xmlDocPath = Path.Combine(basePath, XmlResourceName); + if (File.Exists(xmlDocPath)) break; + } + xDoc = XDocument.Load(xmlDocPath); } catch { diff --git a/SmokeTests/SmokeTest.csproj b/SmokeTests/SmokeTest.csproj index 582f42286f9..7339eb01b83 100644 --- a/SmokeTests/SmokeTest.csproj +++ b/SmokeTests/SmokeTest.csproj @@ -11,7 +11,7 @@ Debug - x86 + x64 {A6E4CB52-1025-4BBA-9C65-BB871D1FB53F} AppContainerExe Properties diff --git a/SmokeTests/SmokeTest.sln b/SmokeTests/SmokeTest.sln index 8dbb8bcd88d..96a1f86b143 100644 --- a/SmokeTests/SmokeTest.sln +++ b/SmokeTests/SmokeTest.sln @@ -8,7 +8,8 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{86F3F991-6DDA-442D-A610-9309D6559522}" ProjectSection(SolutionItems) = preProject nuget.config = nuget.config - SmokeTestAnalysis.ps1 = SmokeTestAnalysis.ps1 + SmokeTest_AnalyzePackages.ps1 = SmokeTest_AnalyzePackages.ps1 + SmokeTest_DownloadPackages.ps1 = SmokeTest_DownloadPackages.ps1 SmokeTests.proj = SmokeTests.proj EndProjectSection EndProject diff --git a/SmokeTests/SmokeTestAnalysis.ps1 b/SmokeTests/SmokeTest_AnalyzePackages.ps1 similarity index 98% rename from SmokeTests/SmokeTestAnalysis.ps1 rename to SmokeTests/SmokeTest_AnalyzePackages.ps1 index 5a4852e3e55..449627846ec 100644 --- a/SmokeTests/SmokeTestAnalysis.ps1 +++ b/SmokeTests/SmokeTest_AnalyzePackages.ps1 @@ -5,9 +5,9 @@ Write-Host "Running Smoke Test Package Analyis" Write-Host "----------------------------------" ##### -# This script analyzes the final packaged outputs of +# This script analyzes the final packaged outputs of # There are two things analyzed: -# - The MSIX UPLOAD package has the raw dependencies before .NET Native compilation, +# - The MSIX UPLOAD package has the raw dependencies before .NET Native compilation, # this can help determine the maximum impact of the package if everything were to be included. # - The MSIX BUNDLE package is the final .NET Native compiled app, # this can be used to help determine the minimal impact of the package if only a few things are used. @@ -96,7 +96,7 @@ function Expand-MsixBundlePackage { } if (Test-Path $PackagePath) -{ +{ Push-Location $PackagePath Write-Host "Extracting Baseline..." @@ -133,7 +133,7 @@ if (Test-Path $PackagePath) #$ProgressPreference="SilentlyContinue" Expand-MsixUploadPackage $Package.Name -Destination $TempFolder - + # Also expand the final bundle based on the namespace name within the package. Expand-MsixBundlePackage ($DirPattern -f $PackageShortName) -Destination $TempFolder2 #$ProgressPreference="Continue" @@ -184,7 +184,7 @@ if (Test-Path $PackagePath) { Write-Host (" Lib (self): {0} = {1:n0}" -f $file.Name, $file.Length) -ForegroundColor White } - else + else { Write-Host (" Additional: {0} = {1:n0}" -f $file.Name, $file.Length) -ForegroundColor Yellow } @@ -233,7 +233,7 @@ if (Test-Path $PackagePath) { Write-Host (" Lib (self): {0} = {1:n0}" -f $file.Name, $file.Length) -ForegroundColor White } - else + else { Write-Host (" Additional: {0} = {1:n0}" -f $file.Name, $file.Length) -ForegroundColor Yellow } @@ -251,7 +251,7 @@ if (Test-Path $PackagePath) Pop-Location } -else +else { - Write-Error "Path $PackagePath not found for analysis!" + Write-Error "Path $PackagePath not found for analysis!" } \ No newline at end of file diff --git a/SmokeTests/SmokeTestDownloadNuGetVersion.ps1 b/SmokeTests/SmokeTest_DownloadPackages.ps1 similarity index 91% rename from SmokeTests/SmokeTestDownloadNuGetVersion.ps1 rename to SmokeTests/SmokeTest_DownloadPackages.ps1 index 1cf1170cd3e..2dfd16dbcba 100644 --- a/SmokeTests/SmokeTestDownloadNuGetVersion.ps1 +++ b/SmokeTests/SmokeTest_DownloadPackages.ps1 @@ -1,15 +1,15 @@ ##### -# This script downloads the specified version of NuGet packages for +# This script downloads the specified version of NuGet packages for # the required smoke tests from NuGet. # This is useful for performing current analysis on prior builds of the Toolkit. # # Pass it a Version Number of the Package you'd like to download, otherwise it'll download the LKG. -# Defaults download to ../bin/nupkg/ directory +# Defaults download to ../~packages/bin/ directory #### param ( [string] $Version = '', - [string] $DownloadPath = '../bin/nupkg/' + [string] $DownloadPath = '../~packages/bin/' ) $global:ProgressPreference="SilentlyContinue" diff --git a/SmokeTests/SmokeTests.proj b/SmokeTests/SmokeTests.proj index 80ee4977a6d..b0b8994c7f3 100644 --- a/SmokeTests/SmokeTests.proj +++ b/SmokeTests/SmokeTests.proj @@ -1,7 +1,7 @@ - + - x86 + x64 Release UWPBaseline; @@ -27,16 +27,16 @@ - - + - @@ -77,10 +77,10 @@ - $(MSBuildThisFileDirectory)..\~packages\bin + $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', '~packages', 'bin')) - + diff --git a/UITests/UITests.App/UITests.App.csproj b/UITests/UITests.App/UITests.App.csproj index 37e7f169784..f93bde1b670 100644 --- a/UITests/UITests.App/UITests.App.csproj +++ b/UITests/UITests.App/UITests.App.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {05C83067-FA46-45E2-BEC4-EDEE84AD18D0} AppContainerExe Properties diff --git a/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj b/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj index c8c752b602a..49846f8c41b 100644 --- a/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj +++ b/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj @@ -2,7 +2,7 @@ Exe - win10-x86 + win10-x64 netcoreapp3.1 diff --git a/UITests/UITests.Tests.Shared/UITestBase.cs b/UITests/UITests.Tests.Shared/UITestBase.cs index 06cf3b328fd..9d84fced5ad 100644 --- a/UITests/UITests.Tests.Shared/UITestBase.cs +++ b/UITests/UITests.Tests.Shared/UITestBase.cs @@ -75,7 +75,7 @@ internal static TestApplicationInfo WinUICSharpUWPSampleApp baseDir = baseDir.Parent; } - string publishDir = Path.Combine(baseDir.FullName, "~publish"); + string publishDir = Path.Combine(baseDir.FullName, "~publish", "UITests.App"); Log.Comment($"Base Package Search Directory = \"{publishDir}\""); diff --git a/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj b/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj index 4dd2896bfa9..e607e2c35e8 100644 --- a/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj +++ b/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj @@ -2,28 +2,36 @@ Exe - x86 - win10-x86 + x64 + win10-x64 netcoreapp3.1 true + USING_TAEF false true - $(DefineConstants);USING_TAEF - $(PkgTAEF_Redist_Wlk)\build\Binaries\$(PlatformTarget)\CoreClr\ + + + $([MSBuild]::NormalizeDirectory('$(PublishDir)', '..', 'UITests.App')) + $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', 'UITests.App')) + + $([MSBuild]::NormalizeDirectory('$(PkgMUXCustomBuildTasks)', 'tools', '$(PlatformTarget)')) + $([MSBuild]::NormalizeDirectory('$(PkgTAEF_Redist_Wlk)', 'build', 'Binaries', '$(PlatformTarget)', 'CoreClr')) + + - - - - + + + + diff --git a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj index a1d15048b33..c5f7d72c7b9 100644 --- a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj +++ b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD} AppContainerExe Properties diff --git a/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj b/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj index 5225cf1aa57..6a623a0e4bc 100644 --- a/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj +++ b/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {EFA96B3C-857E-4659-B942-6BEF7719F4CA} AppContainerExe Properties diff --git a/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj b/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj index b26646d8534..d10a706b2f1 100644 --- a/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj +++ b/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {A139968E-AD78-4E8C-93B8-9A5523BCAC89} AppContainerExe Properties diff --git a/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj b/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj index 69630b6011e..7d9c70d4cf5 100644 --- a/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj +++ b/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj @@ -2,7 +2,7 @@ Debug - x86 + x64 {804D0681-52F6-4E61-864A-699F0AB44B20} AppContainerExe Properties diff --git a/Windows Community Toolkit.sln b/WindowsCommunityToolkit.sln similarity index 98% rename from Windows Community Toolkit.sln rename to WindowsCommunityToolkit.sln index a0c4a505487..bba613a2403 100644 --- a/Windows Community Toolkit.sln +++ b/WindowsCommunityToolkit.sln @@ -172,7 +172,7 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|Any CPU.ActiveCfg = Debug|x86 + {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|Any CPU.ActiveCfg = Debug|x64 {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|ARM.ActiveCfg = Debug|ARM {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|ARM.Build.0 = Debug|ARM {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|ARM.Deploy.0 = Debug|ARM @@ -185,7 +185,7 @@ Global {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|x86.ActiveCfg = Debug|x86 {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|x86.Build.0 = Debug|x86 {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Debug|x86.Deploy.0 = Debug|x86 - {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Release|Any CPU.ActiveCfg = Release|x86 + {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Release|Any CPU.ActiveCfg = Release|x64 {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Release|ARM.ActiveCfg = Release|ARM {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Release|ARM.Build.0 = Release|ARM {719C43C6-8753-4395-ADAA-2FCC70F76BF3}.Release|ARM.Deploy.0 = Release|ARM @@ -218,8 +218,8 @@ Global {805F80DF-75C6-4C2F-8FD9-B47F6D0DF5A3}.Release|x64.Build.0 = Release|Any CPU {805F80DF-75C6-4C2F-8FD9-B47F6D0DF5A3}.Release|x86.ActiveCfg = Release|Any CPU {805F80DF-75C6-4C2F-8FD9-B47F6D0DF5A3}.Release|x86.Build.0 = Release|Any CPU - {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|Any CPU.ActiveCfg = Debug|x86 - {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|Any CPU.Build.0 = Debug|x86 + {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|Any CPU.ActiveCfg = Debug|x64 + {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|Any CPU.Build.0 = Debug|x64 {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|ARM.ActiveCfg = Debug|ARM {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|ARM.Build.0 = Debug|ARM {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|ARM.Deploy.0 = Debug|ARM @@ -232,8 +232,8 @@ Global {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|x86.ActiveCfg = Debug|x86 {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|x86.Build.0 = Debug|x86 {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Debug|x86.Deploy.0 = Debug|x86 - {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|Any CPU.ActiveCfg = Release|x86 - {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|Any CPU.Build.0 = Release|x86 + {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|Any CPU.ActiveCfg = Release|x64 + {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|Any CPU.Build.0 = Release|x64 {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|ARM.ActiveCfg = Release|ARM {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|ARM.Build.0 = Release|ARM {A139968E-AD78-4E8C-93B8-9A5523BCAC89}.Release|ARM.Deploy.0 = Release|ARM @@ -326,8 +326,8 @@ Global {DAEB9CEC-C817-33B2-74B2-BC379380DB72}.Release|x64.Build.0 = Release|Any CPU {DAEB9CEC-C817-33B2-74B2-BC379380DB72}.Release|x86.ActiveCfg = Release|Any CPU {DAEB9CEC-C817-33B2-74B2-BC379380DB72}.Release|x86.Build.0 = Release|Any CPU - {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|Any CPU.ActiveCfg = Debug|x86 - {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|Any CPU.Build.0 = Debug|x86 + {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|Any CPU.ActiveCfg = Debug|x64 + {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|Any CPU.Build.0 = Debug|x64 {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|ARM.ActiveCfg = Debug|ARM {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|ARM.Build.0 = Debug|ARM {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|ARM.Deploy.0 = Debug|ARM @@ -340,8 +340,8 @@ Global {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|x86.ActiveCfg = Debug|x86 {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|x86.Build.0 = Debug|x86 {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Debug|x86.Deploy.0 = Debug|x86 - {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|Any CPU.ActiveCfg = Release|x86 - {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|Any CPU.Build.0 = Release|x86 + {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|Any CPU.ActiveCfg = Release|x64 + {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|Any CPU.Build.0 = Release|x64 {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|ARM.ActiveCfg = Release|ARM {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|ARM.Build.0 = Release|ARM {BAB1CAF4-C400-4A7F-A987-C576DE63CFFD}.Release|ARM.Deploy.0 = Release|ARM @@ -512,7 +512,7 @@ Global {5BF75694-798A-43A0-8150-415DE195359C}.Release|x64.Build.0 = Release|Any CPU {5BF75694-798A-43A0-8150-415DE195359C}.Release|x86.ActiveCfg = Release|Any CPU {5BF75694-798A-43A0-8150-415DE195359C}.Release|x86.Build.0 = Release|Any CPU - {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|Any CPU.ActiveCfg = Debug|x64 {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|ARM.ActiveCfg = Debug|ARM {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|ARM.Build.0 = Debug|ARM {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|ARM.Deploy.0 = Debug|ARM @@ -525,7 +525,7 @@ Global {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|x86.ActiveCfg = Debug|x86 {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|x86.Build.0 = Debug|x86 {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Debug|x86.Deploy.0 = Debug|x86 - {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Release|Any CPU.ActiveCfg = Release|x86 + {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Release|Any CPU.ActiveCfg = Release|x64 {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Release|ARM.ActiveCfg = Release|ARM {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Release|ARM.Build.0 = Release|ARM {A122EA02-4DE7-413D-BFBF-AF7DFC668DD6}.Release|ARM.Deploy.0 = Release|ARM @@ -580,19 +580,23 @@ Global {CB444381-18BA-4A51-BB32-3A498BCC1E99}.Release|x86.Build.0 = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|ARM.Build.0 = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|ARM64.Build.0 = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|x64.ActiveCfg = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|x64.Build.0 = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|x86.ActiveCfg = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Debug|x86.Build.0 = Debug|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|Any CPU.ActiveCfg = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|ARM.ActiveCfg = Release|Any CPU + {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|ARM.Build.0 = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|ARM64.ActiveCfg = Release|Any CPU + {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|ARM64.Build.0 = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|x64.ActiveCfg = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|x64.Build.0 = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|x86.ActiveCfg = Release|Any CPU {F5929F8E-7BC5-4A7B-A92A-AC751F7906E4}.Release|x86.Build.0 = Release|Any CPU - {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|Any CPU.ActiveCfg = Debug|x86 + {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|Any CPU.ActiveCfg = Debug|x64 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|ARM.ActiveCfg = Debug|ARM {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|ARM.Build.0 = Debug|ARM {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|ARM.Deploy.0 = Debug|ARM @@ -605,16 +609,20 @@ Global {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|x86.ActiveCfg = Debug|x86 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|x86.Build.0 = Debug|x86 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Debug|x86.Deploy.0 = Debug|x86 - {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|Any CPU.ActiveCfg = Release|x86 + {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|Any CPU.ActiveCfg = Release|x64 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|ARM.ActiveCfg = Release|ARM + {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|ARM.Build.0 = Release|ARM + {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|ARM.Deploy.0 = Release|ARM {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|ARM64.ActiveCfg = Release|ARM64 + {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|ARM64.Build.0 = Release|ARM64 + {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|ARM64.Deploy.0 = Release|ARM64 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|x64.ActiveCfg = Release|x64 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|x64.Build.0 = Release|x64 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|x64.Deploy.0 = Release|x64 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|x86.ActiveCfg = Release|x86 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|x86.Build.0 = Release|x86 {DCFBF9F1-2BBE-498D-B6C9-8ADE50C06CDC}.Release|x86.Deploy.0 = Release|x86 - {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|Any CPU.ActiveCfg = Debug|x86 + {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|Any CPU.ActiveCfg = Debug|x64 {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|ARM.ActiveCfg = Debug|ARM {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|ARM.Build.0 = Debug|ARM {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|ARM.Deploy.0 = Debug|ARM @@ -627,9 +635,13 @@ Global {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|x86.ActiveCfg = Debug|x86 {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|x86.Build.0 = Debug|x86 {804D0681-52F6-4E61-864A-699F0AB44B20}.Debug|x86.Deploy.0 = Debug|x86 - {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|Any CPU.ActiveCfg = Release|x86 + {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|Any CPU.ActiveCfg = Release|x64 {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|ARM.ActiveCfg = Release|ARM + {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|ARM.Build.0 = Release|ARM + {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|ARM.Deploy.0 = Release|ARM {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|ARM64.ActiveCfg = Release|ARM64 + {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|ARM64.Build.0 = Release|ARM64 + {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|ARM64.Deploy.0 = Release|ARM64 {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|x64.ActiveCfg = Release|x64 {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|x64.Build.0 = Release|x64 {804D0681-52F6-4E61-864A-699F0AB44B20}.Release|x64.Deploy.0 = Release|x64 @@ -720,8 +732,8 @@ Global {54349AB0-9E41-4AA6-849C-EC9CE80CDD2A}.Release|x86.ActiveCfg = Release|Any CPU {54349AB0-9E41-4AA6-849C-EC9CE80CDD2A}.Release|x86.Build.0 = Release|Any CPU {54349AB0-9E41-4AA6-849C-EC9CE80CDD2A}.Release|x86.Deploy.0 = Release|Any CPU - {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|Any CPU.ActiveCfg = Debug|x86 - {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|Any CPU.Build.0 = Debug|x86 + {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|Any CPU.ActiveCfg = Debug|x64 + {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|Any CPU.Build.0 = Debug|x64 {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|ARM.ActiveCfg = Debug|ARM {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|ARM.Build.0 = Debug|ARM {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|ARM.Deploy.0 = Debug|ARM @@ -734,8 +746,8 @@ Global {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|x86.ActiveCfg = Debug|x86 {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|x86.Build.0 = Debug|x86 {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Debug|x86.Deploy.0 = Debug|x86 - {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|Any CPU.ActiveCfg = Release|x86 - {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|Any CPU.Build.0 = Release|x86 + {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|Any CPU.ActiveCfg = Release|x64 + {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|Any CPU.Build.0 = Release|x64 {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|ARM.ActiveCfg = Release|ARM {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|ARM.Build.0 = Release|ARM {05C83067-FA46-45E2-BEC4-EDEE84AD18D0}.Release|ARM.Deploy.0 = Release|ARM diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8211cc0cdef..03cbf721714 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,135 +9,192 @@ pr: - rel/* pool: - vmImage: windows-2019 + vmImage: windows-latest variables: BuildConfiguration: Release + BuildDirectory: ~build\ + PackagesDirectory: ~packages\ jobs: -### BUILD ### + +### Build and Test Solution ### - job: BuildBits + displayName: Build and Test Solution timeoutInMinutes: 60 + variables: + BuildSolution: WindowsCommunityToolkit.sln steps: - - task: BatchScript@1 - inputs: - filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat" - arguments: -no_logo - modifyEnvironment: true - displayName: Setup Environment Variables - - - task: NuGetToolInstaller@0 - displayName: Use NuGet 5.11 - inputs: - versionSpec: 5.11.0 - - - task: DotNetCoreCLI@2 - inputs: - command: custom - custom: tool - arguments: install --tool-path . nbgv - displayName: Install NBGV tool - + # Set Build Version - script: nbgv cloud - displayName: Set Version - - #- powershell: .\build\Install-WindowsSdkISO.ps1 19041 - # displayName: Insider SDK + displayName: Set Build version - - powershell: .\build\build.ps1 -Target Build - displayName: Build + # Verify headers + - pwsh: build\Update-Headers.ps1 -Verify + displayName: Verify headers - ### Unit Tests ### - - - powershell: .\build\build.ps1 -Target Test - displayName: Test - - - task: PublishTestResults@2 + # Restore solution + - task: VSBuild@1 + displayName: Restore solution inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '**/VsTestResults*.trx' - displayName: Publish Test Results - condition: always() - - ### UI Integration Tests ### + solution: $(BuildSolution) + configuration: $(BuildConfiguration) + maximumCpuCount: true + msbuildArchitecture: x64 + msbuildArgs: "-t:Restore" + + # Build solution + - task: VSBuild@1 + displayName: Build solution + inputs: + solution: $(BuildSolution) + configuration: $(BuildConfiguration) + maximumCpuCount: true + msbuildArchitecture: x64 + msbuildArgs: "-t:Build" - - powershell: .\build\build.ps1 -Target UITest - displayName: UI Integration Tests + ### Test solution ### - - task: PublishPipelineArtifact@1 - displayName: Publish UI Test Results + # Run .NET Core Unit tests + - task: VSTest@2 + displayName: Run .NET Core Unit tests + inputs: + configuration: $(BuildConfiguration) + maximumCpuCount: true + runSettingsFile: .runsettings + searchFolder: $(BuildDirectory) + testAssemblyVer2: '**\bin\**\UnitTests*NetCore.dll' + otherConsoleOptions: '/Logger:trx;LogFileName=VSTestResults.NetCore.trx' + + # Run UWP Unit tests + - task: VSTest@2 + displayName: Run UWP Unit tests + inputs: + configuration: $(BuildConfiguration) + maximumCpuCount: true + runSettingsFile: .runsettings + searchFolder: $(BuildDirectory) + testAssemblyVer2: '**\bin\**\UnitTests*UWP.build.appxrecipie' + otherConsoleOptions: '/Logger:trx;LogFileName=VSTestResults.UWP.trx' + + # Run MSTest UI tests + - task: VSTest@2 + displayName: Run MSTest UI tests inputs: - targetPath: .\build\UITestResults.wtl - artifactName: WexUITestLogFileOutput + configuration: $(BuildConfiguration) + maximumCpuCount: true + runSettingsFile: .runsettings + searchFolder: $(BuildDirectory) + testAssemblyVer2: '**\bin\**\UITests*MSTest\**\UITests*MSTest.dll' + otherConsoleOptions: '/Logger:trx;LogFileName=VSTestResults.UWP.UI.trx' + uiTests: true + + # Run TAEF UI tests + - script: build\Run-UITests.ps1 + displayName: Run TAEF UI tests + + # Run TAEF UI tests + - task: VSBuild@1 + displayName: Run TAEF UI tests + inputs: + solution: $(BuildSolution) + configuration: $(BuildConfiguration) + maximumCpuCount: true + msbuildArchitecture: x64 + msbuildArgs: "-t:RunUITests" + + # Publish TAEF test results + - publish: $(BuildDirectory)~build\UITests*\**\*.wtl + displayName: Publish TAEF test results + artifact: WexUITestResults condition: always() - - task: PublishPipelineArtifact@1 - displayName: Publish Test WexLogFileOutput - inputs: - targetPath: .\build\WexLogFileOutput - artifactName: WexUnitTestErrorLogFileOutput + # Publish TAEF test logs + - publish: $(BuildDirectory)~build\UITests*\**\WexLogFileOutput + displayName: Publish TAEF test logs + artifact: WexLogFileOutput condition: failed() - ### Package ### - - - powershell: .\build\build.ps1 -Target Package - displayName: Package - - - task: PowerShell@2 - displayName: Authenticode Sign Packages + # Pack solution + - task: VSBuild@1 + displayName: Pack solution inputs: - filePath: build/Sign-Package.ps1 + solution: $(BuildSolution) + configuration: $(BuildConfiguration) + maximumCpuCount: true + msbuildArchitecture: x64 + msbuildArgs: "-t:Pack" + + # Sign packages + - pwsh: build\Sign-Package.ps1 + displayName: Sign packages env: SignClientUser: $(SignClientUser) SignClientSecret: $(SignClientSecret) - ArtifactDirectory: ~packages\bin - condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], ''))) + ArtifactDirectory: $(PackagesDirectory)bin + condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], ''))) - - task: PublishPipelineArtifact@1 - displayName: Publish Package Artifacts - inputs: - targetPath: .\~packages\bin - artifactName: Packages - -### Smoke Tests ### + # Publish build artifacts + - publish: $(PackagesDirectory)bin + artifact: Packages + displayName: Publish package artifacts +### Run Smoke Tests on Generated Packages ### - job: SmokeTests + displayName: Run Smoke Tests on Generated Packages dependsOn: BuildBits timeoutInMinutes: 60 + variables: + BuildSolution: SmokeTests\SmokeTest.sln + BuildProject: SmokeTests\SmokeTests.proj steps: + # Set Build Version + - script: nbgv cloud + displayName: Set Build version + + # Download Published packages - task: DownloadPipelineArtifact@2 - displayName: Download NuGet Packages Artifact + displayName: Download NuGet Packages inputs: artifact: Packages - path: .\~packages\bin + path: $(PackagesDirectory)bin - - task: DotNetCoreCLI@2 + # Restore solution + - task: VSBuild@1 + displayName: Restore solution inputs: - command: custom - custom: tool - arguments: install --tool-path . nbgv - displayName: Install NBGV tool - - - script: nbgv cloud - displayName: Set Version + solution: $(BuildSolution) + configuration: $(BuildConfiguration) + maximumCpuCount: true + msbuildArchitecture: x64 + msbuildArgs: "-t:Restore" + + # Run Smoke tests + - task: VSBuild@1 + displayName: Run Smoke tests + inputs: + solution: $(BuildProject) + configuration: $(BuildConfiguration) + maximumCpuCount: true + msbuildArchitecture: x64 + msbuildArgs: "-t:RunSmokeTests" - - powershell: .\build\build.ps1 -Target SmokeTest - displayName: SmokeTest + # Analyze Package size + - pwsh: SmokeTests\SmokeTest_AnalyzePackages.ps1 + displayName: Analyze Package Size + # Copy files to Artifacts directory - task: CopyFiles@2 inputs: - sourceFolder: .\SmokeTests\AppPackages + sourceFolder: SmokeTests\AppPackages contents: '**\*.msixbundle' - targetFolder: $(build.artifactstagingdirectory)\SmokeTestBundles - - - task: PublishBuildArtifacts@1 - displayName: Publish Smoke Test Artifacts - inputs: - pathToPublish: $(build.artifactstagingdirectory)\SmokeTestBundles - artifactType: container - artifactName: SmokeTestBundles - - - powershell: .\SmokeTests\SmokeTestAnalysis.ps1 - displayName: Analyze Package Sizes + targetFolder: $(Build.StagingDirectory)\SmokeTestBundles + cleanTargetFolder: yes + preserveTimestamp: yes + + # Publish smoke test artifacts + - publish: $(Build.StagingDirectory)\SmokeTestBundles + artifact: SmokeTestBundles + displayName: Publish smoke test artifacts diff --git a/build/Build.bat b/build/Build.bat deleted file mode 100644 index 4b8cd487a6a..00000000000 --- a/build/Build.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF -PowerShell.exe -file "%~dp0build.ps1" -PAUSE \ No newline at end of file diff --git a/build/Find-WindowsSDKVersions.ps1 b/build/Find-WindowsSDKVersions.ps1 deleted file mode 100644 index 39094c627ab..00000000000 --- a/build/Find-WindowsSDKVersions.ps1 +++ /dev/null @@ -1,168 +0,0 @@ -$script:ns = 'http://schemas.microsoft.com/developer/msbuild/2003' - -$ErrorActionPreference = 'Stop' - -# Unique set of Windows SDK versions referenced in files -$versions = New-Object System.Collections.Generic.HashSet[System.String] - -function Get-Nodes { - param( - [parameter(ValueFromPipeline = $true)] - [xml] $xml, - [parameter(Mandatory = $true)] - [string] $nodeName) - - # Try the old style csproj. Also format required for .targets and .props files - $n = Select-Xml -Xml $xml.Project -Namespace @{d = $ns } -XPath "//d:$nodeName" - - # Try the SDK-style files - if (!$n) { - $r = Select-Xml -Xml $xml.Project -XPath "//$nodeName" - } - - return $r -} - -function Get-NodeValue { - param( - [parameter(ValueFromPipeline = $true)] - [xml] $xml, - [string] $nodeName) - - $node = get-nodes $xml $nodeName - - if ($node) { - if ($node.Node) { - return [string]$node.Node.'#text' - } - } - - return [string]"" -} - -function Get-SdkVersion { - param( - [Parameter(ValueFromPipeline = $true)] $file) - - [xml] $xml = Get-Content $file - - # If you want a complete set of SDKs that are required, uncomment the following - # $version = Get-NodeValue $xml 'PropertyGroup/TargetPlatformMinVersion' - # $versions.Add($version) | Out-Null - - $version = Get-NodeValue $xml 'PropertyGroup/TargetPlatformVersion' - $versions.Add($version) | Out-Null - - # Versions may also be specified without the 10.0.xxxxx.0 format in the - # PropertyGroup/TargetPlatformRevision and PropertyGroup/TargetPlatformMinRevision - - # If you want a complete set of SDKs that are required, uncomment the following - # $version = Get-NodeValue $xml 'PropertyGroup/TargetPlatformMinRevision' - # $versions.Add("10.0." + $version + ".0") | Out-Null - - $version = Get-NodeValue $xml 'PropertyGroup/TargetPlatformRevision' - $versions.Add("10.0." + $version + ".0") | Out-Null -} - -function Test-RegistryPathAndValue { - param ( - [parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $path, - [parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $value) - - try { - if (Test-Path $path) { - Get-ItemProperty -Path $path | Select-Object -ExpandProperty $value -ErrorAction Stop | Out-Null - return $true - } - } - catch { - } - - try { - $path = $path -replace "HKLM:\\SOFTWARE\\", "HKLM:\\SOFTWARE\\WOW6432Node\\" - if (Test-Path $path) { - Get-ItemProperty -Path $path | Select-Object -ExpandProperty $value -ErrorAction Stop | Out-Null - return $true - } - } - catch { - } - - return $false -} - -function Test-InstallWindowsSdk([string] $WindowsSDKVersion) { - $retval = $true - - $WindowsSDKRegPath = "HKLM:\Software\Microsoft\Windows Kits\Installed Roots" - $WindowsSDKRegRootKey = "KitsRoot10" - $WindowsSDKOptions = @("OptionId.UWPCpp") - - $WindowsSDKInstalledRegPath = "$WindowsSDKRegPath\$WindowsSDKVersion\Installed Options" - - if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey) { - # A Windows SDK is installed - # Is an SDK of our version installed with the options we need? - if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions") { - # It appears we have what we need. Double check the disk - $sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey - if (!$sdkRoot) { - $WindowsSDKRegPath = $WindowsSDKRegPath -replace "HKLM:\\SOFTWARE\\", "HKLM:\\SOFTWARE\\WOW6432Node\\" - $sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey - } - - if ($sdkRoot) { - if (Test-Path $sdkRoot) { - $refPath = Join-Path $sdkRoot "References\$WindowsSDKVersion" - if (Test-Path $refPath) { - $umdPath = Join-Path $sdkRoot "UnionMetadata\$WindowsSDKVersion" - if (Test-Path $umdPath) { - # Pretty sure we have what we need - $retval = $false - } - } - } - } - } - } - - return $retval -} - -if (!$PSScriptRoot) { - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -Write-Host -NoNewline "Locating referenced Windows SDK versions..." - -Get-ChildItem *.csproj -Recurse | ForEach-Object { get-sdkversion $_ } -Get-ChildItem *.targets -Recurse | ForEach-Object { get-sdkversion $_ } -Get-ChildItem *.props -Recurse | ForEach-Object { get-sdkversion $_ } - -Write-Host "Done" -Write-Host - -$anyInstallRequired = $false; - -foreach ($version in $versions) { - if ($version -match "10\.0\.\d{5}\.0") { - $installRequired = Test-InstallWindowsSDK $version - Write-Host "Windows SDK '$version' install required: $installRequired" - if ($installRequired) { - # Automatically invoke Install-WindowsSDKIso.ps1 ? - $anyInstallRequired = $true - } - } -} - -Write-Host -if ($anyInstallRequired) { - throw "At least one Windows SDK is missing from this machine" -} -else { - Write-Host "All referenced Windows SDKs are installed!" -} \ No newline at end of file diff --git a/build/Icon.png b/build/Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cb8172be02b0079dab44a49568a7ca4963d8fa75 GIT binary patch literal 767 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1SD0tpLGH$#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!pk#?_L`iUdT1k0gQ7S`0VrE{6US4X6f{C7i zo}rO5OZFQE2Bv&Z7srqc=eIM?o=yyuIsUx=qtwC;3eq#{A0#Czb9bK%5{on26fk9~ z2Dh|n>f=;zmq~Mbg~~i4gO)tWeP({%a`E$*HrtQish(~8%yRzJ>UZDg{QmnSCiZ*x zo0Ex5Tab~U>Vk_INgE?phWyg&h|zmqwtK3VYMh_IA{L>}BS{-~#I3hyDYTH8byn?o zVTGk*hmb_CThndj1BybO51z6pdL`_PStPeG;KgnEpp_vP?o`<(ruQ+vfQzfiZSpVj4FN>W2LLumrjlmsSy1IC92jpF~(8{PE|w1>Q|XKKtb`~6i{ zs+TSG1h<6@pUk6!Sz8yWXfiA>cwzqft5m8B=Y$YoUtfg}m(- zIXHzYy05t+wa$#9%Ps5aa(-* zZJV>roA1A~wgNqTaXQ~fI}5jr0(eCuBjw6Z{#DXuZSk@G?u gDtdO3HD%NMO`b3Ny|*+b0MjRfr>mdKI;Vst0LHLIssI20 literal 0 HcmV?d00001 diff --git a/build/Install-WindowsSDK.ps1 b/build/Install-WindowsSDK.ps1 deleted file mode 100644 index afeb2db263a..00000000000 --- a/build/Install-WindowsSDK.ps1 +++ /dev/null @@ -1,10 +0,0 @@ - -$WinSdkTempDir = "C:\WinSdkTemp\" -$WinSdkSetupExe = "C:\WinSdkTemp\" + "WinSdkSetup.exe" - -mkdir $WinSdkTempDir - -$client = [System.Net.WebClient]::new() -$client.DownloadFile("https://go.microsoft.com/fwlink/p/?linkid=870807", $WinSdkSetupExe) - -Start-Process -Wait $WinSdkSetupExe "/features OptionId.UWPCpp /q" \ No newline at end of file diff --git a/build/Install-WindowsSdkISO.ps1 b/build/Install-WindowsSdkISO.ps1 deleted file mode 100644 index b83a3de9b2f..00000000000 --- a/build/Install-WindowsSdkISO.ps1 +++ /dev/null @@ -1,256 +0,0 @@ -[CmdletBinding()] -param([Parameter(Mandatory = $true)] - [string]$buildNumber) - -# Ensure the error action preference is set to the default for PowerShell3, 'Stop' -$ErrorActionPreference = 'Stop' - -# Constants -$WindowsSDKOptions = @("OptionId.UWPCpp") -$WindowsSDKRegPath = "HKLM:\Software\Microsoft\Windows Kits\Installed Roots" -$WindowsSDKRegRootKey = "KitsRoot10" -$WindowsSDKVersion = "10.0.$buildNumber.0" -$WindowsSDKInstalledRegPath = "$WindowsSDKRegPath\$WindowsSDKVersion\Installed Options" -$StrongNameRegPath = "HKLM:\SOFTWARE\Microsoft\StrongName\Verification" -$PublicKeyTokens = @("31bf3856ad364e35") - -function Download-File { - param ([string] $outDir, - [string] $downloadUrl, - [string] $downloadName) - - $downloadPath = Join-Path $outDir "$downloadName.download" - $downloadDest = Join-Path $outDir $downloadName - $downloadDestTemp = Join-Path $outDir "$downloadName.tmp" - - Write-Host -NoNewline "Downloading $downloadName..." - - try { - $webclient = new-object System.Net.WebClient - $webclient.DownloadFile($downloadUrl, $downloadPath) - } - catch [System.Net.WebException] { - Write-Host - Write-Warning "Failed to fetch updated file from $downloadUrl" - if (!(Test-Path $downloadDest)) { - throw "$downloadName was not found at $downloadDest" - } - else { - Write-Warning "$downloadName may be out of date" - } - } - - Unblock-File $downloadPath - - $downloadDestTemp = $downloadPath; - - # Delete and rename to final dest - if (Test-Path -PathType Container $downloadDest) { - [System.IO.Directory]::Delete($downloadDest, $true) - } - - Move-Item -Force $downloadDestTemp $downloadDest - Write-Host "Done" - - return $downloadDest -} - -function Get-ISODriveLetter { - param ([string] $isoPath) - - $diskImage = Get-DiskImage -ImagePath $isoPath - if ($diskImage) { - $volume = Get-Volume -DiskImage $diskImage - - if ($volume) { - $driveLetter = $volume.DriveLetter - if ($driveLetter) { - $driveLetter += ":" - return $driveLetter - } - } - } - - return $null -} - -function Mount-ISO { - param ([string] $isoPath) - - # Check if image is already mounted - $isoDrive = Get-ISODriveLetter $isoPath - - if (!$isoDrive) { - Mount-DiskImage -ImagePath $isoPath -StorageType ISO | Out-Null - } - - $isoDrive = Get-ISODriveLetter $isoPath - Write-Verbose "$isoPath mounted to ${isoDrive}:" -} - -function Dismount-ISO { - param ([string] $isoPath) - - $isoDrive = (Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter - - if ($isoDrive) { - Write-Verbose "$isoPath dismounted" - Dismount-DiskImage -ImagePath $isoPath | Out-Null - } -} - -function Disable-StrongName { - param ([string] $publicKeyToken = "*") - - reg ADD "HKLM\SOFTWARE\Microsoft\StrongName\Verification\*,$publicKeyToken" /f | Out-Null - if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { - reg ADD "HKLM\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,$publicKeyToken" /f | Out-Null - } -} - -function Test-Admin { - $identity = [Security.Principal.WindowsIdentity]::GetCurrent() - $principal = New-Object Security.Principal.WindowsPrincipal $identity - $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -} - -function Test-RegistryPathAndValue { - param ( - [parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $path, - [parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $value) - - try { - if (Test-Path $path) { - Get-ItemProperty -Path $path | Select-Object -ExpandProperty $value -ErrorAction Stop | Out-Null - return $true - } - } - catch { - } - - return $false -} - -function Test-InstallWindowsSDK { - $retval = $true - - if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey) { - # A Windows SDK is installed - # Is an SDK of our version installed with the options we need? - if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions") { - # It appears we have what we need. Double check the disk - $sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey - if ($sdkRoot) { - if (Test-Path $sdkRoot) { - $refPath = Join-Path $sdkRoot "References\$WindowsSDKVersion" - if (Test-Path $refPath) { - $umdPath = Join-Path $sdkRoot "UnionMetadata\$WindowsSDKVersion" - if (Test-Path $umdPath) { - # Pretty sure we have what we need - $retval = $false - } - } - } - } - } - } - - return $retval -} - -function Test-InstallStrongNameHijack { - foreach ($publicKeyToken in $PublicKeyTokens) { - $key = "$StrongNameRegPath\*,$publicKeyToken" - if (!(Test-Path $key)) { - return $true - } - } - - return $false -} - -Write-Host -NoNewline "Checking for installed Windows SDK $WindowsSDKVersion..." -$InstallWindowsSDK = Test-InstallWindowsSDK -if ($InstallWindowsSDK) { - Write-Host "Installation required" -} -else { - Write-Host "INSTALLED" -} - -$StrongNameHijack = Test-InstallStrongNameHijack -Write-Host -NoNewline "Checking if StrongName bypass required..." - -if ($StrongNameHijack) { - Write-Host "REQUIRED" -} -else { - Write-Host "Done" -} - -if ($StrongNameHijack -or $InstallWindowsSDK) { - if (!(Test-Admin)) { - Write-Host - throw "ERROR: Elevation required" - } -} - -if ($InstallWindowsSDK) { - # Static(ish) link for Windows SDK - # Note: there is a delay from Windows SDK announcements to availability via the static link - $uri = "https://software-download.microsoft.com/download/sg/Windows_InsiderPreview_SDK_en-us_$($buildNumber)_1.iso"; - - if ($null -eq $env:TEMP) { - $env:TEMP = Join-Path $env:SystemDrive 'temp' - } - - $winsdkTempDir = Join-Path $env:TEMP "WindowsSDK" - - if (![System.IO.Directory]::Exists($winsdkTempDir)) { - [void][System.IO.Directory]::CreateDirectory($winsdkTempDir) - } - - $file = "winsdk_$buildNumber.iso" - - Write-Verbose "Getting WinSDK from $uri" - $downloadFile = Download-File $winsdkTempDir $uri $file - - # TODO Check if zip, exe, iso, etc. - try { - Write-Host -NoNewline "Mounting ISO $file..." - Mount-ISO $downloadFile - Write-Host "Done" - - $isoDrive = Get-ISODriveLetter $downloadFile - - if (Test-Path $isoDrive) { - Write-Host -NoNewLine "Installing WinSDK..." - - $setupPath = Join-Path "$isoDrive" "WinSDKSetup.exe" - Start-Process -Wait $setupPath "/features $WindowsSDKOptions /q" - Write-Host "Done" - } - else { - throw "Could not find mounted ISO at ${isoDrive}" - } - } - finally { - Write-Host -NoNewline "Dismounting ISO $file..." - # Dismount-ISO $downloadFile - Write-Host "Done" - } -} - -if ($StrongNameHijack) { - Write-Host -NoNewline "Disabling StrongName for Windows SDK..." - - foreach ($key in $PublicKeyTokens) { - Disable-StrongName $key - } - - Write-Host "Done" -} \ No newline at end of file diff --git a/build/Run-UITests.ps1 b/build/Run-UITests.ps1 new file mode 100644 index 00000000000..2af1193b5ff --- /dev/null +++ b/build/Run-UITests.ps1 @@ -0,0 +1,18 @@ +# Script to Run UWP UI Tests using TAEF (Test Authoring and Execution Framework). + +# Variables +$RepoDir = Split-Path -Path $PSScriptRoot -Parent +$taefPkg = "${RepoDir}tools\TAEF.Redist.Wlk\" + +$configuration = "Release" +$targetFramework = "netcoreapp3.1" +$targetMachine = "x64" +$targetRuntime = "win10-${targetMachine}" + +$taefDir = "${taefPkg}build\Binaries\${targetMachine}\CoreClr\" +$taefExe = "${taefDir}TE.exe" + +$taefUITests = "**\bin\**\UITests*TAEF\**\UITests*TAEF.dll" +$taefLogFile = "VSTestResults.UWP.UI.wtl" + +. $taefExe $taefUITests /screenCaptureOnError /enableWttLogging /logFile:$taefLogFile \ No newline at end of file diff --git a/build/Style-Xaml.ps1 b/build/Style-Xaml.ps1 new file mode 100644 index 00000000000..99cb2331d30 --- /dev/null +++ b/build/Style-Xaml.ps1 @@ -0,0 +1,4 @@ +# Script to Style XAML files in the sources within this repository. + +# This script duplicates the fuctionality provided by the 'StyleXaml' target in Cake script present previously. +# Since, Cake build has been removed, this fuctionality has been implemented here in this PowerShell script. diff --git a/build/StyleXaml.bat b/build/StyleXaml.bat deleted file mode 100644 index 3ebd1ccde66..00000000000 --- a/build/StyleXaml.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF -PowerShell.exe -file "%~dp0build.ps1" -Target StyleXaml -PAUSE \ No newline at end of file diff --git a/build/Update-Headers.ps1 b/build/Update-Headers.ps1 new file mode 100644 index 00000000000..4ba31b357cf --- /dev/null +++ b/build/Update-Headers.ps1 @@ -0,0 +1,100 @@ +# Script to Update Header comment in C# sources within this repository. + +# This script duplicates the fuctionality provided by the 'UpdateHeaders' target in Cake script present previously. +# Since, Cake build has been removed, this fuctionality has been implemented here in this PowerShell script. + +[CmdletBinding()] +Param( + [Alias("Verify")] + [switch]$DryRun, + [switch]$Clean +) + +function Clear-BuildArtifacts { + if (Get-Command dotnet) { + Write-Host "Starting 'dotnet msbuild -t:Clean' to clean-up build outputs" + dotnet msbuild -noLogo -noAutoRsp -v:m -t:Clean + } + elseif (Get-Command msbuild) { + Write-Host "Starting 'msbuild -t:Clean' to clean-up build outputs" + msbuild -noLogo -noAutoRsp -v:m -t:Clean + } + elseif (Get-Command git) { + Write-Host "Starting 'git clean -Xdf' to clean-up build outputs" + git clean -Xdf + } + else { + Write-Warning "Can't find dotnet/msbuild/git to clean-up build outputs" + } +} + +function Get-SourceFiles ([string]$Path, [string]$Extension) { + $fileType = $Extension.TrimStart('.') + $fileFilter = "*.$fileType" + $fileExcludes = "*.g.$fileType", "*.i.$fileType", "*TemporaryGeneratedFile*.$fileType" + $sourceFiles = Get-ChildItem -Path $Path -File -Recurse -Filter $fileFilter -Exclude $fileExcludes + + $folderExcludes = "build", "~build", "~publish", "~packages", "bin", "obj" + + return $sourceFiles.Where({ + foreach ($folder in $folderExcludes) { + $folderPattern = "{0}$folder{0}" -f [IO.Path]::DirectorySeparatorChar + if ($_.FullName.Contains($folderPattern)) { + return $false + } + } + return $true + }) +} + +# Set Repot Root +$repoRoot = Split-Path -Path $PSScriptRoot -Parent +Push-Location $repoRoot + +# Clean-up Repository build outputs +if ($Clean) { + Clear-BuildArtifacts +} + +# Get C# source files recursively +$sourceFiles = Get-SourceFiles -Path $repoRoot -Extension ".cs" + +Write-Host "Checking $($sourceFiles.Count) C# file header(s)" + +$hasMissing = $false +foreach ($sourceFile in $sourceFiles) { + + $oldContent = Get-Content $sourceFile -Raw | Out-String -NoNewline + + if ($oldContent.Contains("// ") -or $oldContent.Contains("// ")) { + continue + } + + $headerFilePath = Join-Path $PSScriptRoot "header.txt" + $headerContent = Get-Content $headerFilePath -Raw | Out-String + $regexHeader = "^(//.*\r?\n)*\r?\n" + $newContent = $oldContent -replace $regexHeader,$headerContent | Out-String -NoNewline + + if (-not ($newContent -eq $oldContent)) { + $sourceFilePath = [System.IO.Path]::GetRelativePath($repoRoot, $sourceFile.FullName) + + if ($DryRun) { + Write-Warning "Wrong/missing file header in '$sourceFilePath'" + $hasMissing = $true + } + else { + Write-Host "Updating '$sourceFilePath' file header..." + Set-Content -Path $sourceFile -Value $newContent -NoNewline + } + } +} + +if ($DryRun -and $hasMissing) { + Write-Error "Please run 'Update-Headers.ps1' to verify and add missing headers ins source files before commiting your changes." +} +else { + Write-Host "All $($sourceFiles.Count) C# file header(s) are up to date." +} + +# Pop out of Repo Root +Pop-Location diff --git a/build/UpdateHeaders.bat b/build/UpdateHeaders.bat deleted file mode 100644 index 55872778b6e..00000000000 --- a/build/UpdateHeaders.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF -PowerShell.exe -file "%~dp0build.ps1" -Target UpdateHeaders -PAUSE \ No newline at end of file diff --git a/build/Windows.Toolkit.Common.props b/build/Windows.Toolkit.Common.props index fcd25fac3e6..e62331d493c 100644 --- a/build/Windows.Toolkit.Common.props +++ b/build/Windows.Toolkit.Common.props @@ -40,15 +40,17 @@ + NU1507 true true $(TF_BUILD) + $(MSBuildProjectName.Replace('Microsoft.Toolkit.', '')) - ~build\ - ~publish\ + $(RepositoryDirectory)~build\$(ProjectName)\ + $(RepositoryDirectory)~publish\$(ProjectName)\ $(BuildDir)bin\ $(BuildDir)obj\ diff --git a/build/Windows.Toolkit.Common.targets b/build/Windows.Toolkit.Common.targets index eb74df84231..801eb10ade3 100644 --- a/build/Windows.Toolkit.Common.targets +++ b/build/Windows.Toolkit.Common.targets @@ -18,9 +18,9 @@ - - - + + + diff --git a/build/Windows.Toolkit.GetBuildOutputs.targets b/build/Windows.Toolkit.GetBuildOutputs.targets new file mode 100644 index 00000000000..494ccac93b2 --- /dev/null +++ b/build/Windows.Toolkit.GetBuildOutputs.targets @@ -0,0 +1,51 @@ + + + + + <_GetBuildOutputsDependsOn>BuiltProjectOutputGroup;DocumentationProjectOutputGroup + <_GetBuildOutputsDependsOn Condition="'$(IncludeSymbols)' != 'false'">$(_GetBuildOutputsDependsOn);DebugSymbolsProjectOutputGroup + <_GetBuildOutputsDependsOn Condition="'$(IncludeSatelliteAssemblies)' != 'false'">$(_GetBuildOutputsDependsOn);SatelliteDllsProjectOutputGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Windows.Toolkit.UWP.Controls.props b/build/Windows.Toolkit.UWP.Controls.props new file mode 100644 index 00000000000..65c2cbf002a --- /dev/null +++ b/build/Windows.Toolkit.UWP.Controls.props @@ -0,0 +1,15 @@ + + + + $(MSBuildProjectName).Design + + + + + + + + + + + \ No newline at end of file diff --git a/build/Windows.Toolkit.UWP.Controls.targets b/build/Windows.Toolkit.UWP.Controls.targets index f1bb8e164eb..9186f1ab832 100644 --- a/build/Windows.Toolkit.UWP.Controls.targets +++ b/build/Windows.Toolkit.UWP.Controls.targets @@ -1,31 +1,43 @@ - - - - - - - - - $(TargetsForTfmSpecificBuildOutput);_IncludeDesignToolsInPackage + _IncludeDesignToolsInPackage + Design $(IncludeBuildOutput) + + + + + + - - - $(OutputPath)Design - $(DesignToolsOutputPath)\ - + + + + + - - + + + $(TargetFramework) + + $(DesignToolsPackageFolder) + $([System.IO.Path]::Combine('%(TfmSpecificBuildOutput.PackagePath)', '%(DesignToolsBuildOutput.TargetFramework)')) + + - - + + diff --git a/build/Windows.Toolkit.VisualStudio.Design.props b/build/Windows.Toolkit.VisualStudio.Design.props index 0c943341a97..d88d2c85243 100644 --- a/build/Windows.Toolkit.VisualStudio.Design.props +++ b/build/Windows.Toolkit.VisualStudio.Design.props @@ -9,7 +9,6 @@ False False - uap$(TargetPlatformBaseVersion).$(TargetPlatformMinRevision) $(MSBuildProjectName.Remove($(MSBuildProjectName.LastIndexOf('.')))) @@ -17,7 +16,6 @@ - \ No newline at end of file diff --git a/build/Windows.Toolkit.VisualStudio.Design.targets b/build/Windows.Toolkit.VisualStudio.Design.targets index 795ad41cd3a..4970322038f 100644 --- a/build/Windows.Toolkit.VisualStudio.Design.targets +++ b/build/Windows.Toolkit.VisualStudio.Design.targets @@ -1,11 +1,5 @@ - - $(RootNamespace.Remove($(RootNamespace.LastIndexOf('.')))) - ..\$(ParentProjectName)\~build\bin\$(Configuration)\$(ParentTargetFramework)\ - $(ParentProjectOutputPath)Design\ - - True @@ -25,17 +19,11 @@ - - - False - False - True - - - + + \ No newline at end of file diff --git a/build/build.cake b/build/build.cake index e1218365c72..e72977543db 100644 --- a/build/build.cake +++ b/build/build.cake @@ -22,6 +22,8 @@ var configuration = Argument("configuration", "Release"); // VERSIONS ////////////////////////////////////////////////////////////////////// +string Version = null; + var inheritDocVersion = "2.5.2"; ////////////////////////////////////////////////////////////////////// @@ -30,19 +32,17 @@ var inheritDocVersion = "2.5.2"; var baseDir = MakeAbsolute(Directory("../")).ToString(); var buildDir = baseDir + "/build"; -var Solution = baseDir + "/Windows Community Toolkit.sln"; +var Solution = baseDir + "/WindowsCommunityToolkit.sln"; var toolsDir = buildDir + "/tools"; var packagesDir = baseDir + "/~packages"; var pkgBinDir = packagesDir + "/bin"; -var taefBinDir = baseDir + $"/UITests/UITests.Tests.TAEF/~build/bin/{configuration}/netcoreapp3.1/win10-x86"; +var taefBinDir = baseDir + $"/~build/UITests.Tests.TAEF/bin/{configuration}/netcoreapp3.1/win10-x64"; var styler = toolsDir + "/XamlStyler.Console/tools/xstyler.exe"; var stylerFile = baseDir + "/settings.xamlstyler"; -string Version = null; - var inheritDoc = toolsDir + "/InheritDoc/tools/InheritDoc.exe"; // Ignoring NerdBank until this is merged and we can use a new version of inheridoc: @@ -53,52 +53,6 @@ var inheritDocExclude = "Nerdbank.GitVersioning.ManagedGit.GitRepository"; // METHODS ////////////////////////////////////////////////////////////////////// -void VerifyHeaders(bool Replace) -{ - var header = FileReadText("header.txt") + "\r\n"; - bool hasMissing = false; - - Func exclude_objDir = - fileSystemInfo => !fileSystemInfo.Path.Segments.Contains("obj"); - - var files = GetFiles(baseDir + "/**/*.cs", new GlobberSettings { Predicate = exclude_objDir }).Where(file => - { - var path = file.ToString(); - return !(path.EndsWith(".g.cs") || path.EndsWith(".i.cs") || System.IO.Path.GetFileName(path).Contains("TemporaryGeneratedFile")); - }); - - Information("\nChecking " + files.Count() + " file header(s)"); - foreach(var file in files) - { - var oldContent = FileReadText(file); - if(oldContent.Contains("// ")) - { - continue; - } - var rgx = new Regex("^(//.*\r?\n)*\r?\n"); - var newContent = header + rgx.Replace(oldContent, ""); - - if(!newContent.Equals(oldContent, StringComparison.Ordinal)) - { - if(Replace) - { - Information("\nUpdating " + file + " header..."); - FileWriteText(file, newContent); - } - else - { - Error("\nWrong/missing header on " + file); - hasMissing = true; - } - } - } - - if(!Replace && hasMissing) - { - throw new Exception("Please run UpdateHeaders.bat or '.\\build.ps1 -Target UpdateHeaders' and commit the changes."); - } -} - void RetrieveVersion() { Information("\nRetrieving version..."); @@ -106,8 +60,21 @@ void RetrieveVersion() Information("\nBuild Version: " + Version); } +public string GetMSTestAdapterPath() +{ + var nugetPaths = GetDirectories("./tools/MSTest.TestAdapter*/build/_common"); + if(nugetPaths.Count == 0) + { + throw new Exception( + "Cannot locate the MSTest test adapter. " + + "You might need to add '#tool nuget:?package=MSTest.TestAdapter&version=' " + + "to the top of your build.cake file."); + } + return nugetPaths.Last().ToString(); +} + ////////////////////////////////////////////////////////////////////// -// DEFAULT TASK +// TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Clean") @@ -125,16 +92,6 @@ Task("Clean") } }); -Task("Verify") - .Description("Run pre-build verifications") - .IsDependentOn("Clean") - .Does(() => -{ - VerifyHeaders(false); - - StartPowershellFile("./Find-WindowsSDKVersions.ps1"); -}); - Task("Version") .Description("Updates the version information in all Projects") .Does(() => @@ -142,40 +99,9 @@ Task("Version") RetrieveVersion(); }); -Task("BuildProjects") - .Description("Build all projects") - .IsDependentOn("Version") - .Does(() => -{ - Information("\nBuilding Solution"); - var buildSettings = new MSBuildSettings - { - MaxCpuCount = 0, - PlatformTarget = PlatformTarget.MSIL - } - .SetConfiguration(configuration) - .WithTarget("Restore"); - - MSBuild(Solution, buildSettings); - - EnsureDirectoryExists(pkgBinDir); - - // Build once with normal dependency ordering - buildSettings = new MSBuildSettings - { - MaxCpuCount = 0, - PlatformTarget = PlatformTarget.MSIL - } - .SetConfiguration(configuration) - .WithTarget("Build") - .WithProperty("GenerateLibraryLayout", "true"); - - MSBuild(Solution, buildSettings); -}); - Task("InheritDoc") .Description("Updates tags from base classes, interfaces, and similar methods") - .IsDependentOn("BuildProjects") + .IsDependentOn("Clean") .Does(() => { Information("\nDownloading InheritDoc..."); @@ -203,43 +129,6 @@ Task("InheritDoc") Information("\nFinished generating documentation with InheritDoc"); }); -Task("Build") - .Description("Build all projects runs InheritDoc") - .IsDependentOn("Verify") - .IsDependentOn("BuildProjects") - .IsDependentOn("InheritDoc"); - -Task("Package") - .Description("Pack the NuPkg") - .Does(() => -{ - // Invoke the pack target in the end - var buildSettings = new MSBuildSettings - { - MaxCpuCount = 0, - PlatformTarget = PlatformTarget.MSIL - } - .SetConfiguration(configuration) - .WithTarget("Pack") - .WithProperty("GenerateLibraryLayout", "true") - .WithProperty("PackageOutputPath", pkgBinDir); - - MSBuild(Solution, buildSettings); -}); - -public string getMSTestAdapterPath(){ - var nugetPaths = GetDirectories("./tools/MSTest.TestAdapter*/build/_common"); - - if(nugetPaths.Count == 0){ - throw new Exception( - "Cannot locate the MSTest test adapter. " + - "You might need to add '#tool nuget:?package=MSTest.TestAdapter&version=' " + - "to the top of your build.cake file."); - } - - return nugetPaths.Last().ToString(); -} - Task("Test") .Description("Runs all Unit Tests") .Does(() => @@ -253,7 +142,7 @@ Task("Test") var testSettings = new VSTestSettings { ToolPath = vswhere + "/Common7/IDE/CommonExtensions/Microsoft/TestWindow/vstest.console.exe", - TestAdapterPath = getMSTestAdapterPath(), + TestAdapterPath = GetMSTestAdapterPath(), ArgumentCustomization = arg => arg.Append("/logger:trx;LogFileName=VsTestResultsUwp.trx /framework:FrameworkUap10"), }; @@ -318,23 +207,6 @@ Task("MSTestUITest") DotNetCoreTest(file.FullPath, testSettings); }); -////////////////////////////////////////////////////////////////////// -// TASK TARGETS -////////////////////////////////////////////////////////////////////// - -Task("Default") - .IsDependentOn("Build") - .IsDependentOn("Test") - .IsDependentOn("UITest") - .IsDependentOn("Package"); - -Task("UpdateHeaders") - .Description("Updates the headers in *.cs files") - .Does(() => -{ - VerifyHeaders(true); -}); - Task("StyleXaml") .Description("Ensures XAML Formatting is Clean") .Does(() => @@ -359,6 +231,15 @@ Task("StyleXaml") } }); +////////////////////////////////////////////////////////////////////// +// DEFAULT TASK +////////////////////////////////////////////////////////////////////// + +Task("Default") + .IsDependentOn("InheritDoc") + .IsDependentOn("Test") + .IsDependentOn("UITest"); + ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// diff --git a/build/build.ps1 b/build/build.ps1 deleted file mode 100644 index 63a20a1f980..00000000000 --- a/build/build.ps1 +++ /dev/null @@ -1,287 +0,0 @@ -########################################################################## -# This is the Cake bootstrapper script for PowerShell. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -<# - -.SYNOPSIS -This is a Powershell script to bootstrap a Cake build. - -.DESCRIPTION -This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) -and execute your Cake build script with the parameters you provide. - -.PARAMETER Script -The build script to execute. -.PARAMETER Target -The build script target to run. -.PARAMETER Configuration -The build configuration to use. -.PARAMETER Verbosity -Specifies the amount of information to be displayed. -.PARAMETER ShowDescription -Shows description about tasks. -.PARAMETER DryRun -Performs a dry run. -.PARAMETER SkipToolPackageRestore -Skips restoring of packages. -.PARAMETER ScriptArgs -Remaining arguments are added here. - -.LINK -https://cakebuild.net - -#> - -[CmdletBinding()] -Param( - [string]$Script, - [string]$Target, - [string]$Configuration, - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity, - [switch]$ShowDescription, - [Alias("WhatIf", "Noop")] - [switch]$DryRun, - [switch]$SkipToolPackageRestore, - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs -) - -# This is an automatic variable in PowerShell Core, but not in Windows PowerShell 5.x -if (-not (Test-Path variable:global:IsCoreCLR)) { - $IsCoreCLR = $false -} - -# Attempt to set highest encryption available for SecurityProtocol. -# PowerShell will not set this by default (until maybe .NET 4.6.x). This -# will typically produce a message for PowerShell v2 (just an info -# message though) -try { - # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) - # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't - # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is - # installed (.NET 4.5 is an in-place upgrade). - # PowerShell Core already has support for TLS 1.2 so we can skip this if running in that. - if (-not $IsCoreCLR) { - [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 - } - } catch { - Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' - } - -[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null -function MD5HashFile([string] $filePath) -{ - if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) - { - return $null - } - - [System.IO.Stream] $file = $null; - [System.Security.Cryptography.MD5] $md5 = $null; - try - { - $md5 = [System.Security.Cryptography.MD5]::Create() - $file = [System.IO.File]::OpenRead($filePath) - return [System.BitConverter]::ToString($md5.ComputeHash($file)) - } - finally - { - if ($null -ne $file) - { - $file.Dispose() - } - - if ($null -ne $md5) - { - $md5.Dispose() - } - } -} - -function GetProxyEnabledWebClient -{ - $wc = New-Object System.Net.WebClient - $proxy = [System.Net.WebRequest]::GetSystemWebProxy() - $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials - $wc.Proxy = $proxy - return $wc -} - -Write-Host "Preparing to run build script..." - -if(!$PSScriptRoot){ - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -if(!$Script){ - $Script = Join-Path $PSScriptRoot "build.cake" -} -$TOOLS_DIR = Join-Path $PSScriptRoot "tools" -$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" -$MODULES_DIR = Join-Path $TOOLS_DIR "Modules" -$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" -$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" -$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" -$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" -$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config" -$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config" - -$env:CAKE_PATHS_TOOLS = $TOOLS_DIR -$env:CAKE_PATHS_ADDINS = $ADDINS_DIR -$env:CAKE_PATHS_MODULES = $MODULES_DIR - -# Make sure tools folder exists -if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { - Write-Verbose -Message "Creating tools directory..." - New-Item -Path $TOOLS_DIR -Type Directory | Out-Null -} - -# Make sure that packages.config exist. -if (!(Test-Path $PACKAGES_CONFIG)) { - Write-Verbose -Message "Downloading packages.config..." - try { - $wc = GetProxyEnabledWebClient - $wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) - } catch { - Throw "Could not download packages.config." - } -} - -# Try find NuGet.exe in path if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Trying to find nuget.exe in PATH..." - $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } - $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 - if ($null -ne $NUGET_EXE_IN_PATH -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { - Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." - $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName - } -} - -# Try download NuGet.exe if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Downloading NuGet.exe..." - try { - $wc = GetProxyEnabledWebClient - $wc.DownloadFile($NUGET_URL, $NUGET_EXE) - } catch { - Throw "Could not download NuGet.exe." - } -} - -# These are automatic variables in PowerShell Core, but not in Windows PowerShell 5.x -if (-not (Test-Path variable:global:IsMacOS)) { - $IsLinux = $false - $IsMacOS = $false -} - -# Save nuget.exe path to environment to be available to child processed -$env:NUGET_EXE = $NUGET_EXE -$env:NUGET_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { - "mono `"$NUGET_EXE`"" -} else { - "`"$NUGET_EXE`"" -} - -# Restore tools from NuGet? -if(-Not $SkipToolPackageRestore.IsPresent) { - Push-Location - Set-Location $TOOLS_DIR - - # Check for changes in packages.config and remove installed tools if true. - [string] $md5Hash = MD5HashFile $PACKAGES_CONFIG - if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or - ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { - Write-Verbose -Message "Missing or changed package.config hash..." - Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery | - Remove-Item -Recurse -Force - } - - Write-Verbose -Message "Restoring tools from NuGet..." - - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet tools." - } - else - { - $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" - } - Write-Verbose -Message ($NuGetOutput | Out-String) - - Pop-Location -} - -# Restore addins from NuGet -if (Test-Path $ADDINS_PACKAGES_CONFIG) { - Push-Location - Set-Location $ADDINS_DIR - - Write-Verbose -Message "Restoring addins from NuGet..." - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet addins." - } - - Write-Verbose -Message ($NuGetOutput | Out-String) - - Pop-Location -} - -# Restore modules from NuGet -if (Test-Path $MODULES_PACKAGES_CONFIG) { - Push-Location - Set-Location $MODULES_DIR - - Write-Verbose -Message "Restoring modules from NuGet..." - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet modules." - } - - Write-Verbose -Message ($NuGetOutput | Out-String) - - Pop-Location -} - -# Make sure that Cake has been installed. -if (!(Test-Path $CAKE_EXE)) { - Throw "Could not find Cake.exe at $CAKE_EXE" -} - -$CAKE_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { - "mono `"$CAKE_EXE`"" -} else { - "`"$CAKE_EXE`"" -} - - # Build an array (not a string) of Cake arguments to be joined later -$cakeArguments = @() -if ($Script) { $cakeArguments += "`"$Script`"" } -if ($Target) { $cakeArguments += "--target=`"$Target`"" } -if ($Configuration) { $cakeArguments += "--configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "--verbosity=$Verbosity" } -if ($ShowDescription) { $cakeArguments += "--showdescription" } -if ($DryRun) { $cakeArguments += "--dryrun" } -$cakeArguments += $ScriptArgs - -# Start Cake -Write-Host "Running build script..." -Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ")" -$cakeExitCode = $LASTEXITCODE - -# Clean up environment variables that were created earlier in this bootstrapper -$env:CAKE_PATHS_TOOLS = $null -$env:CAKE_PATHS_ADDINS = $null -$env:CAKE_PATHS_MODULES = $null - -# Return exit code -exit $cakeExitCode diff --git a/build/tools/packages.config b/build/tools/packages.config deleted file mode 100644 index 4dc0269f530..00000000000 --- a/build/tools/packages.config +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/nuget.config b/nuget.config index 62c7515ba9e..33b52f58574 100644 --- a/nuget.config +++ b/nuget.config @@ -1,11 +1,6 @@ - - - - - \ No newline at end of file