Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Migrate solution to VS2017 (#411)
Browse files Browse the repository at this point in the history
* Microsoft.Fx.Portability: Migrate to VS2017 project

* Fix duplicate import warnings because of dir.props and dir.targets

* Update solution to VS2017

* Add .vscode to .gitignore

* Microsoft.Fx.Portability.MetadataReader: Migrate to VS2017 .NET Core project

* Microsoft.Fx.Portability.Reports.Json: Migrate to VS2017 .NET Core project

* Microsoft.Fx.Portability.Offline: Migrate to VS2017 .NET Core project

* ApiPort: Migrate to VS2017 and combine .NET Core

* ApiPort: Remove manual app.config bindingRedirects and autogenerate them

* Remove ApiPort.Core from solution

* ApiPort.Vsix: Update project to VS2017

* ApiPort.VisualStudio: Update to VS2017

* Microsoft.Fx.Portability.CCI: Migrate to VS2017 .NET Standard project

* SearchFxApi: Migrate to VS2017

* Microsoft.Fx.Portability.Reports.Html: Update to VS2017

* Microsoft.Fx.Portability.Cci.Tests: Upgrade to VS2017

* Add target that removes EmbeddedResources from being compiled

* Microsoft.Fx.Portability.MetadataReader.Tests: Migrate to VS2017

* Microsoft.Fx.Portability.Offline.Tests: Migrate to VS2017

* Microsoft.Fx.Portability.MetadataReader.Tests: Remove manual bindingRedirects in app.config

* Microsoft.Fx.Portability.CCI.Tests: Remove manual bindingRedirects in App.config

* Initial migration of ApiPort.VisualStudio and ApiPort.Vsix

* Microsoft.Fx.Portability.Tests: Migrate to VS2017

* CCI.Tests and MetdataReader.Tests: Add autogeneration of
bindingRedirects

* ApiPort: Update Microsoft package versions

* Microsoft.Fx.Portability.Reports.Html: Update NuGet packages

* Microsoft.Fx.Portability.MetadataReader.Tests: Update NuGet packages

* Microsoft.Fx.Portability: Update NuGet packages

* Microsoft.Fx.Portability.Cci.Tests: Update NuGet packages

* ApiPortVS.Tests: Remove manual bindingRedirects

* Update System.Reflection.Metadata to 1.4.2

* Fix tests for VS2017

* Microsoft.Fx.Portability.MetadataReader.Tests: Uncomment test after updating S.R.Metadata

* ApiPort.VisualStudio: Fix build errors from upgrade

* ApiPortVS.Tests: Update NuGet packages

* ApiPort: Remove explicit inclusion of app.config

* ApiPort.Vsix: Revert project.json to packages.config due to NuGet/issue#4532

* ApiPort.VisualStudio: Revert project.json to packages.config due to NuGet/issue#4532

* ApiPort.Vsix: Add app.config

* ApiPortVS.Tests: Revert project.json to packages.config

* Disable <WarningsAsErrors> because of CS1701 runtime policy warnings.

* ApiPort: Update Autofac.

* Microsoft.Fx.Portability.Cci: Add compiler directive for NETSTANDARD1_6

* Update Get-BuildTools to NuGet v4.0.0

* ApiPort: Fix System.Diagnostics.DiagnosticSource not found runtime errors.

* Add Microsoft.TestHost to all projects so they run

* Replace References with NuGet packages so people without VSIX Support installed can build still

* Adding Set-VsDevEnv.ps1 cmdlet

* Build Scripts: Update to find installed Visual studio 2017

* ApiPort.VisualStudio: Fix Release build

* ApiPort.Vsix: Deploying extension during debug

* ApiPort.VisualStudio: Update project so it outputs a vsix that can be propagated to other projects.

* ApiPort.Vsix: Updated installation targets. Added import of VisualStudio SDK targets. Removed TreatWarningsAsErrors

* Microsoft.Fx.Portability.Offline: Consolidate Autofac versions

* Update compiler directives to FEATURE_[NAME]
  • Loading branch information
conniey committed Apr 20, 2017
1 parent b70b2c8 commit 4f5f664
Show file tree
Hide file tree
Showing 67 changed files with 1,028 additions and 1,540 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ src/Microsoft.Fx.Portability.Offline/data/
.tools/
.data
*.nuget.props
*.nuget.targets
*.nuget.targets
.vscode
91 changes: 23 additions & 68 deletions PortabilityTools.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26214.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C991F5FC-04B5-420C-98A0-80974AA946F7}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -20,41 +20,41 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7DC7AA2C-0
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{F8292A68-AF7C-4B26-B1B8-B232548EF118}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FEEF35CB-3AC4-40C5-9CB0-85E52E38D5C6}"
ProjectSection(SolutionItems) = preProject
build\Get-Nuget.ps1 = build\Get-Nuget.ps1
build\Microsoft.Fx.Portability.MetadataReader.nuspec = build\Microsoft.Fx.Portability.MetadataReader.nuspec
build\Microsoft.Fx.Portability.nuspec = build\Microsoft.Fx.Portability.nuspec
build\Microsoft.Fx.Portability.Offline.nuspec = build\Microsoft.Fx.Portability.Offline.nuspec
build\Microsoft.Fx.Portability.Reports.Html.nuspec = build\Microsoft.Fx.Portability.Reports.Html.nuspec
build\Microsoft.Fx.Portability.Reports.Json.nuspec = build\Microsoft.Fx.Portability.Reports.Json.nuspec
build\package.ps1 = build\package.ps1
build\postbuild.ps1 = build\postbuild.ps1
build\restore.ps1 = build\restore.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiPort", "ApiPort", "{0D1724F6-078E-4576-9680-6B9334D562DC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort", "src\ApiPort\ApiPort.csproj", "{5A2EAD0F-FF3E-4968-A865-7B29C4B10A72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.MetadataReader.Tests", "tests\Microsoft.Fx.Portability.MetadataReader.Tests\Microsoft.Fx.Portability.MetadataReader.Tests.csproj", "{B44085A7-0DCD-4CE2-BDD9-B2E5268DCCCC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.Reports.Html", "src\Microsoft.Fx.Portability.Reports.Html\Microsoft.Fx.Portability.Reports.Html.csproj", "{83F4A5FE-FAF8-4952-899E-EA0BB08F8E60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.Offline", "src\Microsoft.Fx.Portability.Offline\Microsoft.Fx.Portability.Offline.csproj", "{F3D148CA-D49D-4315-9CD6-AE7B0EEA9549}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Fx.Portability.Offline", "src\Microsoft.Fx.Portability.Offline\Microsoft.Fx.Portability.Offline.csproj", "{F3D148CA-D49D-4315-9CD6-AE7B0EEA9549}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability", "src\Microsoft.Fx.Portability\Microsoft.Fx.Portability.csproj", "{8D84EC23-9977-4CC8-B649-035FFAE9664C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Fx.Portability", "src\Microsoft.Fx.Portability\Microsoft.Fx.Portability.csproj", "{8D84EC23-9977-4CC8-B649-035FFAE9664C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.MetadataReader", "src\Microsoft.Fx.Portability.MetadataReader\Microsoft.Fx.Portability.MetadataReader.csproj", "{68C6476E-1F80-412A-A8A7-480F832922D8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Fx.Portability.MetadataReader", "src\Microsoft.Fx.Portability.MetadataReader\Microsoft.Fx.Portability.MetadataReader.csproj", "{68C6476E-1F80-412A-A8A7-480F832922D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.Tests", "tests\Microsoft.Fx.Portability.Tests\Microsoft.Fx.Portability.Tests.csproj", "{36E8F09A-D3CA-405B-B515-9206F85B432C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SearchFxApi", "samples\SearchFxApi\SearchFxApi.csproj", "{16815A46-F1CA-4D56-80C8-54C4DFB8C1BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.Reports.Json", "src\Microsoft.Fx.Portability.Reports.Json\Microsoft.Fx.Portability.Reports.Json.csproj", "{28D8D77D-E68D-4EBC-9150-F7C433D63BFA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FEEF35CB-3AC4-40C5-9CB0-85E52E38D5C6}"
ProjectSection(SolutionItems) = preProject
build\Get-Nuget.ps1 = build\Get-Nuget.ps1
build\Microsoft.Fx.Portability.MetadataReader.nuspec = build\Microsoft.Fx.Portability.MetadataReader.nuspec
build\Microsoft.Fx.Portability.nuspec = build\Microsoft.Fx.Portability.nuspec
build\Microsoft.Fx.Portability.Offline.nuspec = build\Microsoft.Fx.Portability.Offline.nuspec
build\Microsoft.Fx.Portability.Reports.Html.nuspec = build\Microsoft.Fx.Portability.Reports.Html.nuspec
build\Microsoft.Fx.Portability.Reports.Json.nuspec = build\Microsoft.Fx.Portability.Reports.Json.nuspec
build\package.ps1 = build\package.ps1
build\postbuild.ps1 = build\postbuild.ps1
build\restore.ps1 = build\restore.ps1
EndProjectSection
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Fx.Portability.Reports.Json", "src\Microsoft.Fx.Portability.Reports.Json\Microsoft.Fx.Portability.Reports.Json.csproj", "{28D8D77D-E68D-4EBC-9150-F7C433D63BFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.Offline.Tests", "tests\Microsoft.Fx.Portability.Offline.Tests\Microsoft.Fx.Portability.Offline.Tests.csproj", "{FD6B4124-975B-454E-ACC8-424CC9A8BB8B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiPort", "ApiPort", "{0D1724F6-078E-4576-9680-6B9334D562DC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.Vsix", "src\ApiPort.Vsix\ApiPort.Vsix.csproj", "{C4301817-D6F9-43A4-9E24-5446C0A2C15C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.VisualStudio", "src\ApiPort.VisualStudio\ApiPort.VisualStudio.csproj", "{D15030D8-CFC5-4F05-8987-784326856E90}"
Expand All @@ -65,8 +65,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPortVS.Tests", "tests\Ap
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Fx.Portability.Cci.Tests", "tests\Microsoft.Fx.Portability.Cci.Tests\Microsoft.Fx.Portability.Cci.Tests.csproj", "{6917BF09-E416-43F9-B184-4691AF473271}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.Core", "src\ApiPort\ApiPort.Core.csproj", "{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -743,53 +741,13 @@ Global
{6917BF09-E416-43F9-B184-4691AF473271}.Ubuntu_Release|x64.Build.0 = Release|Any CPU
{6917BF09-E416-43F9-B184-4691AF473271}.Ubuntu_Release|x86.ActiveCfg = Release|Any CPU
{6917BF09-E416-43F9-B184-4691AF473271}.Ubuntu_Release|x86.Build.0 = Release|Any CPU
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|Any CPU.ActiveCfg = Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|ARM.ActiveCfg = Debug|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|ARM.Build.0 = Debug|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|x64.ActiveCfg = Debug|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|x64.Build.0 = Debug|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|x86.ActiveCfg = Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Debug|x86.Build.0 = Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|Any CPU.ActiveCfg = Osx_Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|ARM.ActiveCfg = Osx_Debug|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|ARM.Build.0 = Osx_Debug|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|x64.ActiveCfg = Osx_Debug|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|x64.Build.0 = Osx_Debug|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|x86.ActiveCfg = Osx_Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Debug|x86.Build.0 = Osx_Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|Any CPU.ActiveCfg = Osx_Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|ARM.ActiveCfg = Osx_Release|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|ARM.Build.0 = Osx_Release|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|x64.ActiveCfg = Osx_Release|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|x64.Build.0 = Osx_Release|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|x86.ActiveCfg = Osx_Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Osx_Release|x86.Build.0 = Osx_Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|Any CPU.ActiveCfg = Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|ARM.ActiveCfg = Release|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|ARM.Build.0 = Release|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|x64.ActiveCfg = Release|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|x64.Build.0 = Release|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|x86.ActiveCfg = Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Release|x86.Build.0 = Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|Any CPU.ActiveCfg = Ubuntu_Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|ARM.ActiveCfg = Ubuntu_Debug|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|ARM.Build.0 = Ubuntu_Debug|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|x64.ActiveCfg = Ubuntu_Debug|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|x64.Build.0 = Ubuntu_Debug|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|x86.ActiveCfg = Ubuntu_Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Debug|x86.Build.0 = Ubuntu_Debug|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|Any CPU.ActiveCfg = Ubuntu_Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|ARM.ActiveCfg = Ubuntu_Release|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|ARM.Build.0 = Ubuntu_Release|arm
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|x64.ActiveCfg = Ubuntu_Release|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|x64.Build.0 = Ubuntu_Release|x64
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|x86.ActiveCfg = Ubuntu_Release|x86
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B}.Ubuntu_Release|x86.Build.0 = Ubuntu_Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FEEF35CB-3AC4-40C5-9CB0-85E52E38D5C6} = {C991F5FC-04B5-420C-98A0-80974AA946F7}
{0D1724F6-078E-4576-9680-6B9334D562DC} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE}
{5A2EAD0F-FF3E-4968-A865-7B29C4B10A72} = {0D1724F6-078E-4576-9680-6B9334D562DC}
{B44085A7-0DCD-4CE2-BDD9-B2E5268DCCCC} = {7DC7AA2C-0401-495B-B42C-32F44085EBE6}
{83F4A5FE-FAF8-4952-899E-EA0BB08F8E60} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE}
Expand All @@ -799,14 +757,11 @@ Global
{36E8F09A-D3CA-405B-B515-9206F85B432C} = {7DC7AA2C-0401-495B-B42C-32F44085EBE6}
{16815A46-F1CA-4D56-80C8-54C4DFB8C1BC} = {F8292A68-AF7C-4B26-B1B8-B232548EF118}
{28D8D77D-E68D-4EBC-9150-F7C433D63BFA} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE}
{FEEF35CB-3AC4-40C5-9CB0-85E52E38D5C6} = {C991F5FC-04B5-420C-98A0-80974AA946F7}
{FD6B4124-975B-454E-ACC8-424CC9A8BB8B} = {7DC7AA2C-0401-495B-B42C-32F44085EBE6}
{0D1724F6-078E-4576-9680-6B9334D562DC} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE}
{C4301817-D6F9-43A4-9E24-5446C0A2C15C} = {0D1724F6-078E-4576-9680-6B9334D562DC}
{D15030D8-CFC5-4F05-8987-784326856E90} = {0D1724F6-078E-4576-9680-6B9334D562DC}
{B0468D19-0F98-49A8-BA28-926331C72E26} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE}
{2D8DA586-E0EA-4AD1-BA3C-E4AC0310A45E} = {7DC7AA2C-0401-495B-B42C-32F44085EBE6}
{6917BF09-E416-43F9-B184-4691AF473271} = {7DC7AA2C-0401-495B-B42C-32F44085EBE6}
{560DD4EB-C4D2-4F94-9695-931CD3D17B5B} = {0D1724F6-078E-4576-9680-6B9334D562DC}
EndGlobalSection
EndGlobal
43 changes: 38 additions & 5 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,43 @@ param(
[switch]$RunTests,
[switch]$CreateNugetPackages,

[string]$VersionSuffix = "alpha"
[string]$VersionSuffix = "alpha",

[ValidateSet(2015, 2017)]
[int]$VisualStudioVersion = 2017
)

$ErrorActionPreference = "Stop"

$root = $PSScriptRoot

& $root\build\Set-VsDevEnv.ps1 -VisualstudioVersion $VisualStudioVersion

$MSBuildCommand = $(Get-Command "MSBuild.exe" -CommandType Application -ErrorAction Ignore)

if ($MSBuildCommand -eq $null) {
Write-Error "Could not set visual studio $VisualStudioVersion environment and locate msbuild!"
}

if ($VisualStudioVersion -eq 2017) {
$MSBuildVersion = 15
} elseif ($VisualStudioVersion -eq 2015) {
$MSBuildVersion = 14
} else {
Write-Error "This VisualStudio version [$VisualStudioVersion] is not recognized."
}


$MSBuildCommand = $MSBuildCommand | ? { $_.Version.Major -eq $MSBuildVersion } | Select -First 1

if ($MSBuildCommand -eq $null) {
Write-Error "Could not locate MSBuild $MSBuildVersion using Visual Studio $VisualStudioVersion developer command prompt"
}

$MSBuild = $MSBuildCommand.Path

Write-Host "MSBUILD: $MSBuild"

# Libraries are currently pre-release
$env:VersionSuffix = $VersionSuffix

Expand All @@ -29,19 +61,20 @@ if (!(Test-Path $binFolder)) {
New-Item $binFolder -ItemType Directory
}

.\build\restore.ps1

$MSBuild = Join-Path ${env:ProgramFiles(x86)} "MSBuild\14.0\bin\MSBuild.exe"

& $root\build\restore.ps1
# PortabilityTools.sln understands "Any CPU" not "AnyCPU"
$PlatformToUse = $Platform

if ($Platform -eq "AnyCPU") {
$PlatformToUse = "Any CPU"
}

pushd $root

& $MSBuild PortabilityTools.sln /p:Configuration=$Configuration /p:Platform="$PlatformToUse" /nologo /m /v:m /nr:false /flp:logfile=$binFolder\msbuild.log`;verbosity=$Verbosity

popd

if ($RunTests) {
.\build\runtests.ps1 $Configuration
}
Expand Down
9 changes: 5 additions & 4 deletions build/Get-BuildTools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ $destination = $null
switch($ToolToFetch)
{
"nuget" {
# TODO Once nuget v3.5.0 is officially released, we'll go back to using the
# `latest` URI. v3.4.0 does not understand restoring packages for .NETCoreApp,
# while results in a lot of errors.
# TODO Once nuget v4.0.0 is the latest, we'll go back to using the
# `latest` URI. v3.5.0 does not understand restoring packages for VS 2017
# projects.

# $uri = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

$uri = "https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe"
$uri = "https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe"
$destination = Join-Path $tools "nuget.exe"
}
"vsix" {
Expand Down
81 changes: 81 additions & 0 deletions build/Set-VsDevEnv.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[CmdletBinding(DefaultParameterSetName = "Default")] # Needed to support -Verbose
param(
[Parameter(ParameterSetName=Default, Mandatory=$true, Position=0)]
[ValidateSet(2015,2017)]
[int]$VisualstudioVersion,

[Parameter(ParameterSetName=PathGiven, Mandatory=$true)]
[ValidateScript({Test-Path $_ })]
[string]$VsDevCmdPath
)

$ErrorActionPreference = "Stop"

[bool]$findVsVersion = $true

if ($PSCmdlet.ParameterSetName -eq "PathGiven") {
$findVsVersion = $false
}

[string]$commonToolsPath = $null
[string]$VsDevCmdBat = "VsDevCmd.bat"

if ($findVsVersion) {
switch ($VisualstudioVersion) {
2015
{
$commonToolsPath = $env:VS140COMNTOOLS
}
2017
{
$microsoftVisualStudio = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017"

if (Test-Path $microsoftVisualStudio) {
$installations = Get-ChildItem $microsoftVisualStudio | ? { $_.PsIsContainer }

foreach ($installation in $installations) {
$path = Join-Path $installation.FullName "Common7\Tools\"

if (Test-Path $path) {
$commonToolsPath = $path
break
}
}
} else {
Write-Error "Could not locate: $microsoftVisualStudio. Pass path to $VsDevCmdBat using parameter -VsDevCmdPath."
}
}
}

if ([string]::IsNullOrEmpty($commonToolsPath)) {
Write-Error "Could not find Common Tools for Visual Studio $VisualstudioVersion"
}

$devEnv = Join-Path $commonToolsPath $VsDevCmdBat

if (!(Test-Path $devEnv)) {
Write-Error "Could not find VsDevCmd.bat for Visual Studio $VisualstudioVersion. Path: $devEnv"
}

} else {
$file = Get-Item $VsDevCmdPath
$commonToolsPath = $file.DirectoryName
$VsDevCmdBat = $file.Name
}

pushd $commonToolsPath

$output = cmd /c "$VsDevCmdBat & set"

popd

foreach ($line in $output)
{
if ($line -match "(?<key>.*?)=(?<value>.*)") {
$key = $matches["key"]
$value = $matches["value"]

Write-Verbose("$key=$value")
Set-Item "ENV:\$key" -Value "$value" -Force
}
}
24 changes: 14 additions & 10 deletions build/runtests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
Param(
[ValidateSet("Debug", "Release")]
[Parameter(Position=0, Mandatory=$True)]
[string]$Configuration
[string]$Configuration,

[ValidateSet(2015, 2017)]
[int]$VisualStudioVersion = 2017
)

$ErrorActionPreference = "Stop"
Expand All @@ -15,18 +18,19 @@ if (!(Test-Path $testFolder)) {
return -1
}

if ($env:VS140COMNTOOLS) {
$vstest = Resolve-Path ([IO.Path]::Combine($env:VS140COMNTOOLS, "..", "IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"))
} elseif ($env:VS120COMNTOOLS) {
$vstest = Resolve-Path ([IO.Path]::Combine($env:VS120COMNTOOLS, "..", "IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"))
} else {
Write-Error "Could not set vstest.console.exe because %VS140COMNTOOLS% or %VS120COMNTOOLS% are not set."
}
$VsTestConsoleCommand = $(Get-Command "vstest.console.exe" -CommandType Application -ErrorAction Ignore)

if (!(Test-Path $vstest)) {
Write-Error "$vstest does not exist"
# Possible that the VS Developer Command prompt is not yet set.
if ($VsTestConsoleCommand -eq $null) {
.\build\Set-VsDevEnv.ps1 -VisualstudioVersion $VisualStudioVersion
$VsTestConsoleCommand = $(Get-Command "vstest.console.exe" -CommandType Application -ErrorAction Ignore)

if ($VsTestConsoleCommand -eq $null) {
Write-Error "Could not set visual studio $VisualStudioVersion environment and locate vstest.console.exe!"
}
}

$vstest = $VsTestConsoleCommand.Path
$binaryFolders = Get-ChildItem $testFolder -Recurse | ? { $_.PsIsContainer -and $_.FullName.EndsWith($(Join-Path "bin" $Configuration)) }

$testDlls = New-Object System.Collections.ArrayList
Expand Down
6 changes: 3 additions & 3 deletions dir.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<RepositoryRootDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))</RepositoryRootDirectory>
<SourceProjectsDirectory>$(RepositoryRootDirectory)src</SourceProjectsDirectory>
Expand All @@ -17,7 +17,7 @@
<!-- Trying to mitigate the number of warnings that the solution contains by
adding this into our Release builds. As a result, it should be caught in
our PRs because of the CI builds -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<!-- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</PropertyGroup>-->
</Project>
Loading

0 comments on commit 4f5f664

Please sign in to comment.