diff --git a/.gitignore b/.gitignore index 929a09f6c..3093e7680 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,5 @@ src/Microsoft.Fx.Portability.Offline/data/ .tools/ .data *.nuget.props -*.nuget.targets \ No newline at end of file +*.nuget.targets +.vscode \ No newline at end of file diff --git a/PortabilityTools.sln b/PortabilityTools.sln index 2e3310282..b5dfebc96 100644 --- a/PortabilityTools.sln +++ b/PortabilityTools.sln @@ -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 @@ -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}" @@ -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 @@ -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} @@ -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 diff --git a/build.ps1 b/build.ps1 index 47cb8c52f..f44f11cd8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -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 @@ -29,10 +61,7 @@ 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 @@ -40,8 +69,12 @@ 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 } diff --git a/build/Get-BuildTools.ps1 b/build/Get-BuildTools.ps1 index b385f5f61..bd4b98def 100644 --- a/build/Get-BuildTools.ps1 +++ b/build/Get-BuildTools.ps1 @@ -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" { diff --git a/build/Set-VsDevEnv.ps1 b/build/Set-VsDevEnv.ps1 new file mode 100644 index 000000000..888ff4265 --- /dev/null +++ b/build/Set-VsDevEnv.ps1 @@ -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 = $matches["key"] + $value = $matches["value"] + + Write-Verbose("$key=$value") + Set-Item "ENV:\$key" -Value "$value" -Force + } +} \ No newline at end of file diff --git a/build/runtests.ps1 b/build/runtests.ps1 index 6a09c4af5..70e4f6dfe 100644 --- a/build/runtests.ps1 +++ b/build/runtests.ps1 @@ -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" @@ -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 diff --git a/dir.props b/dir.props index 313fecc31..4a7dece7f 100644 --- a/dir.props +++ b/dir.props @@ -1,5 +1,5 @@ - + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props)) $(RepositoryRootDirectory)src @@ -17,7 +17,7 @@ - + diff --git a/dir.targets b/dir.targets index fe313ff0c..6bef51cff 100644 --- a/dir.targets +++ b/dir.targets @@ -1,11 +1,11 @@  - - @@ -41,7 +41,7 @@ $(BUILD_BUILDNUMBER.Split('.')[1].TrimStart('0')) $(BuildVersion.PadLeft(5,"0")) - + $(MSBuildProjectDirectory)\Properties\version.txt 1.0.0 @@ -86,4 +86,14 @@ GenerateAssemblyInfoFile;$(CompileDependsOn) + + + + + + + diff --git a/samples/SearchFxApi/SearchFxApi.csproj b/samples/SearchFxApi/SearchFxApi.csproj index 2dcf32fbd..cf733b19e 100644 --- a/samples/SearchFxApi/SearchFxApi.csproj +++ b/samples/SearchFxApi/SearchFxApi.csproj @@ -1,52 +1,10 @@ - - - + + + - Debug - AnyCPU - {16815A46-F1CA-4D56-80C8-54C4DFB8C1BC} - Exe - Properties - SearchFxApi - SearchFxApi - v4.6 - 512 - true + net46 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - + {8d84ec23-9977-4cc8-b649-035ffae9664c} @@ -56,12 +14,4 @@ - - \ No newline at end of file diff --git a/src/ApiPort.VisualStudio/ApiPort.VisualStudio.csproj b/src/ApiPort.VisualStudio/ApiPort.VisualStudio.csproj index c9439b26a..d8453ef75 100644 --- a/src/ApiPort.VisualStudio/ApiPort.VisualStudio.csproj +++ b/src/ApiPort.VisualStudio/ApiPort.VisualStudio.csproj @@ -1,11 +1,13 @@  - + + + - 14.0 + 15.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + true @@ -14,12 +16,18 @@ AnyCPU 2.0 {D15030D8-CFC5-4F05-8987-784326856E90} - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Properties ApiPortVS ApiPort.VisualStudio v4.6 + true + true + true + true + true + false true @@ -28,8 +36,6 @@ DEBUG;TRACE prompt 4 - false - false pdbonly @@ -38,16 +44,11 @@ prompt 4 false - false - true $(OutputIntermediate)\$(AssemblyName) $(OutputDrop)\$(AssemblyName) - - True - False @@ -61,26 +62,199 @@ False - + + ..\..\packages\Autofac.4.4.0\lib\net45\Autofac.dll + + + ..\..\packages\Microsoft.AspNetCore.WebUtilities.1.1.1\lib\net451\Microsoft.AspNetCore.WebUtilities.dll + + + ..\..\packages\Microsoft.Build.15.1.548\lib\net46\Microsoft.Build.dll + True + + + ..\..\packages\Microsoft.Build.Framework.15.1.548\lib\net46\Microsoft.Build.Framework.dll + True + + + ..\..\packages\Microsoft.Cci.4.0.0-rc3-24214-00\lib\netstandard1.3\Microsoft.Cci.dll + - - False + + ..\..\packages\Microsoft.Extensions.Primitives.1.1.0\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll + + + ..\..\packages\Microsoft.Net.Http.Headers.1.1.1\lib\netstandard1.1\Microsoft.Net.Http.Headers.dll + + + ..\..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26201\lib\net45\Microsoft.VisualStudio.CoreUtility.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Imaging.15.0.26201\lib\net45\Microsoft.VisualStudio.Imaging.dll + True + + + ..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.15.0.15.0.26201\lib\Microsoft.VisualStudio.Shell.15.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26201\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.15.0.25413-Preview5\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.15.0.25413-Preview5\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Immutable.12.0.15.0.25413-Preview5\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Immutable.14.0.15.0.25403-Preview5\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll + True + + + True + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll + True + + + True + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll + True + + + True + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll + True + + + ..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - False + True + ..\..\packages\stdole.7.0.3301\lib\net10\stdole.dll + True + + ..\..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll + + + ..\..\packages\System.Buffers.4.3.0\lib\netstandard1.1\System.Buffers.dll + + + ..\..\packages\System.Collections.NonGeneric.4.3.0\lib\net46\System.Collections.NonGeneric.dll + - - + + ..\..\packages\System.Console.4.3.0\lib\net46\System.Console.dll + + + ..\..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + + ..\..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + + + ..\..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + + + + ..\..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + + + ..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + + + ..\..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + + + ..\..\packages\System.Net.Http.4.3.1\lib\net46\System.Net.Http.dll + + + ..\..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.3.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + + + ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net46\System.Security.Cryptography.Algorithms.dll + + + ..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net46\System.Security.Cryptography.X509Certificates.dll + + + ..\..\packages\System.Text.Encodings.Web.4.3.0\lib\netstandard1.0\System.Text.Encodings.Web.dll + + + ..\..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll + + + ..\..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + True @@ -141,6 +315,7 @@ LocalizedStrings.resx + @@ -166,7 +341,8 @@ Always true - + + Designer @@ -207,23 +383,21 @@ - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - true - - - + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort.VisualStudio/Constants.cs b/src/ApiPort.VisualStudio/Constants.cs new file mode 100644 index 000000000..cb672a5a6 --- /dev/null +++ b/src/ApiPort.VisualStudio/Constants.cs @@ -0,0 +1,29 @@ +namespace ApiPortVS +{ + /// + /// Solution to not being able to embed interop types into assembly + /// https://blogs.msdn.microsoft.com/mshneer/2009/12/07/vs-2010-compiler-error-interop-type-xxx-cannot-be-embedded-use-the-applicable-interface-instead/ + /// + internal static class Constants + { + internal static class EnvDTE + { + /// + /// + /// https://msdn.microsoft.com/en-us/library/envdte.constants.vswindowkindoutput.aspx?f=255&MSPPError=-2147217396 + /// + public const string vsWindowKindOutput = "{34E76E81-EE4A-11D0-AE2E-00A0C90FFFC3}"; + } + + /// + /// + /// https://msdn.microsoft.com/en-us/library/envdte.codemodellanguageconstants.aspx + /// + internal static class CodeModelLanguageConstants + { + public const string vsCMLanguageVC = "{B5E9BD32-6D3E-4B5D-925E-8A43B79820B4}"; + public const string vsCMLanguageVB = "{B5E9BD33-6D3E-4B5D-925E-8A43B79820B4}"; + public const string vsCMLanguageCSharp = "{B5E9BD34-6D3E-4B5D-925E-8A43B79820B4}"; + } + } +} diff --git a/src/ApiPort.VisualStudio/DteProjectExtensions.cs b/src/ApiPort.VisualStudio/DteProjectExtensions.cs index ec876728c..20c86f1c8 100644 --- a/src/ApiPort.VisualStudio/DteProjectExtensions.cs +++ b/src/ApiPort.VisualStudio/DteProjectExtensions.cs @@ -85,10 +85,10 @@ public static bool IsDotNetProject(this Project project) switch (project.CodeModel.Language) { - case CodeModelLanguageConstants.vsCMLanguageCSharp: - case CodeModelLanguageConstants.vsCMLanguageVB: + case Constants.CodeModelLanguageConstants.vsCMLanguageCSharp: + case Constants.CodeModelLanguageConstants.vsCMLanguageVB: return true; - case CodeModelLanguageConstants.vsCMLanguageVC: + case Constants.CodeModelLanguageConstants.vsCMLanguageVC: return project.IsManagedCppProject(); } diff --git a/src/ApiPort.VisualStudio/OutputWindowWriter.cs b/src/ApiPort.VisualStudio/OutputWindowWriter.cs index 8672ac7e2..cdeb45800 100644 --- a/src/ApiPort.VisualStudio/OutputWindowWriter.cs +++ b/src/ApiPort.VisualStudio/OutputWindowWriter.cs @@ -9,8 +9,6 @@ using System.IO; using System.Text; -using static EnvDTE.Constants; - namespace ApiPortVS { public class OutputWindowWriter : TextWriter @@ -34,7 +32,7 @@ public void ShowWindow() try { - Window window = _dte.Windows.Item(vsWindowKindOutput); + Window window = _dte.Windows.Item(Constants.EnvDTE.vsWindowKindOutput); window.Activate(); } catch (Exception) { } diff --git a/src/ApiPort.VisualStudio/app.config b/src/ApiPort.VisualStudio/app.config new file mode 100644 index 000000000..b5af10b4a --- /dev/null +++ b/src/ApiPort.VisualStudio/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort.VisualStudio/packages.config b/src/ApiPort.VisualStudio/packages.config new file mode 100644 index 000000000..0f3efc588 --- /dev/null +++ b/src/ApiPort.VisualStudio/packages.config @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort.VisualStudio/project.json b/src/ApiPort.VisualStudio/project.json deleted file mode 100644 index 4567a3017..000000000 --- a/src/ApiPort.VisualStudio/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "dependencies": { - "Autofac": "4.1.0", - "MicroBuild.Core": "0.2.0", - "Microsoft.Cci": "4.0.0-rc3-24214-00", - "Microsoft.VisualStudio.Imaging": "14.3.25407", - "Microsoft.VisualStudio.OLE.Interop": "7.10.6070", - "Microsoft.VisualStudio.SDK.EmbedInteropTypes": "14.1.4", - "Microsoft.VisualStudio.Shell.14.0": "14.3.25407", - "Microsoft.VisualStudio.Shell.Immutable.10.0": "10.0.30319", - "Microsoft.VisualStudio.Shell.Immutable.11.0": "11.0.50727", - "Microsoft.VisualStudio.Shell.Immutable.12.0": "12.0.21003", - "Microsoft.VisualStudio.Shell.Immutable.14.0": "14.3.25407", - "Microsoft.VisualStudio.Shell.Interop": "7.10.6071", - "Microsoft.VisualStudio.Shell.Interop.10.0": "10.0.30319", - "Microsoft.VisualStudio.Shell.Interop.11.0": "11.0.61030", - "Microsoft.VisualStudio.Shell.Interop.12.0": "12.0.30110", - "Microsoft.VisualStudio.Shell.Interop.8.0": "8.0.50727", - "Microsoft.VisualStudio.Shell.Interop.9.0": "9.0.30729", - "Microsoft.VisualStudio.TextManager.Interop": "7.10.6070", - "Microsoft.VisualStudio.TextManager.Interop.8.0": "8.0.50727", - "Microsoft.VisualStudio.Threading": "14.1.111", - "Microsoft.VisualStudio.Utilities": "14.3.25407", - "Microsoft.VisualStudio.Validation": "14.1.111", - "Microsoft.VSSDK.BuildTools": "14.3.25407", - "Newtonsoft.Json": "9.0.1" - }, - "frameworks": { - "net46": {} - }, - "runtimes": { - "win": {} - } -} \ No newline at end of file diff --git a/src/ApiPort.VisualStudio/source.extension.vsixmanifest b/src/ApiPort.VisualStudio/source.extension.vsixmanifest index 04bf671d1..290f46438 100644 --- a/src/ApiPort.VisualStudio/source.extension.vsixmanifest +++ b/src/ApiPort.VisualStudio/source.extension.vsixmanifest @@ -1,19 +1,24 @@  - + SEE DESCRIPTION NOTE: Modify src/ApiPort.Vsix/source.extension.vsixmanifest.that exists because that is the one we deploy. - - - + + + + + - + - + + + + diff --git a/src/ApiPort.Vsix/ApiPort.Vsix.csproj b/src/ApiPort.Vsix/ApiPort.Vsix.csproj index c40d53f0a..5aee71222 100644 --- a/src/ApiPort.Vsix/ApiPort.Vsix.csproj +++ b/src/ApiPort.Vsix/ApiPort.Vsix.csproj @@ -1,29 +1,13 @@  - + + + - 14.0 - 12.0 + 15.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) ApiPort.vsix - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - false - @@ -38,12 +22,14 @@ ApiPort.Vsix ApiPort.Vsix v4.6 - false false false false false false + false + True + True true @@ -52,9 +38,6 @@ DEBUG;TRACE prompt 4 - false - true - True pdbonly @@ -62,8 +45,6 @@ TRACE prompt 4 - false - false $(OutputIntermediate)\$(AssemblyName) @@ -72,28 +53,12 @@ true - + + Designer - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - {d15030d8-cfc5-4f05-8987-784326856e90} @@ -103,7 +68,18 @@ - + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort.Vsix/app.config b/src/ApiPort.Vsix/app.config new file mode 100644 index 000000000..f974b4dcf --- /dev/null +++ b/src/ApiPort.Vsix/app.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort.Vsix/packages.config b/src/ApiPort.Vsix/packages.config new file mode 100644 index 000000000..0f0cc0df2 --- /dev/null +++ b/src/ApiPort.Vsix/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ApiPort.Vsix/project.json b/src/ApiPort.Vsix/project.json deleted file mode 100644 index a7205dbb9..000000000 --- a/src/ApiPort.Vsix/project.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dependencies": { - "MicroBuild.Core": "0.2.0" - }, - "frameworks": { - "net46": {} - }, - "runtimes": { - "win": {} - } -} \ No newline at end of file diff --git a/src/ApiPort.Vsix/source.extension.vsixmanifest b/src/ApiPort.Vsix/source.extension.vsixmanifest index f459a9133..9062e7d4f 100644 --- a/src/ApiPort.Vsix/source.extension.vsixmanifest +++ b/src/ApiPort.Vsix/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + .NET Portability Analyzer Evaluates portability of assemblies across .NET platforms http://go.microsoft.com/fwlink/?LinkId=506955 @@ -11,14 +11,20 @@ code analysis, cross-platform, .NET Framework, .NET, portable, cross platform, Portable Library - - - + + + + + - + + + + + \ No newline at end of file diff --git a/src/ApiPort/ApiPort.Core.csproj b/src/ApiPort/ApiPort.Core.csproj deleted file mode 100644 index 4de2276da..000000000 --- a/src/ApiPort/ApiPort.Core.csproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - Debug - AnyCPU - {560DD4EB-C4D2-4F94-9695-931CD3D17B5B} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - Properties - ApiPort - ApiPort - NETCORE - 512 - - false - - - - .NETCoreApp - v1.0 - win7 - true - $(NoWarn);1701 - - - - $(OutputIntermediate)\$(AssemblyName) - $(OutputDrop)\$(AssemblyName)\netcoreapp1.0\$(Platform) - $(OutputPath)\$(AssemblyName).xml - - - - true - full - false - TRACE;DEBUG;$(DefineConstants) - prompt - 4 - - - pdbonly - true - TRACE;$(DefineConstants) - prompt - 4 - - - true - DEBUG;TRACE;LINUX;$(DefineConstants) - full - ubuntu.14.04 - - - true - TRACE;LINUX;$(DefineConstants) - pdbonly - ubuntu.14.04 - - - true - DEBUG;TRACE;OSX;$(DefineConstants) - full - osx.10.10 - - - true - TRACE;OSX;$(DefineConstants) - pdbonly - osx.10.10 - - - - x64 - - - x86 - - - arm - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - LocalizedStrings.resx - - - - - - PublicResXFileCodeGenerator - LocalizedStrings.Designer.cs - - - - - - - - - - - - - {68c6476e-1f80-412a-a8a7-480f832922d8} - Microsoft.Fx.Portability.MetadataReader - - - {8d84ec23-9977-4cc8-b649-035ffae9664c} - Microsoft.Fx.Portability - - - - - - - - - - - - - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) - - true - false - - - Program - $(TargetDir)dotnet.exe - $(TargetPath) - {2E36F1D4-B23C-435D-AB41-18E608940038} - - \ No newline at end of file diff --git a/src/ApiPort/ApiPort.Core.project.json b/src/ApiPort/ApiPort.Core.project.json deleted file mode 100644 index 37a82389b..000000000 --- a/src/ApiPort/ApiPort.Core.project.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "runtimes": { - "win7-x86": {}, - "win7-x64": {}, - "win8-arm": {}, - "ubuntu.14.04-x64": {}, - "osx.10.10-x64": {} - }, - "buildOptions": { - "warningsAsErrors": true, - "emitEntryPoint": true - }, - "dependencies": { - "Autofac": "4.1.0", - "Autofac.Configuration": "4.0.1", - "MicroBuild.Core": "0.2.0", - "Microsoft.Extensions.Configuration.CommandLine": "1.0.0", - "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", - "Microsoft.NETCore.App": "1.0.1", - "Newtonsoft.Json": "9.0.1", - "System.Diagnostics.FileVersionInfo": "4.0.0", - "System.Diagnostics.TraceSource": "4.0.0", - "System.Security.SecureString": "4.0.0" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ "dnxcore50", "portable-net452" ] - } - } -} diff --git a/src/ApiPort/ApiPort.csproj b/src/ApiPort/ApiPort.csproj index e06e1372f..58e7e10fe 100644 --- a/src/ApiPort/ApiPort.csproj +++ b/src/ApiPort/ApiPort.csproj @@ -1,107 +1,57 @@ - - - + + - Debug - AnyCPU - {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72} Exe - Properties - ApiPort - ApiPort - v4.6 - 512 + net46;netcoreapp1.0 + win7-x64;win7-x86;osx.10.10-x64;ubuntu.14.04-x64 true - + true - - AnyCPU - true - full - false - TRACE;DEBUG;$(DefineConstants) - prompt - 4 - - - AnyCPU - pdbonly - true - TRACE;$(DefineConstants) - prompt - 4 - false + + + win7-x64 + $(DefineConstants);FEATURE_SYSTEM_PROXY;FEATURE_NETWORK_CREDENTIAL + - $(OutputIntermediate)\$(AssemblyName) - $(OutputDrop)\$(AssemblyName)\net46 + $(OutputIntermediate)\$(AssemblyName)\ + $(OutputDrop)\$(AssemblyName)\ $(OutputPath)\$(AssemblyName).xml - $(DefineConstants);FEATURE_SYSTEM_PROXY;FEATURE_NETWORK_CREDENTIAL + false + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - LocalizedStrings.resx - - - - - - PublicResXFileCodeGenerator - LocalizedStrings.Designer.cs - - - - - Designer - - - - PreserveNewest - + + + + + + + + + + + + + + + + + + + {68c6476e-1f80-412a-a8a7-480f832922d8} @@ -112,7 +62,7 @@ Microsoft.Fx.Portability - + diff --git a/src/ApiPort/ApiPort.project.json b/src/ApiPort/ApiPort.project.json deleted file mode 100644 index 6ba7b0029..000000000 --- a/src/ApiPort/ApiPort.project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "runtimes": { - "win-anycpu": {}, - "win": {} - }, - "dependencies": { - "Autofac": "4.1.0", - "Autofac.Configuration": "4.0.1", - "MicroBuild.Core": "0.2.0", - "Microsoft.Extensions.Configuration.CommandLine": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", - "Newtonsoft.Json": "9.0.1", - "System.Collections.Immutable": "1.2.0", - "System.Reflection.Metadata": "1.4.1-beta-24227-04" - }, - "frameworks": { - "net46": {} - } -} \ No newline at end of file diff --git a/src/ApiPort/App.config b/src/ApiPort/App.config index 7c89b2bda..73c8b0374 100644 --- a/src/ApiPort/App.config +++ b/src/ApiPort/App.config @@ -3,34 +3,11 @@ - - - - - - - - - - - - - - - - - - - - - + - - - \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.MetadataReader/MemberMetadataInfoTypeProvider.cs b/src/Microsoft.Fx.Portability.MetadataReader/MemberMetadataInfoTypeProvider.cs index e7199975f..6e4a2f81d 100644 --- a/src/Microsoft.Fx.Portability.MetadataReader/MemberMetadataInfoTypeProvider.cs +++ b/src/Microsoft.Fx.Portability.MetadataReader/MemberMetadataInfoTypeProvider.cs @@ -12,16 +12,16 @@ namespace Microsoft.Fx.Portability.Analyzer { - internal class MemberMetadataInfoTypeProvider : ISignatureTypeProvider + internal class MemberMetadataInfoTypeProvider : ISignatureTypeProvider { - private readonly SignatureDecoder _methodDecoder; + private readonly SignatureDecoder _methodDecoder; public MetadataReader Reader { get; } public MemberMetadataInfoTypeProvider(MetadataReader reader) { Reader = reader; - _methodDecoder = new SignatureDecoder(this, reader); + _methodDecoder = new SignatureDecoder(this, reader, null); } public MemberMetadataInfo GetMemberRefInfo(MemberReference memberReference) @@ -48,7 +48,7 @@ public MemberMetadataInfo GetMemberRefInfo(MemberReference memberReference) Name = Reader.GetString(memberReference.Name), ParentType = parentType, Kind = MemberKind.Method, - MethodSignature = memberReference.DecodeMethodSignature(this).MakeEnclosedType() + MethodSignature = memberReference.DecodeMethodSignature(this, null).MakeEnclosedType() }; default: return null; @@ -69,7 +69,7 @@ public MemberMetadataInfo GetMemberParentInfo(MemberReference memberReference) }; case HandleKind.TypeSpecification: var type = Reader.GetTypeSpecification((TypeSpecificationHandle)parent); - return type.DecodeSignature(this); + return type.DecodeSignature(this, null); case HandleKind.MethodDefinition: var method = Reader.GetMethodDefinition((MethodDefinitionHandle)parent); return new MemberMetadataInfo(GetFullName(method.GetDeclaringType())); @@ -303,7 +303,7 @@ public MemberMetadataInfo GetByReferenceType(MemberMetadataInfo elementType) }; } - public MemberMetadataInfo GetGenericMethodParameter(int index) + public MemberMetadataInfo GetGenericMethodParameter(object genericContext, int index) { // Generic arguments on methods are prefixed with `` // Type generic arguments are prefixed with ` @@ -314,7 +314,7 @@ public MemberMetadataInfo GetGenericMethodParameter(int index) }; } - public MemberMetadataInfo GetGenericTypeParameter(int index) + public MemberMetadataInfo GetGenericTypeParameter(object genericContext, int index) { // Type generic arguments are prefixed with ` return new MemberMetadataInfo @@ -324,7 +324,7 @@ public MemberMetadataInfo GetGenericTypeParameter(int index) }; } - public MemberMetadataInfo GetGenericInstance(MemberMetadataInfo genericType, ImmutableArray typeArguments) + public MemberMetadataInfo GetGenericInstantiation(MemberMetadataInfo genericType, ImmutableArray typeArguments) { genericType.IsGenericInstance = true; genericType.GenericTypeArgs = new List(typeArguments); @@ -389,7 +389,7 @@ public MemberMetadataInfo GetArrayType(MemberMetadataInfo elementType, ArrayShap return elementType; } - public MemberMetadataInfo GetTypeFromSpecification(MetadataReader reader, TypeSpecificationHandle handle, byte rawTypeKind) + public MemberMetadataInfo GetTypeFromSpecification(MetadataReader reader, object genericContext, TypeSpecificationHandle handle, byte rawTypeKind) { var entityHandle = (EntityHandle)handle; @@ -402,13 +402,13 @@ public MemberMetadataInfo GetTypeFromSpecification(MetadataReader reader, TypeSp case HandleKind.TypeSpecification: var specification = reader.GetTypeSpecification((TypeSpecificationHandle)entityHandle); - return specification.DecodeSignature(this); + return specification.DecodeSignature(this, null); default: throw new NotSupportedException("This kind is not supported!"); } } - public MemberMetadataInfo GetModifiedType(MetadataReader reader, bool isRequired, MemberMetadataInfo modifier, MemberMetadataInfo unmodifiedType) + public MemberMetadataInfo GetModifiedType(MemberMetadataInfo modifier, MemberMetadataInfo unmodifiedType, bool isRequired) { return new MemberMetadataInfo(unmodifiedType) { diff --git a/src/Microsoft.Fx.Portability.MetadataReader/MetadataReaderExtensions.cs b/src/Microsoft.Fx.Portability.MetadataReader/MetadataReaderExtensions.cs index bc3e6d492..fabe13a85 100644 --- a/src/Microsoft.Fx.Portability.MetadataReader/MetadataReaderExtensions.cs +++ b/src/Microsoft.Fx.Portability.MetadataReader/MetadataReaderExtensions.cs @@ -62,7 +62,7 @@ public static ImmutableArray GetParameterValues(this MetadataReader meta var ctor = metadataReader.GetMemberReference((MemberReferenceHandle)customAttribute.Constructor); var provider = new StringParameterValueTypeProvider(metadataReader, customAttribute.Value); - var signature = ctor.DecodeMethodSignature(provider); + var signature = ctor.DecodeMethodSignature(provider, null); return signature.ParameterTypes; } diff --git a/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.csproj b/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.csproj index 3f4038711..a22193ed6 100644 --- a/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.csproj +++ b/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.csproj @@ -1,90 +1,30 @@ - - - + + - 14.0 - Debug - AnyCPU - {68C6476E-1F80-412A-A8A7-480F832922D8} - Library - Properties - Microsoft.Fx.Portability.MetadataReader - Microsoft.Fx.Portability.MetadataReader - en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - v5.0 - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 + netstandard1.3 + - netstandard1.3 - $(OutputIntermediate)\$(AssemblyName)\$(NugetTarget) - $(OutputDrop)\$(AssemblyName)\$(NugetTarget) + $(OutputIntermediate)\$(AssemblyName)\ + $(OutputDrop)\$(AssemblyName)\ $(OutputPath)\$(AssemblyName).xml + - - - - - - - - - - - - - - - - True - True - LocalizedStrings.resx - - - - - - PublicResXFileCodeGenerator - LocalizedStrings.Designer.cs - Microsoft.Fx.Portability.Analyzer.Resources - + + + {8d84ec23-9977-4cc8-b649-035ffae9664c} Microsoft.Fx.Portability - + - - \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.project.json b/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.project.json deleted file mode 100644 index 841bb7f6c..000000000 --- a/src/Microsoft.Fx.Portability.MetadataReader/Microsoft.Fx.Portability.MetadataReader.project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.0", - "System.Reflection.Metadata": "1.4.1-beta-24227-04", - "MicroBuild.Core": "0.2.0" - }, - "frameworks": { - "netstandard1.3": {} - } -} \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.MetadataReader/StringParameterValueTypeProvider.cs b/src/Microsoft.Fx.Portability.MetadataReader/StringParameterValueTypeProvider.cs index cc546f604..3142bc283 100644 --- a/src/Microsoft.Fx.Portability.MetadataReader/StringParameterValueTypeProvider.cs +++ b/src/Microsoft.Fx.Portability.MetadataReader/StringParameterValueTypeProvider.cs @@ -8,7 +8,7 @@ namespace Microsoft.Fx.Portability { - internal class StringParameterValueTypeProvider : ISignatureTypeProvider + internal class StringParameterValueTypeProvider : ISignatureTypeProvider { private readonly BlobReader _valueReader; @@ -46,17 +46,23 @@ public string GetGenericInstance(string genericType, ImmutableArray type return string.Empty; } + public string GetGenericInstantiation(string genericType, ImmutableArray typeArguments) => throw new NotImplementedException(); + public string GetGenericMethodParameter(int index) { return string.Empty; } + public string GetGenericMethodParameter(object genericContext, int index) => throw new NotImplementedException(); + public string GetGenericTypeParameter(int index) { return string.Empty; } - public string GetModifiedType(MetadataReader reader, bool isRequired, string modifier, string unmodifiedType) + public string GetGenericTypeParameter(object genericContext, int index) => throw new NotImplementedException(); + + public string GetModifiedType(string modifier, string unmodifiedType, bool isRequired) { return string.Empty; } @@ -98,7 +104,7 @@ public string GetTypeFromReference(MetadataReader reader, TypeReferenceHandle ha return string.Empty; } - public string GetTypeFromSpecification(MetadataReader reader, TypeSpecificationHandle handle, byte rawTypeKind) + public string GetTypeFromSpecification(MetadataReader reader, object genericContext, TypeSpecificationHandle handle, byte rawTypeKind) { return string.Empty; } diff --git a/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.csproj b/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.csproj index 048b768db..1ca6c623a 100644 --- a/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.csproj +++ b/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.csproj @@ -1,55 +1,27 @@ - - - + + - Debug - AnyCPU - {F3D148CA-D49D-4315-9CD6-AE7B0EEA9549} - Library - Properties - Microsoft.Fx.Portability - Microsoft.Fx.Portability.Offline - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - v5.0 - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 + netstandard1.3 + - netstandard1.3 - $(OutputIntermediate)\$(AssemblyName)\$(NugetTarget) - $(OutputDrop)\$(AssemblyName)\$(NugetTarget) + $(OutputIntermediate)\$(AssemblyName)\ + $(OutputDrop)\$(AssemblyName)\ $(OutputPath)\$(AssemblyName).xml + - - - - - - + + - + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\.data\ $(MSBuildThisFileDirectory)..\..\docs\BreakingChanges\ $(DataPath)catalog.bin + data\catalog.bin @@ -58,8 +30,8 @@ data\%(Filename)%(Extension) true - + {28d8d77d-e68d-4ebc-9150-f7c433d63bfa} @@ -70,10 +42,11 @@ Microsoft.Fx.Portability + - + diff --git a/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.project.json b/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.project.json deleted file mode 100644 index c66d12e30..000000000 --- a/src/Microsoft.Fx.Portability.Offline/Microsoft.Fx.Portability.Offline.project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.0", - "Autofac": "4.1.0", - "MicroBuild.Core": "0.2.0" - }, - "frameworks": { - "netstandard1.3": { } - } -} \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.csproj b/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.csproj index a3d733a7c..347e68c37 100644 --- a/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.csproj +++ b/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.csproj @@ -1,87 +1,32 @@ - - - + + - Debug - AnyCPU - {83F4A5FE-FAF8-4952-899E-EA0BB08F8E60} - Library - Properties - Microsoft.Fx.Portability.Reports - Microsoft.Fx.Portability.Reports.Html - v4.6 - 512 - - - - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 + net46 - net46 - $(OutputIntermediate)\$(AssemblyName)\$(NugetTarget) - $(OutputDrop)\$(AssemblyName)\$(NugetTarget) + $(OutputIntermediate)\$(AssemblyName)\ + $(OutputDrop)\$(AssemblyName)\ $(OutputPath)\$(AssemblyName).xml + - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - + + + + + + {8d84ec23-9977-4cc8-b649-035ffae9664c} Microsoft.Fx.Portability - + - \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.project.json b/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.project.json deleted file mode 100644 index 3b4687d5f..000000000 --- a/src/Microsoft.Fx.Portability.Reports.Html/Microsoft.Fx.Portability.Reports.Html.project.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "frameworks": { - "net46": { } - }, - "dependencies": { - "CommonMark.NET": "0.10.0", - "MicroBuild.Core": "0.2.0", - "RazorEngine": "3.6.1", - "System.Net.Http": "4.1.0" - }, - "runtimes": { - "win": { } - } -} \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.csproj b/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.csproj index ac910632d..d2130d02b 100644 --- a/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.csproj +++ b/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.csproj @@ -1,68 +1,31 @@ - - - + + - 14.0 - Debug - AnyCPU - {28D8D77D-E68D-4EBC-9150-F7C433D63BFA} - Library - Properties - Microsoft.Fx.Portability.Reports.Json - Microsoft.Fx.Portability.Reports.Json - en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - v5.0 - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 + netstandard1.3 + - netstandard1.3 - $(OutputIntermediate)\$(AssemblyName)\$(NugetTarget) - $(OutputDrop)\$(AssemblyName)\$(NugetTarget) + $(OutputIntermediate)\$(AssemblyName)\ + $(OutputDrop)\$(AssemblyName)\ $(OutputPath)\$(AssemblyName).xml + - - - - - + + + {8d84ec23-9977-4cc8-b649-035ffae9664c} Microsoft.Fx.Portability - + - + - \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.project.json b/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.project.json deleted file mode 100644 index b2b72b2db..000000000 --- a/src/Microsoft.Fx.Portability.Reports.Json/Microsoft.Fx.Portability.Reports.Json.project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.0", - "Newtonsoft.Json": "9.0.1", - "MicroBuild.Core": "0.2.0" - }, - "frameworks": { - "netstandard1.3": {} - } -} \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability/Analysis/AnalysisEngine.cs b/src/Microsoft.Fx.Portability/Analysis/AnalysisEngine.cs index a59e0924f..a54607db3 100644 --- a/src/Microsoft.Fx.Portability/Analysis/AnalysisEngine.cs +++ b/src/Microsoft.Fx.Portability/Analysis/AnalysisEngine.cs @@ -226,7 +226,7 @@ private static string GetAssemblyIdentityWithoutCultureAndVersion(string assembl return new System.Reflection.AssemblyName(assemblyIdentity) { Version = null, -#if NET45 +#if FEATURE_ASSEMBLYNAME_CULTUREINFO CultureInfo = null #else CultureName = null diff --git a/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.csproj b/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.csproj index 7c8ad3fab..3a30e40c4 100644 --- a/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.csproj +++ b/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.csproj @@ -1,174 +1,40 @@ - - - + + - 14.0 - Debug - AnyCPU - {8D84EC23-9977-4CC8-B649-035FFAE9664C} - Library - Properties - Microsoft.Fx.Portability - Microsoft.Fx.Portability - en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - v5.0 - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 + netstandard1.3 + - netstandard1.3 - $(OutputIntermediate)\$(AssemblyName)\$(NugetTarget) - $(OutputDrop)\$(AssemblyName)\$(NugetTarget) + $(OutputIntermediate)\$(AssemblyName)\ + $(OutputDrop)\$(AssemblyName)\ $(OutputPath)\$(AssemblyName).xml FEATURE_NETCORE + + + $(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_ASSEMBLY_LOCATION;FEATURE_XML_SCHEMA + + - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - LocalizedStrings.resx - - - - - - - - - - - - - - - - + + + + - + + - - PublicResXFileCodeGenerator - LocalizedStrings.Designer.cs - + - + - \ No newline at end of file diff --git a/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.project.json b/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.project.json deleted file mode 100644 index 7c9db77b2..000000000 --- a/src/Microsoft.Fx.Portability/Microsoft.Fx.Portability.project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.0", - "System.Linq.Parallel": "4.0.1", - "Newtonsoft.Json": "9.0.1", - "Microsoft.AspNetCore.WebUtilities": "1.0.0", - "MicroBuild.Core": "0.2.0" - }, - "frameworks": { - "netstandard1.3": { } - } -} diff --git a/tests/ApiPortVS.Tests/ApiPortVS.Tests.csproj b/tests/ApiPortVS.Tests/ApiPortVS.Tests.csproj index 7ad6c3973..050544e75 100644 --- a/tests/ApiPortVS.Tests/ApiPortVS.Tests.csproj +++ b/tests/ApiPortVS.Tests/ApiPortVS.Tests.csproj @@ -1,5 +1,6 @@  + @@ -37,7 +38,77 @@ False + + ..\..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26201\lib\net45\Microsoft.VisualStudio.CoreUtility.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Imaging.15.0.26201\lib\net45\Microsoft.VisualStudio.Imaging.dll + True + + + ..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.15.0.15.0.26201\lib\Microsoft.VisualStudio.Shell.15.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26201\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll + True + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\..\packages\NSubstitute.2.0.2\lib\net45\NSubstitute.dll + + + ..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll + + + ..\..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll + + + ..\..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll + + + ..\..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll + @@ -48,6 +119,7 @@ + @@ -65,6 +137,12 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.Cci.Tests/TestAssembly.cs b/tests/Microsoft.Fx.Portability.Cci.Tests/TestAssembly.cs index 53d0bb3c1..2c2a11fa3 100644 --- a/tests/Microsoft.Fx.Portability.Cci.Tests/TestAssembly.cs +++ b/tests/Microsoft.Fx.Portability.Cci.Tests/TestAssembly.cs @@ -7,13 +7,14 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; using Xunit; namespace Microsoft.Fx.Portability.Cci.Tests { internal class TestAssembly { - private static readonly string s_mscorlib = typeof(object).Assembly.Location; + private static readonly string s_mscorlib = typeof(object).GetTypeInfo().Assembly.Location; private readonly string _path; private const string TFM = @"[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute("".NETFramework,Version=v4.5.1"", FrameworkDisplayName = "".NET Framework 4.5.1"")]"; @@ -68,9 +69,9 @@ public static string WithGenericsAndReference private static string GetText(string fileName) { - var name = typeof(TestAssembly).Assembly.GetManifestResourceNames().Single(n => n.EndsWith(fileName)); + var name = typeof(TestAssembly).GetTypeInfo().Assembly.GetManifestResourceNames().Single(n => n.EndsWith(fileName)); - using (var stream = typeof(TestAssembly).Assembly.GetManifestResourceStream(name)) + using (var stream = typeof(TestAssembly).GetTypeInfo().Assembly.GetManifestResourceStream(name)) using (var reader = new StreamReader(stream)) { return reader.ReadToEnd(); diff --git a/tests/Microsoft.Fx.Portability.Cci.Tests/app.config b/tests/Microsoft.Fx.Portability.Cci.Tests/app.config index 35f3835cd..99ddf3e08 100644 --- a/tests/Microsoft.Fx.Portability.Cci.Tests/app.config +++ b/tests/Microsoft.Fx.Portability.Cci.Tests/app.config @@ -1,31 +1,3 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.Cci.Tests/project.json b/tests/Microsoft.Fx.Portability.Cci.Tests/project.json deleted file mode 100644 index 1fe4031d4..000000000 --- a/tests/Microsoft.Fx.Portability.Cci.Tests/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "dependencies": { - "Microsoft.CodeAnalysis.CSharp": "1.3.2", - "Newtonsoft.Json": "9.0.1", - "NSubstitute": "1.10.0", - "System.Reflection.Metadata": "1.4.1-beta-24227-04", - "xunit": "2.1.0", - "xunit.runner.visualstudio": "2.1.0" - }, - "frameworks": { - "net46": {} - }, - "runtimes": { - "win": {} - } -} \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/App.config b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/App.config index 5fe326e9b..adf62fcc1 100644 --- a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/App.config +++ b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/App.config @@ -1,17 +1,5 @@  - - - - - - - - - - - - diff --git a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Microsoft.Fx.Portability.MetadataReader.Tests.csproj b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Microsoft.Fx.Portability.MetadataReader.Tests.csproj index 21d1efc8a..66999802d 100644 --- a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Microsoft.Fx.Portability.MetadataReader.Tests.csproj +++ b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Microsoft.Fx.Portability.MetadataReader.Tests.csproj @@ -1,53 +1,26 @@ - - - - + + - Debug - AnyCPU - {B44085A7-0DCD-4CE2-BDD9-B2E5268DCCCC} - Library - Properties - Microsoft.Fx.Portability.MetadataReader.Tests - Microsoft.Fx.Portability.MetadataReader.Tests - v4.6 - 512 - - + net46 true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + true + - - - - - - - + + + + + + + + + + + + - - - @@ -68,11 +41,9 @@ + - - Designer - PreserveNewest @@ -80,9 +51,6 @@ - - - {68c6476e-1f80-412a-a8a7-480f832922d8} @@ -93,13 +61,5 @@ Microsoft.Fx.Portability - - \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/ReflectionMetadataInfoTests.cs b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/ReflectionMetadataInfoTests.cs index 8f7a46226..0831503c8 100644 --- a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/ReflectionMetadataInfoTests.cs +++ b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/ReflectionMetadataInfoTests.cs @@ -55,7 +55,6 @@ public void UnresolvedAssemblyTest() } Assert.True(dependencies.UnresolvedAssemblies.All(o => o.Value.Count == 1)); - Assert.True(dependencies.UnresolvedAssemblies.All(o => string.Equals(o.Value.First(), "Microsoft.Fx.Portability.MetadataReader.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4a286c3e845c3e69", StringComparison.Ordinal))); // Make sure no issues were found progressReport.Received(0).ReportIssue(Arg.Any()); diff --git a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/TestAssembly.cs b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/TestAssembly.cs index f71678016..a09026c3d 100644 --- a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/TestAssembly.cs +++ b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/TestAssembly.cs @@ -29,8 +29,8 @@ public static IAssemblyFile Create(string source, bool allowUnsafe = false) private class CSharpCompileAssemblyFile : IAssemblyFile { - private static readonly Assembly s_assembly = typeof(CSharpCompileAssemblyFile).Assembly; - private static readonly IEnumerable s_references = new[] { typeof(object).Assembly.Location, typeof(Uri).Assembly.Location } + private static readonly Assembly s_assembly = typeof(CSharpCompileAssemblyFile).GetTypeInfo().Assembly; + private static readonly IEnumerable s_references = new[] { typeof(object).GetTypeInfo().Assembly.Location, typeof(Uri).GetTypeInfo().Assembly.Location } .Select(r => MetadataReference.CreateFromFile(r)) .ToList(); @@ -86,7 +86,7 @@ private static string GetText(string fileName) private class ResourceStreamAssemblyFile : IAssemblyFile { - private static readonly Assembly s_assembly = typeof(ResourceStreamAssemblyFile).Assembly; + private static readonly Assembly s_assembly = typeof(ResourceStreamAssemblyFile).GetTypeInfo().Assembly; public ResourceStreamAssemblyFile(string fileName) { diff --git a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Tests/BaselineTests.cs b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Tests/BaselineTests.cs index 29cf151e8..be20f43df 100644 --- a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Tests/BaselineTests.cs +++ b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/Tests/BaselineTests.cs @@ -2,26 +2,28 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Fx.Portability.Analyzer; -using Microsoft.Fx.Portability.ObjectModel; using NSubstitute; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; using Xunit; namespace Microsoft.Fx.Portability.MetadataReader.Tests { public class BaselineTests { - [Fact(Skip = "Requires an updated version of System.Reflection.Metadata")] public void MscorlibTest() { - var mscorlib = typeof(object).Assembly.Location; + var dependencyFilter = Substitute.For(); + + var mscorlib = typeof(object).GetTypeInfo().Assembly.Location; var baseline = GetBaseline(mscorlib); - var dependencyFinder = new ReflectionMetadataDependencyFinder(); - var path = new FileInfo(mscorlib); + var dependencyFinder = new ReflectionMetadataDependencyFinder(dependencyFilter); + var path = new AssemblyFileClass(new FileInfo(mscorlib)); + var assemblyFile = Substitute.For(); var progressReporter = Substitute.For(); var dependencies = dependencyFinder.FindDependencies(new[] { path }, progressReporter); @@ -33,21 +35,36 @@ public void MscorlibTest() Assert.Equal(baseline, result); } - private IEnumerable GetBaseline(string path) + private IEnumerable GetBaseline(string path) { var fileName = Path.GetFileNameWithoutExtension(path); var version = FileVersionInfo.GetVersionInfo(path); var version_file = $"{fileName}_{version.ProductVersion}.json"; - using (var data = typeof(ManagedMetadataReaderTests).Assembly.GetManifestResourceStream(typeof(ManagedMetadataReaderTests), $"Data.{version_file}")) + using (var data = typeof(ManagedMetadataReaderTests).GetTypeInfo().Assembly.GetManifestResourceStream($"Data.{version_file}")) { if (data == null) { Assert.True(false, $"Could not find baseline file for {fileName} version={version.ProductVersion}"); } - return data.Deserialize>(); + return data.Deserialize>(); } } + + private class AssemblyFileClass : IAssemblyFile + { + private readonly FileInfo _file; + public AssemblyFileClass(FileInfo info) => _file = info; + + public string Name => _file.Name; + + public string Version => FileVersionInfo.GetVersionInfo(_file.FullName).FileVersion; + + public bool Exists => _file.Exists; + + public Stream OpenRead() => _file.OpenRead(); + } + } } diff --git a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/project.json b/tests/Microsoft.Fx.Portability.MetadataReader.Tests/project.json deleted file mode 100644 index 483b521f9..000000000 --- a/tests/Microsoft.Fx.Portability.MetadataReader.Tests/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "dependencies": { - "MicroBuild.Core": "0.2.0", - "Microsoft.CodeAnalysis.CSharp": "1.3.2", - "Newtonsoft.Json": "9.0.1", - "NSubstitute": "1.10.0", - "System.Collections.Immutable": "1.2.0", - "System.Reflection.Metadata": "1.4.1-beta-24227-04", - "xunit": "2.1.0", - "xunit.runner.visualstudio": "2.1.0" - }, - "frameworks": { - "net46": {} - }, - "runtimes": { - "win": {} - } -} \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.Offline.Tests/Microsoft.Fx.Portability.Offline.Tests.csproj b/tests/Microsoft.Fx.Portability.Offline.Tests/Microsoft.Fx.Portability.Offline.Tests.csproj index 00a409563..9ebe9a249 100644 --- a/tests/Microsoft.Fx.Portability.Offline.Tests/Microsoft.Fx.Portability.Offline.Tests.csproj +++ b/tests/Microsoft.Fx.Portability.Offline.Tests/Microsoft.Fx.Portability.Offline.Tests.csproj @@ -1,48 +1,17 @@ - - - - + + - Debug - AnyCPU - {FD6B4124-975B-454E-ACC8-424CC9A8BB8B} - Library - Properties - Microsoft.Fx.Portability.Offline.Tests - Microsoft.Fx.Portability.Offline.Tests - v4.6 - 512 - + netcoreapp1.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - + - + + + + + + @@ -56,6 +25,5 @@ Microsoft.Fx.Portability - \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.Offline.Tests/project.json b/tests/Microsoft.Fx.Portability.Offline.Tests/project.json deleted file mode 100644 index 57ec5f2f1..000000000 --- a/tests/Microsoft.Fx.Portability.Offline.Tests/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "dependencies": { - "NSubstitute": "1.10.0", - "xunit": "2.1.0", - "xunit.runner.visualstudio": "2.1.0" - }, - "frameworks": { - "net46": {} - }, - "runtimes": { - "win": {} - } -} \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.Tests/Analysis/AnalysisEngineTests.cs b/tests/Microsoft.Fx.Portability.Tests/Analysis/AnalysisEngineTests.cs index a16c9c0b9..cc42369df 100644 --- a/tests/Microsoft.Fx.Portability.Tests/Analysis/AnalysisEngineTests.cs +++ b/tests/Microsoft.Fx.Portability.Tests/Analysis/AnalysisEngineTests.cs @@ -423,7 +423,8 @@ private static void TestBreakingChange(Version version, IApiRecommendations reco var testData = GenerateTestData(catalog); var engine = new AnalysisEngine(catalog, recommendations); - var framework = new FrameworkName(AnalysisEngine.FullFrameworkIdentifier + ",Version=" + version); + // Value from AnalysisEngine.FullFrameworkIdentifier + var framework = new FrameworkName(".NET Framework" + ",Version=" + version); var breakingChanges = engine.FindBreakingChanges(new[] { framework }, testData, assembliesToIgnore, breakingChangesToSuppress, Array.Empty()).ToList(); @@ -576,7 +577,13 @@ private static IDictionary> GenerateTestDa private static string GetAssemblyIdentityWithoutCultureAndVersion(string assemblyIdentity) { - return new System.Reflection.AssemblyName(assemblyIdentity) { CultureInfo = null, Version = null }.ToString(); + var assembly = new System.Reflection.AssemblyName(assemblyIdentity) { Version = null }; +#if FEATURE_ASSEMBLYNAME_CULTUREINFO + assembly.CultureInfo = null; +#else + assembly.CultureName = null; +#endif + return assembly.ToString(); } } } diff --git a/tests/Microsoft.Fx.Portability.Tests/BreakingChangeParserTests.cs b/tests/Microsoft.Fx.Portability.Tests/BreakingChangeParserTests.cs index bf34c3b3a..9f7f2b4b8 100644 --- a/tests/Microsoft.Fx.Portability.Tests/BreakingChangeParserTests.cs +++ b/tests/Microsoft.Fx.Portability.Tests/BreakingChangeParserTests.cs @@ -4,6 +4,7 @@ using System; using System.IO; using System.Linq; +using System.Reflection; using Xunit; namespace Microsoft.Fx.Portability.Tests @@ -115,7 +116,7 @@ public void RandomText() private void ValidateParse(Stream markdown, params BreakingChange[] expected) { BreakingChange[] actual = BreakingChangeParser.FromMarkdown(markdown).ToArray(); - markdown.Close(); + markdown.Dispose(); Assert.Equal(expected.Length, actual.Length); @@ -157,8 +158,8 @@ private void TestEquality(BreakingChange expected, BreakingChange actual) private Stream GetBreakingChangeMarkdown(string resourceName) { - var name = typeof(BreakingChangeParserTests).Assembly.GetManifestResourceNames().Single(n => n.EndsWith(resourceName)); - return typeof(BreakingChangeParserTests).Assembly.GetManifestResourceStream(name); + var name = typeof(BreakingChangeParserTests).GetTypeInfo().Assembly.GetManifestResourceNames().Single(n => n.EndsWith(resourceName)); + return typeof(BreakingChangeParserTests).GetTypeInfo().Assembly.GetManifestResourceStream(name); } #endregion diff --git a/tests/Microsoft.Fx.Portability.Tests/Microsoft.Fx.Portability.Tests.csproj b/tests/Microsoft.Fx.Portability.Tests/Microsoft.Fx.Portability.Tests.csproj index 92f6bfbb0..2627724a7 100644 --- a/tests/Microsoft.Fx.Portability.Tests/Microsoft.Fx.Portability.Tests.csproj +++ b/tests/Microsoft.Fx.Portability.Tests/Microsoft.Fx.Portability.Tests.csproj @@ -1,77 +1,31 @@ - - - - + + - Debug - AnyCPU - {36E8F09A-D3CA-405B-B515-9206F85B432C} - Library - Properties - Microsoft.Fx.Portability.Tests - Microsoft.Fx.Portability.Tests - v4.6 - 512 - - - + netcoreapp1.0 - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - + - - - - - - - + + + + + + + + + + + + true + ..\..\PortabilityTools.snk + + - - - - - - - - - - - - - - - - - - - - - + + - - Designer - @@ -91,22 +45,12 @@ - - - + {8d84ec23-9977-4cc8-b649-035ffae9664c} Microsoft.Fx.Portability - - \ No newline at end of file diff --git a/tests/Microsoft.Fx.Portability.Tests/TargetMapTests.cs b/tests/Microsoft.Fx.Portability.Tests/TargetMapTests.cs index cd6fc9353..71dde4d13 100644 --- a/tests/Microsoft.Fx.Portability.Tests/TargetMapTests.cs +++ b/tests/Microsoft.Fx.Portability.Tests/TargetMapTests.cs @@ -221,7 +221,7 @@ public void LoadXmlFromDefault() var map = new TargetMapper(); - Assert.True(map.LoadFromConfig(String.Format(@"{0}\{1}", Environment.CurrentDirectory, "TargetMap.xml"))); + Assert.True(map.LoadFromConfig(String.Format(@"{0}\{1}", Directory.GetCurrentDirectory(), "TargetMap.xml"))); Assert.Equal("target1", map.GetNames("alias1").Single()); } finally diff --git a/tests/Microsoft.Fx.Portability.Tests/project.json b/tests/Microsoft.Fx.Portability.Tests/project.json deleted file mode 100644 index cbb6da7bf..000000000 --- a/tests/Microsoft.Fx.Portability.Tests/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "dependencies": { - "MicroBuild.Core": "0.2.0", - "Newtonsoft.Json": "9.0.1", - "NSubstitute": "1.10.0", - "System.Net.Http": "4.1.0", - "xunit": "2.1.0", - "xunit.runner.visualstudio": "2.1.0" - }, - "frameworks": { - "net46": {} - }, - "runtimes": { - "win": {} - } -}