diff --git a/.gitignore b/.gitignore index b86787c..4e6ef42 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ x64/ [Bb]in/ [Oo]bj/ .dotnet/ +.tools/ # Per-user project properties launchSettings.json diff --git a/Directory.Build.props b/Directory.Build.props index 1642fe3..aa8b66f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,9 +13,5 @@ https://github.com/dotnet/symreader-converter $(RepositoryUrl) - - - true - $(RepoRoot) \ No newline at end of file diff --git a/build/SignToolData.json b/build/SignToolData.json index 6240c5f..9eca8e6 100644 --- a/build/SignToolData.json +++ b/build/SignToolData.json @@ -4,11 +4,11 @@ "certificate": "MicrosoftSHA2", "strongName": "MsSharedLib72", "values": [ - "Microsoft.DiaSymReader.Converter/netstandard1.3/Microsoft.DiaSymReader.Converter.dll", - "Microsoft.DiaSymReader.Converter/net45/Microsoft.DiaSymReader.Converter.dll", - "Microsoft.DiaSymReader.Converter.Xml/netstandard1.3/Microsoft.DiaSymReader.Converter.Xml.dll", - "Pdb2Xml/net46/Pdb2Xml.exe", - "Pdb2Pdb/net46/Pdb2Pdb.exe" + "bin/Microsoft.DiaSymReader.Converter/netstandard1.3/Microsoft.DiaSymReader.Converter.dll", + "bin/Microsoft.DiaSymReader.Converter/net45/Microsoft.DiaSymReader.Converter.dll", + "bin/Microsoft.DiaSymReader.Converter.Xml/netstandard1.3/Microsoft.DiaSymReader.Converter.Xml.dll", + "bin/Pdb2Xml/net46/Pdb2Xml.exe", + "bin/Pdb2Pdb/net46/Pdb2Pdb.exe" ] } ] diff --git a/build/Toolset.proj b/build/Toolset.proj index de35263..863e641 100644 --- a/build/Toolset.proj +++ b/build/Toolset.proj @@ -1,19 +1,9 @@  - + net462 - - $(MSBuildThisProjectDirectory)..\..\artifacts\Toolset - - - - - - - - \ No newline at end of file diff --git a/build/Versions.props b/build/Versions.props index 7535158..a0aaadb 100644 --- a/build/Versions.props +++ b/build/Versions.props @@ -4,22 +4,13 @@ 1.1.0 beta1 - - - 1.0.0-alpha14 - 1.0.0-alpha1 - 0.3.2-beta - 2.0.0-preview3-006841 - 0.2.0 - 1.0.101 - 2.0.1 - 2.1.0 - - 15.0.0-preview-20170125-04 - 2.2.0-beta4-build3444 - 2.2.0-beta4-build1194 - + false + + + 2.0.0-preview3-006770 + 1.0.0-alpha29 + 1.2.0-beta1-61723-01 1.6.0-beta2-25219 diff --git a/build/build.proj b/build/build.proj index f641870..fa02f1a 100644 --- a/build/build.proj +++ b/build/build.proj @@ -6,9 +6,11 @@ CIBuild "true" if building on CI server Restore "true" to restore toolset and solution Build "true" to build solution + Rebuild "true" to rebuild solution Test "true" to run tests Sign "true" to sign built binaries Pack "true" to build NuGet packages + Properties List of properties to pass to each build phase ("Name=Value;Name=Value;...") --> $(MSBuildThisFileDirectory)..\SymReaderConverter.sln @@ -17,9 +19,12 @@ - + + Properties="SolutionPath=$(SolutionPath);Configuration=$(Configuration);CIBuild=$(CIBuild);Restore=$(Restore);Build=$(Build);Rebuild=$(Rebuild);Test=$(Test);Sign=$(Sign);Pack=$(Pack);Properties=$(Properties)" /> \ No newline at end of file diff --git a/build/build.ps1 b/build/build.ps1 index e78d055..a331ce1 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -2,13 +2,16 @@ Param( [string] $configuration = "Debug", [string] $solution = "", - [string] $verbosity = "normal", + [string] $verbosity = "minimal", [switch] $restore, [switch] $build, + [switch] $rebuild, [switch] $test, [switch] $sign, [switch] $pack, - [switch] $ci + [switch] $ci, + [switch] $clearCaches, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) set-strictmode -version 2.0 @@ -20,7 +23,7 @@ $DotNetExe = Join-Path $DotNetRoot "dotnet.exe" $BuildProj = Join-Path $PSScriptRoot "build.proj" $DependenciesProps = Join-Path $PSScriptRoot "Versions.props" $ArtifactsDir = Join-Path $RepoRoot "artifacts" -$LogDir = Join-Path $ArtifactsDir "log" +$LogDir = Join-Path (Join-Path $ArtifactsDir $configuration) "log" $TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp" function Create-Directory([string[]] $path) { @@ -48,14 +51,15 @@ function InstallDotNetCli { } } -function Build { - $summaryLog = Join-Path $LogDir "Build.log" - $warningLog = Join-Path $LogDir "Build.wrn" - $errorLog = Join-Path $LogDir "Build.err" - - Create-Directory($logDir) +function Build { + if ($ci) { + Create-Directory($logDir) + $binlog = "/bl:" + (Join-Path $LogDir "Build.binlog") + } else { + $binlog = "" + } - & $DotNetExe msbuild $BuildProj /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci /v:$verbosity /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$summaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$warningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$errorLog + & $DotNetExe msbuild $BuildProj /m /v:$verbosity $binlog /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties if ($lastExitCode -ne 0) { throw "Build failed (exit code '$lastExitCode')." @@ -68,6 +72,12 @@ if ($ci) { $env:TMP = $TempDir } +# clean nuget packages -- necessary to avoid mismatching versions of swix microbuild build plugin and VSSDK on Jenkins +$nugetRoot = (Join-Path $env:USERPROFILE ".nuget\packages") +if ($clearCaches -and (Test-Path $nugetRoot)) { + Remove-Item $nugetRoot -Recurse -Force +} + if ($restore) { InstallDotNetCli } diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 6fb0d2f..70c3474 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -2,6 +2,4 @@ - - \ No newline at end of file diff --git a/src/Microsoft.DiaSymReader.Converter.Tests/MetadataUtilitiesTests.cs b/src/Microsoft.DiaSymReader.Converter.Tests/MetadataUtilitiesTests.cs index 26e2790..6cfa8b2 100644 --- a/src/Microsoft.DiaSymReader.Converter.Tests/MetadataUtilitiesTests.cs +++ b/src/Microsoft.DiaSymReader.Converter.Tests/MetadataUtilitiesTests.cs @@ -8,7 +8,7 @@ using Xunit; namespace Microsoft.DiaSymReader.Tools.UnitTests { - internal class MetadataUtilitiesTests + public class MetadataUtilitiesTests { [Fact] public void SerializeDynamicInfo() diff --git a/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.xunit.runner.json b/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.xunit.runner.json deleted file mode 100644 index 78c070e..0000000 --- a/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "shadowCopy": false -} \ No newline at end of file diff --git a/src/Microsoft.DiaSymReader.Converter/PdbConverterPortableToWindows.cs b/src/Microsoft.DiaSymReader.Converter/PdbConverterPortableToWindows.cs index c3a9dc0..123f8a5 100644 --- a/src/Microsoft.DiaSymReader.Converter/PdbConverterPortableToWindows.cs +++ b/src/Microsoft.DiaSymReader.Converter/PdbConverterPortableToWindows.cs @@ -600,7 +600,6 @@ namespace Microsoft.DiaSymReader.Tools } declaredExternAliases.Clear(); - aliasedAssemblyRefs.Clear(); } private static void AddExternAliases(HashSet externAliases, MetadataReader pdbReader, ImportScopeHandle importScopeHandle) @@ -734,6 +733,9 @@ namespace Microsoft.DiaSymReader.Tools case ImportDefinitionKind.AliasAssemblyNamespace: case ImportDefinitionKind.ImportAssemblyNamespace: // C# + + // The import string uses extern alias to represent an assembly reference. + // Find one that is declared within the current scope. string assemblyRefAlias = TryGetAssemblyReferenceAlias(import.TargetAssembly, declaredExternAliases, aliasedAssemblyRefs); if (assemblyRefAlias == null) { diff --git a/src/Pdb2Pdb.Tests/Pdb2Pdb.UnitTests.xunit.runner.json b/src/Pdb2Pdb.Tests/Pdb2Pdb.UnitTests.xunit.runner.json deleted file mode 100644 index 78c070e..0000000 --- a/src/Pdb2Pdb.Tests/Pdb2Pdb.UnitTests.xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "shadowCopy": false -} \ No newline at end of file