This commit is contained in:
Tomas Matousek 2017-07-24 13:38:21 -07:00
Родитель 3a8aa7a588
Коммит 7c0287b96d
12 изменённых файлов: 44 добавлений и 57 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -16,6 +16,7 @@ x64/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
.dotnet/ .dotnet/
.tools/
# Per-user project properties # Per-user project properties
launchSettings.json launchSettings.json

Просмотреть файл

@ -13,9 +13,5 @@
<RepositoryUrl>https://github.com/dotnet/symreader-converter</RepositoryUrl> <RepositoryUrl>https://github.com/dotnet/symreader-converter</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl> <PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<!-- SourceLink: Generate source link when building in microbuild. -->
<SourceLinkCreate Condition="'$(BUILD_BUILDNUMBER)' != ''">true</SourceLinkCreate>
<SourceLinkRepo>$(RepoRoot)</SourceLinkRepo>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

Просмотреть файл

@ -4,11 +4,11 @@
"certificate": "MicrosoftSHA2", "certificate": "MicrosoftSHA2",
"strongName": "MsSharedLib72", "strongName": "MsSharedLib72",
"values": [ "values": [
"Microsoft.DiaSymReader.Converter/netstandard1.3/Microsoft.DiaSymReader.Converter.dll", "bin/Microsoft.DiaSymReader.Converter/netstandard1.3/Microsoft.DiaSymReader.Converter.dll",
"Microsoft.DiaSymReader.Converter/net45/Microsoft.DiaSymReader.Converter.dll", "bin/Microsoft.DiaSymReader.Converter/net45/Microsoft.DiaSymReader.Converter.dll",
"Microsoft.DiaSymReader.Converter.Xml/netstandard1.3/Microsoft.DiaSymReader.Converter.Xml.dll", "bin/Microsoft.DiaSymReader.Converter.Xml/netstandard1.3/Microsoft.DiaSymReader.Converter.Xml.dll",
"Pdb2Xml/net46/Pdb2Xml.exe", "bin/Pdb2Xml/net46/Pdb2Xml.exe",
"Pdb2Pdb/net46/Pdb2Pdb.exe" "bin/Pdb2Pdb/net46/Pdb2Pdb.exe"
] ]
} }
] ]

Просмотреть файл

@ -1,19 +1,9 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> <!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net462</TargetFramework> <TargetFramework>net462</TargetFramework>
<!-- Output dir for restore artifacts -->
<BaseIntermediateOutputPath>$(MSBuildThisProjectDirectory)..\..\artifacts\Toolset</BaseIntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<ItemGroup> <ItemGroup>
<PackageReference Include="RoslynTools.Microsoft.RepoToolset" Version="$(RoslynToolsMicrosoftRepoToolsetVersion)" /> <PackageReference Include="RoslynTools.Microsoft.RepoToolset" Version="$(RoslynToolsMicrosoftRepoToolsetVersion)" />
<PackageReference Include="RoslynTools.Microsoft.XUnitLogger" Version="$(RoslynToolsMicrosoftXUnitLoggerVersion)" />
<PackageReference Include="RoslynTools.Microsoft.SignTool" Version="$(RoslynToolsMicrosoftSignToolVersion)" />
<PackageReference Include="MicroBuild.Core" Version="$(MicroBuildCoreVersion)" />
<PackageReference Include="MicroBuild.Core.Sentinel" Version="1.0.0" />
<PackageReference Include="Microsoft.Net.Compilers" Version="$(MicrosoftNetCompilersVersion)" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="$(SourceLinkCreateCommandLineVersion)" PrivateAssets="all" />
</ItemGroup> </ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project> </Project>

Просмотреть файл

@ -4,22 +4,13 @@
<!-- This repo version --> <!-- This repo version -->
<VersionBase>1.1.0</VersionBase> <VersionBase>1.1.0</VersionBase>
<PreReleaseVersionLabel>beta1</PreReleaseVersionLabel> <PreReleaseVersionLabel>beta1</PreReleaseVersionLabel>
<!-- Toolset -->
<RoslynToolsMicrosoftRepoToolsetVersion>1.0.0-alpha14</RoslynToolsMicrosoftRepoToolsetVersion>
<RoslynToolsMicrosoftXUnitLoggerVersion>1.0.0-alpha1</RoslynToolsMicrosoftXUnitLoggerVersion>
<RoslynToolsMicrosoftSignToolVersion>0.3.2-beta</RoslynToolsMicrosoftSignToolVersion>
<DotNetCliVersion>2.0.0-preview3-006841</DotNetCliVersion>
<MicroBuildCoreVersion>0.2.0</MicroBuildCoreVersion>
<MicroBuildPluginsSwixBuildVersion>1.0.101</MicroBuildPluginsSwixBuildVersion>
<MicrosoftNetCompilersVersion>2.0.1</MicrosoftNetCompilersVersion>
<SourceLinkCreateCommandLineVersion>2.1.0</SourceLinkCreateCommandLineVersion>
<!-- Tests --> <UsingToolXliff>false</UsingToolXliff>
<MicrosoftNETTestSdkVersion>15.0.0-preview-20170125-04</MicrosoftNETTestSdkVersion>
<XUnitVersion>2.2.0-beta4-build3444</XUnitVersion> <!-- Toolset -->
<XUnitRunnerVisualStudioVersion>2.2.0-beta4-build1194</XUnitRunnerVisualStudioVersion> <DotNetCliVersion>2.0.0-preview3-006770</DotNetCliVersion>
<RoslynToolsMicrosoftRepoToolsetVersion>1.0.0-alpha29</RoslynToolsMicrosoftRepoToolsetVersion>
<!-- libs --> <!-- libs -->
<MicrosoftDiaSymReaderVersion>1.2.0-beta1-61723-01</MicrosoftDiaSymReaderVersion> <MicrosoftDiaSymReaderVersion>1.2.0-beta1-61723-01</MicrosoftDiaSymReaderVersion>
<MicrosoftDiaSymReaderNativeVersion>1.6.0-beta2-25219</MicrosoftDiaSymReaderNativeVersion> <MicrosoftDiaSymReaderNativeVersion>1.6.0-beta2-25219</MicrosoftDiaSymReaderNativeVersion>

Просмотреть файл

@ -6,9 +6,11 @@
CIBuild "true" if building on CI server CIBuild "true" if building on CI server
Restore "true" to restore toolset and solution Restore "true" to restore toolset and solution
Build "true" to build solution Build "true" to build solution
Rebuild "true" to rebuild solution
Test "true" to run tests Test "true" to run tests
Sign "true" to sign built binaries Sign "true" to sign built binaries
Pack "true" to build NuGet packages Pack "true" to build NuGet packages
Properties List of properties to pass to each build phase ("Name=Value;Name=Value;...")
--> -->
<PropertyGroup> <PropertyGroup>
<SolutionPath Condition="'$(SolutionPath)' == ''">$(MSBuildThisFileDirectory)..\SymReaderConverter.sln</SolutionPath> <SolutionPath Condition="'$(SolutionPath)' == ''">$(MSBuildThisFileDirectory)..\SymReaderConverter.sln</SolutionPath>
@ -17,9 +19,12 @@
<Import Project="..\Directory.build.props"/> <Import Project="..\Directory.build.props"/>
<Target Name="Build"> <Target Name="Build">
<MSBuild Projects="Toolset.proj" Targets="Restore" Condition="'$(Restore)' == 'true'"/> <MSBuild Projects="Toolset.proj"
Targets="Restore"
Properties="BaseIntermediateOutputPath=$(MSBuildThisFileDirectory)..\artifacts\toolset\;ExcludeRestorePackageImports=true;DeployDeps=$(DeployDeps)"
Condition="'$(Restore)' == 'true'"/>
<MSBuild Projects="$(RepoToolsetDir)Build.proj" <MSBuild Projects="$(RepoToolsetDir)Build.proj"
Properties="SolutionPath=$(SolutionPath);Configuration=$(Configuration);CIBuild=$(CIBuild);Restore=$(Restore);Build=$(Build);Test=$(Test);Sign=$(Sign);Pack=$(Pack)" /> Properties="SolutionPath=$(SolutionPath);Configuration=$(Configuration);CIBuild=$(CIBuild);Restore=$(Restore);Build=$(Build);Rebuild=$(Rebuild);Test=$(Test);Sign=$(Sign);Pack=$(Pack);Properties=$(Properties)" />
</Target> </Target>
</Project> </Project>

Просмотреть файл

@ -2,13 +2,16 @@
Param( Param(
[string] $configuration = "Debug", [string] $configuration = "Debug",
[string] $solution = "", [string] $solution = "",
[string] $verbosity = "normal", [string] $verbosity = "minimal",
[switch] $restore, [switch] $restore,
[switch] $build, [switch] $build,
[switch] $rebuild,
[switch] $test, [switch] $test,
[switch] $sign, [switch] $sign,
[switch] $pack, [switch] $pack,
[switch] $ci [switch] $ci,
[switch] $clearCaches,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
) )
set-strictmode -version 2.0 set-strictmode -version 2.0
@ -20,7 +23,7 @@ $DotNetExe = Join-Path $DotNetRoot "dotnet.exe"
$BuildProj = Join-Path $PSScriptRoot "build.proj" $BuildProj = Join-Path $PSScriptRoot "build.proj"
$DependenciesProps = Join-Path $PSScriptRoot "Versions.props" $DependenciesProps = Join-Path $PSScriptRoot "Versions.props"
$ArtifactsDir = Join-Path $RepoRoot "artifacts" $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" $TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp"
function Create-Directory([string[]] $path) { function Create-Directory([string[]] $path) {
@ -48,14 +51,15 @@ function InstallDotNetCli {
} }
} }
function Build { function Build {
$summaryLog = Join-Path $LogDir "Build.log" if ($ci) {
$warningLog = Join-Path $LogDir "Build.wrn" Create-Directory($logDir)
$errorLog = Join-Path $LogDir "Build.err" $binlog = "/bl:" + (Join-Path $LogDir "Build.binlog")
} else {
Create-Directory($logDir) $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) { if ($lastExitCode -ne 0) {
throw "Build failed (exit code '$lastExitCode')." throw "Build failed (exit code '$lastExitCode')."
@ -68,6 +72,12 @@ if ($ci) {
$env:TMP = $TempDir $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) { if ($restore) {
InstallDotNetCli InstallDotNetCli
} }

Просмотреть файл

@ -2,6 +2,4 @@
<Project> <Project>
<!-- This file is imported by all projects at the end of the project files --> <!-- This file is imported by all projects at the end of the project files -->
<Import Project="$(RepoToolsetDir)Imports.targets" /> <Import Project="$(RepoToolsetDir)Imports.targets" />
<!-- Source link -->
<Import Project="$(NuGetPackageRoot)SourceLink.Create.CommandLine\$(SourceLinkCreateCommandLineVersion)\build\SourceLink.Create.CommandLine.targets" />
</Project> </Project>

Просмотреть файл

@ -8,7 +8,7 @@ using Xunit;
namespace Microsoft.DiaSymReader.Tools.UnitTests namespace Microsoft.DiaSymReader.Tools.UnitTests
{ {
internal class MetadataUtilitiesTests public class MetadataUtilitiesTests
{ {
[Fact] [Fact]
public void SerializeDynamicInfo() public void SerializeDynamicInfo()

Просмотреть файл

@ -1,3 +0,0 @@
{
"shadowCopy": false
}

Просмотреть файл

@ -600,7 +600,6 @@ namespace Microsoft.DiaSymReader.Tools
} }
declaredExternAliases.Clear(); declaredExternAliases.Clear();
aliasedAssemblyRefs.Clear();
} }
private static void AddExternAliases(HashSet<string> externAliases, MetadataReader pdbReader, ImportScopeHandle importScopeHandle) private static void AddExternAliases(HashSet<string> externAliases, MetadataReader pdbReader, ImportScopeHandle importScopeHandle)
@ -734,6 +733,9 @@ namespace Microsoft.DiaSymReader.Tools
case ImportDefinitionKind.AliasAssemblyNamespace: case ImportDefinitionKind.AliasAssemblyNamespace:
case ImportDefinitionKind.ImportAssemblyNamespace: case ImportDefinitionKind.ImportAssemblyNamespace:
// C# // 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); string assemblyRefAlias = TryGetAssemblyReferenceAlias(import.TargetAssembly, declaredExternAliases, aliasedAssemblyRefs);
if (assemblyRefAlias == null) if (assemblyRefAlias == null)
{ {

Просмотреть файл

@ -1,3 +0,0 @@
{
"shadowCopy": false
}