未验证 提交 3dcdf6d2 编写于 作者: T Tomáš Matoušek 提交者: GitHub

Merge pull request #22850 from tmat/PortablePDB

Build with Portable PDBs
......@@ -7,10 +7,10 @@
<ItemGroup>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyCompanyAttribute">
<_Parameter1>Microsoft Corporation</_Parameter1>
<_Parameter1>$(Company)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyCopyrightAttribute">
<_Parameter1>© Microsoft Corporation. All rights reserved.</_Parameter1>
<_Parameter1>$(Copyright)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyVersionAttribute">
<_Parameter1>$(AssemblyVersion)</_Parameter1>
......@@ -19,7 +19,7 @@
<_Parameter1>$(BuildVersion)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
<_Parameter1>$(NuGetPerBuildPreReleaseVersion). Commit Hash: $(GitHeadSha)</_Parameter1>
<_Parameter1>$(InformationalVersion)</_Parameter1>
</AssemblyVersionAttribute>
</ItemGroup>
......
......@@ -523,4 +523,30 @@
</ItemGroup>
</Target>
<!--
Prepare inputs for Symbol Store publishing.
The imported targets populate ArtifactsSymStoreDirectory with links to binaries and Windows PDBs produced either
directly by the build or converted from Portable PDBs produced by the build.
In official build the content of ArtifactsSymStoreDirectory is uploaded to a symbol server.
-->
<PropertyGroup>
<UsingToolPdbConverter>true</UsingToolPdbConverter>
<PublishOutputToSymStore Condition="'$(Nonshipping)' == 'true'">false</PublishOutputToSymStore>
<ArtifactsSymStoreDirectory Condition="'$(DeveloperBuild)' != 'true' and '$(OS)' == 'Windows_NT'">$(BaseOutputPath)$(Configuration)\SymStore\</ArtifactsSymStoreDirectory>
</PropertyGroup>
<Import Project="RepoToolset\SymStore.targets" />
<Import Project="RepoToolset\SourceLink.targets" Condition="'$(EnableSourceLink)' == 'true' and '$(GitHeadSha)' != ''"/>
<PropertyGroup>
<PathMap Condition="'$(DeterministicSourceRoot)' != ''">$(RepoRoot)=$(DeterministicSourceRoot)</PathMap>
</PropertyGroup>
<Target Name="_CheckForSpacesInPathMap"
BeforeTargets="CoreCompile">
<Error Text="PathMap, DeterministicSourceRoot and RepoRoot shall not contain spaces (https://github.com/dotnet/roslyn/issues/22835)"
Condition="$(PathMap.Contains(' '))" />
</Target>
</Project>
......@@ -9,7 +9,6 @@
<EnvDTE80Version>8.0.0</EnvDTE80Version>
<dotnetxunitVersion>2.3.0-beta4-build3742</dotnetxunitVersion>
<FakeSignVersion>0.9.2</FakeSignVersion>
<GitLinkVersion>3.0.0</GitLinkVersion>
<HumanizerCoreVersion>2.2.0</HumanizerCoreVersion>
<LibGit2SharpVersion>0.22.0</LibGit2SharpVersion>
<MicroBuildCoreVersion>0.2.0</MicroBuildCoreVersion>
......@@ -109,7 +108,7 @@
<MicrosoftVisualStudioShellInterop121DesignTimeVersion>12.1.30328</MicrosoftVisualStudioShellInterop121DesignTimeVersion>
<MicrosoftVisualStudioShellInterop140DesignTimeVersion>14.3.25407</MicrosoftVisualStudioShellInterop140DesignTimeVersion>
<MicrosoftVisualStudioShellInterop150DesignTimeVersion>15.0.26606-alpha</MicrosoftVisualStudioShellInterop150DesignTimeVersion>
<MicrosoftVisualStudioShellInterop153DesignTimeVersion>15.0.26606</MicrosoftVisualStudioShellInterop153DesignTimeVersion>
<MicrosoftVisualStudioShellInterop153DesignTimeVersion>15.0.26606</MicrosoftVisualStudioShellInterop153DesignTimeVersion>
<MicrosoftVisualStudioShellInterop80Version>8.0.50727</MicrosoftVisualStudioShellInterop80Version>
<MicrosoftVisualStudioShellInterop90Version>9.0.30729</MicrosoftVisualStudioShellInterop90Version>
<MicrosoftVisualStudioTelemetryVersion>15.0.26606-alpha</MicrosoftVisualStudioTelemetryVersion>
......@@ -139,6 +138,7 @@
<NuGetVisualStudioVersion>4.0.0-rc-2048</NuGetVisualStudioVersion>
<NuSpecReferenceGeneratorVersion>1.4.2</NuSpecReferenceGeneratorVersion>
<OctokitVersion>0.23.0</OctokitVersion>
<Pdb2PdbVersion>1.1.0-beta1-62106-03</Pdb2PdbVersion>
<RestSharpVersion>105.2.3</RestSharpVersion>
<RoslynBuildUtilVersion>0.9.8-beta</RoslynBuildUtilVersion>
<RoslynDependenciesMicrosoftVisualStudioWorkspaceVersion>14.0.983-pre-ge167e81694</RoslynDependenciesMicrosoftVisualStudioWorkspaceVersion>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!--
Copied from RepoToolset. Might be slightly modified to adjust for the current Roslyn build system specifics if necessary.
Limit Roslyn specific changes to minumum.
If a fix not specific to Roslyn is needed create a PR against https://github.com/dotnet/roslyn-tools repo updating the toolset.
Update this file only if the change to RepoToolset gets approved and merged.
-->
<Project>
<!--
Requires the following properties to be set:
RepoRoot
Defines the following properties:
GitHeadSha
-->
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<Choose>
<When Condition="'$(BUILD_SOURCEVERSION)' != ''">
<PropertyGroup>
<GitHeadSha>$(BUILD_SOURCEVERSION)</GitHeadSha>
</PropertyGroup>
</When>
<When Condition="'$(BUILD_SOURCEVERSION)' == '' and '$(GIT_COMMIT)' != ''">
<PropertyGroup>
<GitHeadSha>$(GIT_COMMIT)</GitHeadSha>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<GitHeadSha></GitHeadSha>
<_DotGitDir>$(RepoRoot).git</_DotGitDir>
<_HeadFileContent Condition="Exists('$(_DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(_DotGitDir)/HEAD').Trim())</_HeadFileContent>
<_RefPath Condition="$(_HeadFileContent.StartsWith('ref: '))">$(_DotGitDir)/$(_HeadFileContent.Substring(5))</_RefPath>
<GitHeadSha Condition="'$(_RefPath)' != '' and Exists('$(_RefPath)')">$([System.IO.File]::ReadAllText('$(_RefPath)').Trim())</GitHeadSha>
<GitHeadSha Condition="'$(_HeadFileContent)' != '' and '$(_RefPath)' == ''">$(_HeadFileContent)</GitHeadSha>
</PropertyGroup>
</Otherwise>
</Choose>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!--
Copied from RepoToolset. Might be slightly modified to adjust for the current Roslyn build system specifics if necessary.
Limit Roslyn specific changes to minumum.
If a fix not specific to Roslyn is needed create a PR against https://github.com/dotnet/roslyn-tools repo updating the toolset.
Update this file only if the change to RepoToolset gets approved and merged.
-->
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<SourceLink>$(IntermediateOutputPath)$(MSBuildProjectName).sourcelink.json</SourceLink>
<!-- Override SourceLinkRoot if DeterministicSourceRoot is set, otherwise use RepoRoot as a default value -->
<SourceLinkRoot Condition="'$(DeterministicSourceRoot)' != ''">$(DeterministicSourceRoot)</SourceLinkRoot>
<SourceLinkRoot Condition="'$(SourceLinkRoot)' == ''">$(RepoRoot)</SourceLinkRoot>
</PropertyGroup>
<Target Name="GenerateSourceLinkFile"
Outputs="$(SourceLink)"
DependsOnTargets="PrepareForBuild"
BeforeTargets="CoreCompile">
<Error Text="GitHeadSha has invalid value: '$(GitHeadSha)'" Condition="'$(GitHeadSha.Length)' != '40'" />
<Error Text="SourceLinkRoot must end with a slash or backslash: '$(SourceLinkRoot)'" Condition="!HasTrailingSlash('$(SourceLinkRoot)')"/>
<PropertyGroup>
<_EscapedSourceLinkRoot>$(SourceLinkRoot.Replace('\', '\\').Replace('"', '\"'))</_EscapedSourceLinkRoot>
<_EscapedUrl>$(RepositoryRawUrl)</_EscapedUrl>
<_EscapedUrl Condition="'$(_EscapedUrl)' == '' and $(RepositoryUrl.StartsWith('https://github.com/'))">https://raw.githubusercontent.com/$(RepositoryUrl.SubString(19))</_EscapedUrl>
<_EscapedUrl Condition="'$(_EscapedUrl)' == '' and $(RepositoryUrl.StartsWith('http://github.com/'))">https://raw.githubusercontent.com/$(RepositoryUrl.SubString(18))</_EscapedUrl>
<_EscapedUrl>$(_EscapedUrl.TrimEnd('/').Replace('\', '\\').Replace('"', '\"'))</_EscapedUrl>
</PropertyGroup>
<Error Text="RepositoryRawUrl is empty and RepositoryUrl is not a well-known public repository URL: '$(RepositoryUrl)'"
Condition="'$(_EscapedUrl)' == ''" />
<WriteLinesToFile
File="$(SourceLink)"
Lines='{"documents":{"$(_EscapedSourceLinkRoot)*":"$(_EscapedUrl)/$(GitHeadSha)/*"}}'
Overwrite="true">
</WriteLinesToFile>
<ItemGroup>
<FileWrites Include="$(SourceLink)" />
</ItemGroup>
</Target>
</Project>
\ No newline at end of file
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!--
Copied from RepoToolset. Might be slightly modified to adjust for the current Roslyn build system specifics if necessary.
Limit Roslyn specific changes to minumum.
If a fix not specific to Roslyn is needed create a PR against https://github.com/dotnet/roslyn-tools repo updating the toolset.
Update this file only if the change to RepoToolset gets approved and merged.
-->
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<_DeployToSymStoreTargetName Condition="'$(TargetFrameworks)' == ''">_InnerDeployToSymStore</_DeployToSymStoreTargetName>
<_DeployToSymStoreTargetName Condition="'$(TargetFrameworks)' != ''">_OuterDeployToSymStore</_DeployToSymStoreTargetName>
</PropertyGroup>
<!-- Note: The DeployToSymStore target definition differs from the original implementation in RepoToolset. -->
<Target Name="DeployToSymStore" DependsOnTargets="$(_DeployToSymStoreTargetName)" Condition="'$(ArtifactsSymStoreDirectory)' != ''" />
<Target Name="_OuterDeployToSymStore">
<ItemGroup>
<_TargetFramework Include="$(TargetFrameworks)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)"
Condition="'$(TargetFrameworks)' != ''"
Targets="_InnerDeployToSymStore"
Properties="TargetFramework=%(_TargetFramework.Identity)">
</MSBuild>
</Target>
<Target Name="_InnerDeployToSymStore">
<PropertyGroup>
<_TargetPdbPath />
<_TargetPdbPath Condition="'$(DebugType)' != 'embedded'">$([System.IO.Path]::ChangeExtension($(TargetPath), '.pdb'))</_TargetPdbPath>
<_SymStoreOutputDir>$(ArtifactsSymStoreDirectory)$(MSBuildProjectName)\$(TargetFramework)\</_SymStoreOutputDir>
<_SymStorePdbPath>$(_SymStoreOutputDir)$(TargetName).pdb</_SymStorePdbPath>
<_SymStoreAssemblyPath>$(_SymStoreOutputDir)$(TargetName)$(TargetExt)</_SymStoreAssemblyPath>
<PublishOutputToSymStore Condition="'$(PublishOutputToSymStore)' == '' and Exists('$(TargetPath)') and ('$(DebugType)' == 'embedded' or Exists('$(_TargetPdbPath)'))">true</PublishOutputToSymStore>
</PropertyGroup>
</Target>
<!--
Convert Portable and Embedded PDBs.
We publish converted PDBs to Symbol Store so that WinDBG can find them when debugging crash dumps.
Convert source link to srcsvr so that both WinDBG and VS can open the source files.
-->
<Target Name="_DeployPortableSymbolsToSymStore"
AfterTargets="_InnerDeployToSymStore"
Inputs="$(TargetPath);$(_TargetPdbPath)"
Outputs="$(_SymStorePdbPath)"
Condition="'$(PublishOutputToSymStore)' == 'true' and ('$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded')">
<PropertyGroup>
<_PdbConverterPath>$(NuGetPackageRoot)pdb2pdb\$(Pdb2PdbVersion)\tools\Pdb2Pdb.exe</_PdbConverterPath>
<_PdbConverterCommandLineArgs>"$(TargetPath)" /out "$(_SymStorePdbPath)" /verbose</_PdbConverterCommandLineArgs>
</PropertyGroup>
<Error Text="Attempt to publish Portable PDB to SymStore without conversion: UsingToolPdbConverter property is false in project $(MSBuildProjectName)"
Condition="'$(UsingToolPdbConverter)' != 'true'"
ContinueOnError="false"/>
<MakeDir Directories="$(_SymStoreOutputDir)"/>
<Exec Command='"$(_PdbConverterPath)" $(_PdbConverterCommandLineArgs)' IgnoreExitCode="false" />
<ItemGroup>
<FileWrites Include="$(_SymStorePdbPath)"/>
</ItemGroup>
</Target>
<!--
The current MicroBuild symbol indexing task doesn't support specifying list of files to index.
Therefore we create hardlinks to the files in output directory, where DLLs and EXEs are signed.
These targets are executed after the signing phase so that we publish signed binaries to the
symbol store even if the files are copies and not hardlinked.
-->
<Target Name="_DeployWindowsSymbolsToSymStore"
AfterTargets="_InnerDeployToSymStore"
Condition="'$(PublishOutputToSymStore)' == 'true' and ('$(DebugType)' == 'full' or '$(DebugType)' == 'pdbonly')"
Inputs="$(_TargetPdbPath)"
Outputs="$(_SymStorePdbPath)">
<MakeDir Directories="$(_SymStoreOutputDir)"/>
<Copy SourceFiles="$(_TargetPdbPath)"
DestinationFiles="$(_SymStorePdbPath)"
UseHardlinksIfPossible="true"/>
<ItemGroup>
<FileWrites Include="$(_SymStorePdbPath)"/>
</ItemGroup>
</Target>
<Target Name="_DeployAssembliesToSymStore"
AfterTargets="_InnerDeployToSymStore"
Condition="'$(PublishOutputToSymStore)' == 'true'"
Inputs="$(TargetPath)"
Outputs="$(_SymStoreAssemblyPath)">
<MakeDir Directories="$(_SymStoreOutputDir)"/>
<Copy SourceFiles="$(TargetPath)"
DestinationFiles="$(_SymStoreAssemblyPath)"
UseHardlinksIfPossible="true"/>
<ItemGroup>
<FileWrites Include="$(_SymStoreAssemblyPath)"/>
</ItemGroup>
</Target>
</Project>
\ No newline at end of file
......@@ -2,14 +2,26 @@
<!-- 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 ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRoot>
<RepositoryUrl>https://github.com/dotnet/roslyn</RepositoryUrl>
</PropertyGroup>
<Import Project="Packages.props" />
<Import Project="FixedPackages.props" />
<Import Project="Versions.props" />
<PropertyGroup>
<Company>Microsoft Corporation</Company>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<Authors>Microsoft</Authors>
<JenkinsBuild>false</JenkinsBuild>
<JenkinsBuild Condition="'$(JENKINS_HOME)' != ''">true</JenkinsBuild>
<DeveloperBuild>false</DeveloperBuild>
<DeveloperBuild Condition="'$(OfficialBuild)' != 'true' AND '$(JenkinsBuild)' != 'true'">true</DeveloperBuild>
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRoot>
<ArtifactsSymStoreDirectory Condition="'$(DeveloperBuild)' != 'true' and '$(OS)' == 'Windows_NT'">$(BaseOutputPath)$(Configuration)\SymStore\</ArtifactsSymStoreDirectory>
<NuGetToolPath>$(RepoRoot)nuget.exe</NuGetToolPath>
<!-- Disable the implicit nuget fallback folder as it makes it hard to locate and copy ref assemblies to the test output folder -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
......@@ -24,6 +36,7 @@
<RoslynPortableTargetFrameworks46>net46;netcoreapp2.0</RoslynPortableTargetFrameworks46>
<RoslynPortableRuntimeIdentifiers>win7;win7-x64</RoslynPortableRuntimeIdentifiers>
<UsingToolPdbConverter>true</UsingToolPdbConverter>
<Features>strict, IOperation</Features>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
......@@ -92,12 +105,42 @@
<!-- https://github.com/dotnet/roslyn/issues/21272 -->
<GenerateResourceMSBuildRuntime Condition="'$(TargetFramework)' == 'netcoreapp2.0'">CurrentRuntime</GenerateResourceMSBuildRuntime>
<!--
Official build:
- Build standalone Portable PDBs to reduce the size of the binaries.
- Convert Portable PDBs to Windows PDBs and publish the converted PDBs to Symbol Store to allow WinDBG,
Watson and other tools to find symbol format they understand.
Jenkins build:
- Embed PDBs to make it easier to debug Jenkins crash dumps.
Developer build:
- Embed PDBs to be consistent with Jenkins builds.
-->
<RoslynDebugType Condition="'$(OfficialBuild)' == 'true'">portable</RoslynDebugType>
<RoslynDebugType Condition="'$(OfficialBuild)' != 'true'">embedded</RoslynDebugType>
<!--
The source root path used for deterministic normalization of source paths.
If set the value is used in PathMap to instruct the compiler to normalize source paths
emitted to the binary and PDB and as a root for Source Link mapping.
If set must end with a directory separator.
If unset the PathMap need to be set explicitly to facilitate full determinism.
The path can't be just a single '/' due to bug in Roslyn compilers:
https://github.com/dotnet/roslyn/issues/22815
-->
<DeterministicSourceRoot Condition="'$(DeveloperBuild)' != 'true'">/_/</DeterministicSourceRoot>
<EnableSourceLink Condition="'$(DeveloperBuild)' != 'true'">true</EnableSourceLink>
</PropertyGroup>
<!-- Windows specific settings -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<BaseNuGetRuntimeIdentifier>win7</BaseNuGetRuntimeIdentifier>
<RoslynDebugType>full</RoslynDebugType>
<UseSharedCompilation>true</UseSharedCompilation>
<!-- Presently our code can build on machines with Dev14 or Dev15 but only successfully deploy
......@@ -113,8 +156,6 @@
<!-- Unix specific settings -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<RoslynDebugType>portable</RoslynDebugType>
<!-- Presently can't build anything with a net46 TargetFramework on non-Windows. Disabling
for now.
......
......@@ -2,11 +2,10 @@
<!-- 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 ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="RepoToolset\GitHash.props" />
<!-- This controls the version numbers of the build that we are producing -->
<Import Project="Packages.props" />
<Import Project="FixedPackages.props" />
<PropertyGroup>
<!-- This is the assembly version of Roslyn from the .NET assembly perspective. It should only be revved during significant point releases. -->
<RoslynAssemblyVersionBase Condition="'$(RoslynAssemblyVersion)' == ''">2.6.0</RoslynAssemblyVersionBase>
......@@ -76,35 +75,14 @@
</Otherwise>
</Choose>
<Choose>
<When Condition="'$(OfficialBuild)' != 'true'">
<!-- On non-official builds we don't burn in a git sha. In large part because it
hurts our determinism efforts as binaries which should be the same between
builds will not (due to developers building against different HEAD
values). -->
<PropertyGroup>
<GitHeadSha>&lt;developer build&gt;</GitHeadSha>
</PropertyGroup>
</When>
<When Condition="'$(BUILD_SOURCEVERSION)' != ''">
<PropertyGroup>
<GitHeadSha>$(BUILD_SOURCEVERSION)</GitHeadSha>
</PropertyGroup>
</When>
<When Condition="'$(BUILD_SOURCEVERSION)' == '' AND '$(GIT_COMMIT)' != ''">
<PropertyGroup>
<GitHeadSha>$(GIT_COMMIT)</GitHeadSha>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<GitHeadSha>Not found</GitHeadSha>
<DotGitDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../../.git'))</DotGitDir>
<HeadFileContent Condition="Exists('$(DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(DotGitDir)/HEAD').Trim())</HeadFileContent>
<RefPath Condition="$(HeadFileContent.StartsWith('ref: '))">$(DotGitDir)/$(HeadFileContent.Substring(5))</RefPath>
<GitHeadSha Condition="'$(RefPath)' != '' AND Exists('$(RefPath)')">$([System.IO.File]::ReadAllText('$(RefPath)').Trim())</GitHeadSha>
<GitHeadSha Condition="'$(HeadFileContent)' != '' AND '$(RefPath)' == ''">$(HeadFileContent)</GitHeadSha>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<!-- On non-official builds we don't burn in a git sha. In large part because it
hurts our determinism efforts as binaries which should be the same between
builds will not (due to developers building against different HEAD
values). -->
<CommitHashDisplay>&lt;developer build&gt;</CommitHashDisplay>
<CommitHashDisplay Condition="'$(OfficialBuild)' == 'true'">$(GitHeadSha)</CommitHashDisplay>
<InformationalVersion>$(NuGetPerBuildPreReleaseVersion). Commit Hash: $(CommitHashDisplay)</InformationalVersion>
</PropertyGroup>
</Project>
......@@ -10,6 +10,7 @@
<TargetFramework>net46</TargetFramework>
<RuntimeIdentifiers>win7;ubuntu.14.04;osx.10.10</RuntimeIdentifiers>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -25,8 +25,8 @@
<PackageReference Include="RoslynTools.Microsoft.SignTool" Version="$(RoslynToolsMicrosoftSignToolVersion)" />
<PackageReference Include="RoslynTools.Microsoft.VSIXExpInstaller" Version="$(RoslynToolsMicrosoftVSIXExpInstallerVersion)" />
<PackageReference Include="RoslynTools.ReferenceAssemblies" Version="$(RoslynToolsReferenceAssembliesVersion)" />
<PackageReference Include="GitLink" Version="$(GitLinkVersion)" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="$(MicrosoftVSSDKBuildToolsVersion)" />
<PackageReference Include="xunit.runner.wpf" Version="$(xunitrunnerwpfVersion)" />
<PackageReference Include="pdb2pdb" Version="$(Pdb2PdbVersion)" />
</ItemGroup>
</Project>
......@@ -129,10 +129,6 @@ function Run-MSBuild([string]$buildArgs = "", [string]$logFile = "", [switch]$pa
$args += " /bl:$logFile"
}
if ($cibuild) {
$args += " /p:PathMap=`"$($repoDir)=q:\roslyn`" /p:Feature=pdb-path-determinism"
}
if ($official) {
$args += " /p:OfficialBuild=true"
}
......@@ -222,6 +218,10 @@ function Build-NuGetPackages() {
Run-MSBuild $build
}
function Build-DeployToSymStore() {
Run-MSBuild "Roslyn.sln /t:DeployToSymStore"
}
# These are tests that don't follow our standard restore, build, test pattern. They customize
# the processes in order to test specific elements of our build and hence are handled
# separately from our other tests
......@@ -548,7 +548,7 @@ try {
$msbuild, $msbuildDir = Ensure-MSBuildAndDir -msbuildDir $msbuildDir
$dotnet, $sdkDir = Ensure-SdkInPathAndData
$buildConfiguration = if ($release) { "Release" } else { "Debug" }
$configDir = Join-Path $binariesDIr $buildConfiguration
$configDir = Join-Path $binariesDir $buildConfiguration
$bootstrapDir = ""
# Ensure the main output directories exist as a number of tools will fail when they don't exist.
......@@ -587,6 +587,10 @@ try {
# VSIX, NuGet doesn't support re-packing hence we have to order it this way.
if ($pack) {
Build-NuGetPackages
if ($cibuild -or $official) {
Build-DeployToSymStore
}
}
if ($testDesktop -or $testCoreClr -or $testVsi -or $testVsiNetCore) {
......
......@@ -16,7 +16,7 @@ $script:skipList = @()
[string]$script:errorDirLeft = ""
[string]$script:errorDirRight = ""
function Run-Build([string]$rootDir, [string]$pathMapBuildOption, [switch]$restore = $false, [string]$logFile = $null) {
function Run-Build([string]$rootDir, [switch]$restore = $false, [string]$logFile = $null) {
Push-Location $rootDir
try {
......@@ -29,7 +29,7 @@ function Run-Build([string]$rootDir, [string]$pathMapBuildOption, [switch]$resto
Restore-Project -fileName "Roslyn.sln" -nuget (Ensure-NuGet) -msbuildDir (Split-Path -parent $msbuild)
}
$args = "/nologo /v:m /nodeReuse:false /m /p:DebugDeterminism=true /p:BootstrapBuildPath=$script:bootstrapDir /p:Features=`"debug-determinism`" /p:UseRoslynAnalyzers=false $pathMapBuildOption Roslyn.sln"
$args = "/nologo /v:m /nodeReuse:false /m /p:DebugDeterminism=true /p:BootstrapBuildPath=$script:bootstrapDir /p:Features=`"debug-determinism`" /p:UseRoslynAnalyzers=false Roslyn.sln"
if ($logFile -ne $null) {
$logFile = Join-Path $binariesDir $logFile
$args += " /bl:$logFile"
......@@ -117,8 +117,8 @@ function Test-MapContents($dataMap) {
}
}
function Test-Build([string]$rootDir, $dataMap, [string]$pathMapBuildOption, [string]$logFile, [switch]$restore = $false) {
Run-Build $rootDir $pathMapBuildOption -logFile $logFile -restore:$restore
function Test-Build([string]$rootDir, $dataMap, [string]$logFile, [switch]$restore = $false) {
Run-Build $rootDir -logFile $logFile -restore:$restore
$errorList = @()
$allGood = $true
......@@ -191,8 +191,7 @@ function Run-Test() {
$altRootDir = Join-Path "$repoDir\Binaries" "q"
Remove-Item -re -fo $altRootDir -ErrorAction SilentlyContinue
& robocopy $repoDir $altRootDir /E /XD $binariesDir /XD ".git" /njh /njs /ndl /nc /ns /np /nfl
$pathMapBuildOption = "/p:PathMap=`"$altRootDir=$repoDir`""
Test-Build -rootDir $altRootDir -dataMap $dataMap -pathMapBuildOption $pathMapBuildOption -logFile "test2.binlog" -restore
Test-Build -rootDir $altRootDir -dataMap $dataMap -logFile "test2.binlog" -restore
}
try {
......
......@@ -9,6 +9,15 @@ Using the command line Roslyn can be developed using the following pattern:
1. Run Build.cmd
1. Run Test.cmd
## Recommended version of .NET Framework
The minimal required version of .NET Framework is 4.6, however 4.7.1 is recommended for best developer experience.
The projects in this repository are configured to build with Portable PDBs, which are supported in stack traces starting with .NET Framework 4.7.1.
If a stack trace is displayed on .NET Framework older than 4.7.1 (e.g. by xUnit when a test fails) it won't contain source and line information.
.NET Framework 4.7.1 is included in Windows 10 Fall Creators Update. It can also be installed from the [Microsoft Download Center](https://support.microsoft.com/en-us/help/4033344/the-net-framework-4-7-1-web-installer-for-windows).
## Developing with Visual Studio 2017
1. [Visual Studio 2017 Update 3](https://www.visualstudio.com/vs/)
......
......@@ -23,7 +23,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<AssemblyVersionAttribute Include="Microsoft.CodeAnalysis.CommitHashAttribute">
<_Parameter1>$(GitHeadSha)</_Parameter1>
<_Parameter1>$(CommitHashDisplay)</_Parameter1>
</AssemblyVersionAttribute>
</ItemGroup>
<ItemGroup Label="Project References">
......
......@@ -20,7 +20,7 @@
</PropertyGroup>
<ItemGroup>
<AssemblyVersionAttribute Include="Microsoft.CodeAnalysis.CommitHashAttribute">
<_Parameter1>$(GitHeadSha)</_Parameter1>
<_Parameter1>$(CommitHashDisplay)</_Parameter1>
</AssemblyVersionAttribute>
</ItemGroup>
<ItemGroup Label="Project References">
......
......@@ -17,6 +17,7 @@
<CreateVsixContainer>True</CreateVsixContainer>
<DeployExtension>False</DeployExtension>
<RoslynProjectType>Vsix</RoslynProjectType>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -85,7 +85,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToTest Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.CommandLine.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.Emit.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Compilers.CSharp.EnC.UnitTests" />
......
......@@ -5,13 +5,13 @@
<Target Name="Build">
<!-- NuGetPerBuildPreReleaseVersion -->
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetPerBuildPreReleaseVersion) $(OutputPath)NuGet\PerBuildPreRelease &quot;$(GitHeadSha)&quot;" Condition="'$(SkipBuildPreReleaseVersion)' != 'true'" />
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetPerBuildPreReleaseVersion) $(OutputPath)NuGet\PerBuildPreRelease &quot;$(CommitHashDisplay)&quot;" Condition="'$(SkipBuildPreReleaseVersion)' != 'true'" />
<!-- NuGetPreReleaseVersion -->
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetPreReleaseVersion) $(OutputPath)NuGet\PreRelease &quot;$(GitHeadSha)&quot;" Condition="'$(SkipPreReleaseVersion)' != 'true'" />
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetPreReleaseVersion) $(OutputPath)NuGet\PreRelease &quot;$(CommitHashDisplay)&quot;" Condition="'$(SkipPreReleaseVersion)' != 'true'" />
<!-- NuGetReleaseVersion -->
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetReleaseVersion) $(OutputPath)NuGet\Release &quot;$(GitHeadSha)&quot;" Condition="'$(SkipReleaseVersion)' != 'true'" />
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetReleaseVersion) $(OutputPath)NuGet\Release &quot;$(CommitHashDisplay)&quot;" Condition="'$(SkipReleaseVersion)' != 'true'" />
</Target>
<Target Name="Clean">
......
......@@ -12,6 +12,7 @@
<RuntimeIdentifiers>win7;ubuntu.14.04;osx.10.10</RuntimeIdentifiers>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<SignAssembly>false</SignAssembly>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -8,6 +8,7 @@
<TargetFramework>net46</TargetFramework>
<RuntimeIdentifiers>win7</RuntimeIdentifiers>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -9,6 +9,7 @@
<RootNamespace>Roslyn.Test.Performance.Utilities</RootNamespace>
<AssemblyName>Roslyn.Test.Performance.Utilities</AssemblyName>
<TargetFramework>net46</TargetFramework>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -9,6 +9,7 @@
<TargetFramework>net46</TargetFramework>
<RuntimeIdentifiers>win7</RuntimeIdentifiers>
<UseVSHostingProcess>false</UseVSHostingProcess>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -132,7 +132,6 @@ try {
Exec-Block { & (Join-Path $scriptDir "build.ps1") -restore:$restore -buildAll -official:$official -msbuildDir $msbuildDir -release:$release -sign -pack -testDesktop:$testDesktop }
Exec-Block { & (Join-Path $PSScriptRoot "run-gitlink.ps1") -config $config }
Build-InsertionItems
Exec-Block { & (Join-Path $scriptDir "check-toolset-insertion.ps1") -sourcePath $repoDir -binariesPath $configDir }
......
# Run GitLink on the binaries that we are producing.
param([string]$config = "Release")
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
try {
. (Join-Path $PSScriptRoot "..\..\..\build\scripts\build-utils.ps1")
$configDir = Join-Path $binariesDir $config
$gitlinkVersion = Get-PackageVersion "GitLink"
$gitlink = Join-Path (Get-PackagesDir) "GitLink\$gitlinkVersion\build\GitLink.exe"
Write-Host "Running GitLink"
$config = Join-Path $repoDir "build\config\SignToolData.json"
$j = ConvertFrom-Json (Get-Content -raw $config)
foreach ($entry in $j.sign) {
foreach ($v in $entry.values) {
$ext = [IO.Path]::GetExtension($v)
if (($ext -eq ".dll") -or ($ext -eq ".exe")) {
$name = [IO.Path]::ChangeExtension($v, ".pdb")
$pdbPath = Join-Path $configDir $name
Write-Host "`t$pdbPath"
Exec-Block { & $gitlink -u "https://github.com/dotnet/roslyn" --baseDir $repoDir $pdbPath } | Write-Host
}
}
}
exit 0
}
catch [exception] {
Write-Host $_.Exception
exit 1
}
......@@ -24,6 +24,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -12,6 +12,7 @@
<RuntimeIdentifiers>win7</RuntimeIdentifiers>
<SignAssembly>false</SignAssembly>
<AutomaticBindingRedirects>true</AutomaticBindingRedirects>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
......
......@@ -105,7 +105,7 @@
<InternalsVisibleTo Include="Roslyn.VisualStudio.Setup" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.VisualBasic.Repl" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.DiagnosticsWindow" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToTest Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.Managed" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.Managed.VS" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.CSharp" />
......
......@@ -21,6 +21,7 @@
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifiers>win7</RuntimeIdentifiers>
<RoslynProjectType>Vsix</RoslynProjectType>
<Nonshipping>true</Nonshipping>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\EditorFeatures\TestUtilities\ServicesTestUtilities.csproj" />
......
......@@ -60,7 +60,7 @@
<InternalsVisibleTo Include="Roslyn.Hosting.Diagnostics" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.Setup" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.DiagnosticsWindow" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToTest Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToMonodevelop Include="MonoDevelop.Ide" />
<InternalsVisibleToMonodevelop Include="MonoDevelop.Refactoring" />
<InternalsVisibleToMonodevelop Include="MonoDevelop.CSharpBinding" />
......
......@@ -252,7 +252,7 @@
<InternalsVisibleTo Include="Roslyn.Hosting.Diagnostics" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.Setup" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.DiagnosticsWindow" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToTest Include="Roslyn.VisualStudio.RemoteHostClientMock" />
<InternalsVisibleToMonodevelop Include="MonoDevelop.Ide" />
<InternalsVisibleToMonodevelop Include="MonoDevelop.Refactoring" />
<InternalsVisibleToMonodevelop Include="MonoDevelop.CSharpBinding" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册