提交 3d44e4f7 编写于 作者: T Tomas Matousek

Reimplement DevDivInsertionFiles

上级 b7ae5aac
......@@ -367,10 +367,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Pool
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests", "src\Workspaces\MSBuildTest\Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.csproj", "{037F06F0-3BE8-42D0-801E-2F74FC380AB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevDivPackagesDebugger_DoNotUse", "src\Setup\DevDivPackages\Debugger\DevDivPackagesDebugger_DoNotUse.csproj", "{18BDB5D5-340B-4834-B4FC-0327729A4A26}"
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Roslyn.BuildDevDivInsertionFiles", "src\Setup\DevDivInsertionFiles\Roslyn.BuildDevDivInsertionFiles.vbproj", "{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteractiveHost64", "src\Interactive\Host\InteractiveHost64.csproj", "{2F11618A-9251-4609-B3D5-CE4D2B3D3E49}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.IntegrationTest.IntegrationService", "src\VisualStudio\IntegrationTest\IntegrationService\Microsoft.VisualStudio.IntegrationTest.IntegrationService.csproj", "{764D2C19-0187-4837-A2A3-96DDC6EF4CE2}"
......@@ -403,6 +399,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-format", "src\Tools\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Workspaces.Desktop.UnitTests", "src\Workspaces\DesktopTest\Microsoft.CodeAnalysis.Workspaces.Desktop.UnitTests.csproj", "{23405307-7EFF-4774-8B11-8F5885439761}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Insertion", "Insertion", "{AFA5F921-0650-45E8-B293-51A0BB89DEA0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevDivInsertionFiles", "src\Setup\DevDivInsertionFiles\DevDivInsertionFiles.csproj", "{6362616E-6A47-48F0-9EE0-27800B306ACB}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4
......@@ -1004,14 +1004,6 @@ Global
{037F06F0-3BE8-42D0-801E-2F74FC380AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{037F06F0-3BE8-42D0-801E-2F74FC380AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{037F06F0-3BE8-42D0-801E-2F74FC380AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{18BDB5D5-340B-4834-B4FC-0327729A4A26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{18BDB5D5-340B-4834-B4FC-0327729A4A26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18BDB5D5-340B-4834-B4FC-0327729A4A26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18BDB5D5-340B-4834-B4FC-0327729A4A26}.Release|Any CPU.Build.0 = Release|Any CPU
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Release|Any CPU.Build.0 = Release|Any CPU
{2F11618A-9251-4609-B3D5-CE4D2B3D3E49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F11618A-9251-4609-B3D5-CE4D2B3D3E49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F11618A-9251-4609-B3D5-CE4D2B3D3E49}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -1068,6 +1060,10 @@ Global
{23405307-7EFF-4774-8B11-8F5885439761}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23405307-7EFF-4774-8B11-8F5885439761}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23405307-7EFF-4774-8B11-8F5885439761}.Release|Any CPU.Build.0 = Release|Any CPU
{6362616E-6A47-48F0-9EE0-27800B306ACB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6362616E-6A47-48F0-9EE0-27800B306ACB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6362616E-6A47-48F0-9EE0-27800B306ACB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6362616E-6A47-48F0-9EE0-27800B306ACB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -1239,8 +1235,6 @@ Global
{FC2AE90B-2E4B-4045-9FDD-73D4F5ED6C89} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{49E7C367-181B-499C-AC2E-8E17C81418D6} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{037F06F0-3BE8-42D0-801E-2F74FC380AB8} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{18BDB5D5-340B-4834-B4FC-0327729A4A26} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{2F11618A-9251-4609-B3D5-CE4D2B3D3E49} = {5CA5F70E-0FDB-467B-B22C-3CD5994F0087}
{764D2C19-0187-4837-A2A3-96DDC6EF4CE2} = {CC126D03-7EAC-493F-B187-DCDEE1EF6A70}
{9860FCF7-3111-4C12-A16F-ACEBA42D930F} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
......@@ -1257,6 +1251,8 @@ Global
{03607817-6800-40B6-BEAA-D6F437CD62B7} = {BE25E872-1667-4649-9D19-96B83E75A44E}
{4A9B5423-11BF-4E1D-B231-C9A2FDD78EC4} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{23405307-7EFF-4774-8B11-8F5885439761} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{AFA5F921-0650-45E8-B293-51A0BB89DEA0} = {8DBA5174-B0AA-4561-82B1-A46607697753}
{6362616E-6A47-48F0-9EE0-27800B306ACB} = {AFA5F921-0650-45E8-B293-51A0BB89DEA0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
......
......@@ -254,24 +254,10 @@ function Build-Artifacts() {
}
if ($build -and $pack -and (-not $buildCoreClr)) {
Build-InsertionItems
Build-Installer
}
}
function Build-InsertionItems() {
$setupDir = Join-Path $repoDir "src\Setup"
Push-Location $setupDir
try {
Write-Host "Building VS Insertion artifacts"
Exec-Console (Join-Path $configDir "Exes\Roslyn.BuildDevDivInsertionFiles\Roslyn.BuildDevDivInsertionFiles.exe") "$configDir $(Get-PackagesDir)"
}
finally {
Pop-Location
}
}
function Build-Installer () {
## Copying Artifacts
$installerDir = Join-Path $configDir "Installer"
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
</configuration>
\ No newline at end of file
Imports System.IO
Imports System.Threading
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports System.Reflection.PortableExecutable
Imports System.Reflection.Metadata
Public Class BuildDevDivInsertionFiles
Private Const DevDivInsertionFilesDirName = "DevDivInsertionFiles"
Private Const DevDivPackagesDirName = "DevDivPackages"
Private ReadOnly _binDirectory As String
Private ReadOnly _outputDirectory As String
Private ReadOnly _outputPackageDirectory As String
Private ReadOnly _nugetPackageRoot As String
Private Sub New(args As String())
_binDirectory = Path.GetFullPath(args(0))
_nugetPackageRoot = Path.GetFullPath(args(1))
_outputDirectory = Path.Combine(_binDirectory, DevDivInsertionFilesDirName)
_outputPackageDirectory = Path.Combine(_binDirectory, DevDivPackagesDirName)
End Sub
Public Shared Function Main(args As String()) As Integer
If args.Length < 2 Then
Console.WriteLine("Expected arguments: <bin dir> <nuget root dir>")
Console.WriteLine($"Actual argument count is {args.Length}")
Return 1
End If
Try
Call New BuildDevDivInsertionFiles(args).Execute()
Return 0
Catch ex As Exception
Console.Error.WriteLine(ex.ToString())
Return 1
End Try
End Function
Private Sub DeleteDirContents(dir As String)
If Directory.Exists(dir) Then
' Delete everything within it. We'll keep the top-level one around.
For Each file In New DirectoryInfo(dir).GetFiles()
file.Delete()
Next
For Each directory In New DirectoryInfo(dir).GetDirectories()
directory.Delete(recursive:=True)
Next
End If
End Sub
Public Sub Execute()
Retry(Sub()
DeleteDirContents(_outputDirectory)
DeleteDirContents(Path.Combine(_outputPackageDirectory, "NativeDependencies"))
DeleteDirContents(Path.Combine(_outputPackageDirectory, "ManagedDependencies"))
End Sub)
' Build a dependency map
Dim dependencies = BuildDependencyMap(_binDirectory)
GenerateAssemblyVersionList(dependencies)
CopyDependencies(dependencies)
End Sub
Private Class DependencyInfo
' For example, "ref/net472"
Public ContractDir As String
' For example, "lib/net472"
Public ImplementationDir As String
' For example, "System.AppContext"
Public PackageName As String
' For example, "4.1.0"
Public PackageVersion As String
Public IsNative As Boolean
Public IsFacade As Boolean
Sub New(contractDir As String, implementationDir As String, packageName As String, packageVersion As String, isNative As Boolean, isFacade As Boolean)
Me.ContractDir = contractDir
Me.ImplementationDir = implementationDir
Me.PackageName = packageName
Me.PackageVersion = packageVersion
Me.IsNative = isNative
Me.IsFacade = isFacade
End Sub
End Class
Private Function BuildDependencyMap(inputDirectory As String) As Dictionary(Of String, DependencyInfo)
Dim result = New Dictionary(Of String, DependencyInfo)
Dim objDir = Path.Combine(Path.GetDirectoryName(_binDirectory.TrimEnd(Path.DirectorySeparatorChar)), "Obj")
Dim files = New List(Of String)
files.Add(Path.Combine(objDir, "Roslyn.Compilers.Extension\project.assets.json"))
files.Add(Path.Combine(objDir, "Roslyn.VisualStudio.Setup.Dependencies\project.assets.json"))
For Each projectLockJson In files
Dim items = DirectCast(JsonConvert.DeserializeObject(File.ReadAllText(projectLockJson)), JObject)
Const targetFx = ".NETFramework,Version=v4.7.2"
Dim targets = DirectCast(items.Property("targets")?.Value, JObject)
If targets Is Nothing Then
Throw New InvalidDataException($"Invalid format for '{projectLockJson}': missing 'targets' property")
End If
Dim targetObj = DirectCast(targets.Property(targetFx)?.Value, JObject)
If targetObj Is Nothing Then
Dim availablePlatforms = String.Join(",", targets.Properties.Select(Function(p) $"'{p.Name}'"))
Throw New InvalidDataException($"Expected platform not found in '{projectLockJson}': '{targetFx}'. Available platforms: {availablePlatforms}")
End If
For Each targetProperty In targetObj.Properties
Dim packageNameAndVersion = targetProperty.Name.Split("/"c)
Dim packageName = packageNameAndVersion(0)
Dim packageVersion = packageNameAndVersion(1)
Dim packageObj = DirectCast(targetProperty.Value, JObject)
If packageObj.Property("type").Value.Value(Of String) = "project" Then
Continue For
End If
Dim contracts = DirectCast(packageObj.Property("compile")?.Value, JObject)
Dim runtime = DirectCast(packageObj.Property("runtime")?.Value, JObject)
Dim native = DirectCast(packageObj.Property("native")?.Value, JObject)
Dim frameworkAssemblies = packageObj.Property("frameworkAssemblies")?.Value
Dim implementations = If(runtime, native)
If implementations Is Nothing Then
Continue For
End If
' No need to insert Visual Studio packages back into the repository itself
If packageName.StartsWith("Microsoft.VisualStudio.") OrElse
packageName = "EnvDTE" OrElse
packageName = "stdole" OrElse
packageName.StartsWith("Microsoft.Build") OrElse
packageName = "Microsoft.Composition" OrElse
packageName = "System.Net.Http" OrElse
packageName = "System.Diagnostics.DiagnosticSource" OrElse
packageName = "StreamJsonRpc" OrElse
packageName = "Newtonsoft.Json" Then
Continue For
End If
For Each assemblyProperty In implementations.Properties()
Dim fileName = Path.GetFileName(assemblyProperty.Name)
If fileName <> "_._" Then
Dim existingDependency As DependencyInfo = Nothing
If result.TryGetValue(fileName, existingDependency) Then
If existingDependency.PackageVersion <> packageVersion Then
Throw New InvalidOperationException($"Found multiple versions of package '{existingDependency.PackageName}': {existingDependency.PackageVersion} and {packageVersion}")
End If
Continue For
End If
Dim runtimeTarget = Path.GetDirectoryName(assemblyProperty.Name)
Dim compileDll = contracts?.Properties().Select(Function(p) p.Name).Where(Function(n) Path.GetFileName(n) = fileName).SingleOrDefault()
Dim compileTarget = If(compileDll IsNot Nothing, Path.GetDirectoryName(compileDll), Nothing)
result.Add(fileName, New DependencyInfo(compileTarget,
runtimeTarget,
packageName,
packageVersion,
isNative:=native IsNot Nothing,
isFacade:=(frameworkAssemblies IsNot Nothing AndAlso
packageName <> "Microsoft.Build" AndAlso
packageName <> "Microsoft.DiaSymReader") OrElse
packageName = "System.IO.Pipes.AccessControl"))
End If
Next
Next
Next
Return result
End Function
Private Sub GenerateAssemblyVersionList(dependencies As IReadOnlyDictionary(Of String, DependencyInfo))
Using writer = New StreamWriter(GetAbsolutePathInOutputDirectory("DependentAssemblyVersions.csv"))
For Each entry In dependencies.OrderBy(Function(e) e.Key)
Dim fileName = entry.Key
Dim dependency = entry.Value
If Not dependency.IsNative Then
Dim version As Version
Dim dllPath = Path.Combine(_nugetPackageRoot, dependency.PackageName, dependency.PackageVersion, dependency.ImplementationDir, fileName)
Using peReader = New PEReader(File.OpenRead(dllPath))
version = peReader.GetMetadataReader().GetAssemblyDefinition().Version
End Using
writer.WriteLine($"{Path.GetFileNameWithoutExtension(fileName)},{version}")
End If
Next
End Using
End Sub
Private Sub CopyDependencies(dependencies As IReadOnlyDictionary(Of String, DependencyInfo))
For Each dependency In dependencies.Values
Dim nupkg = $"{dependency.PackageName}.{dependency.PackageVersion}.nupkg"
Dim srcPath = Path.Combine(_nugetPackageRoot, dependency.PackageName, dependency.PackageVersion, nupkg)
Dim dstDir = Path.Combine(_outputPackageDirectory, If(dependency.IsNative, "NativeDependencies", "ManagedDependencies"))
Dim dstPath = Path.Combine(dstDir, nupkg)
Directory.CreateDirectory(dstDir)
File.Copy(srcPath, dstPath, overwrite:=True)
Next
End Sub
''' <summary>
''' A simple method to retry an operation. Helpful if some file locking is going on and you want to just try the operation again.
''' </summary>
Private Sub Retry(action As Action)
For i = 1 To 10
Try
action()
Return
Catch ex As Exception
Thread.Sleep(100)
End Try
Next
End Sub
Private Function GetAbsolutePathInOutputDirectory(relativePath As String) As String
Dim absolutePath = Path.Combine(_outputDirectory, relativePath)
' Ensure that the parent directories are all created
Directory.CreateDirectory(Path.GetDirectoryName(absolutePath))
Return absolutePath
End Function
End Class
<?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. -->
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\build\Targets\RepoToolset\BuildTasks.props"/>
<PropertyGroup>
<_NuGetRepackAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(NuGetPackageRoot)roslyntools.nugetrepack.buildtasks\$(RoslynToolsNuGetRepackVersion)\tools\net472\RoslynTools.NuGetRepack.BuildTasks.dll</_NuGetRepackAssembly>
<_NuGetRepackAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(NuGetPackageRoot)roslyntools.nugetrepack.buildtasks\$(RoslynToolsNuGetRepackVersion)\tools\netcoreapp2.1\RoslynTools.NuGetRepack.BuildTasks.dll</_NuGetRepackAssembly>
</PropertyGroup>
<UsingTask TaskName="RoslynTools.GetAssemblyFullName" AssemblyFile="$(RoslynToolsBuildTasksAssembly)" />
<UsingTask TaskName="RoslynTools.Unzip" AssemblyFile="$(RoslynToolsBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.NET.Build.Tasks.JoinItems" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<UsingTask TaskName="Roslyn.Tools.ReplacePackageParts" AssemblyFile="$(_NuGetRepackAssembly)" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\VisualStudio\CSharp\Impl\Microsoft.VisualStudio.LanguageServices.CSharp.csproj"/>
<ProjectReference Include="..\..\VisualStudio\VisualBasic\Impl\Microsoft.VisualStudio.LanguageServices.VisualBasic.vbproj"/>
<ProjectReference Include="..\..\ExpressionEvaluator\CSharp\Source\ExpressionCompiler\Microsoft.CodeAnalysis.CSharp.ExpressionCompiler.csproj"/>
<ProjectReference Include="..\..\ExpressionEvaluator\VisualBasic\Source\ExpressionCompiler\Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler.vbproj"/>
</ItemGroup>
<PropertyGroup>
<_DevDivInsertionFilesDir>$(ArtifactsConfigurationDir)DevDivInsertionFiles\</_DevDivInsertionFilesDir>
<_DependentAssemblyVersionsFile>$(_DevDivInsertionFilesDir)DependentAssemblyVersions.csv</_DependentAssemblyVersionsFile>
<_ManagedDependenciesDir>$(ArtifactsConfigurationDir)DevDivPackages\ManagedDependencies\</_ManagedDependenciesDir>
</PropertyGroup>
<!--
List of dependencies that are expected to be inserted into VS by Roslyn Insertion Tool.
-->
<ItemGroup>
<ExpectedDependency Include="Humanizer.Core"/>
<ExpectedDependency Include="ICSharpCode.Decompiler"/>
<ExpectedDependency Include="Microsoft.DiaSymReader"/>
<ExpectedDependency Include="Microsoft.CodeAnalysis.Elfie"/>
<ExpectedDependency Include="System.Collections.Immutable"/>
<ExpectedDependency Include="System.Reflection.Metadata"/>
<ExpectedDependency Include="System.Runtime.CompilerServices.Unsafe"/>
<ExpectedDependency Include="System.Text.Encoding.CodePages"/>
<ExpectedDependency Include="System.Threading.Tasks.Extensions"/>
</ItemGroup>
<Target Name="_CalculateDependenciesToInsert" DependsOnTargets="ResolveAssemblyReferences">
<ItemGroup>
<!-- Take all resolved non-framework dependencies of this project that originate from a NuGet package -->
<_Dependency Include="@(ReferencePath->'%(NuGetPackageId)')"
Condition="'%(ReferencePath.FrameworkFile)' != 'true' and
'%(ReferencePath.NuGetPackageId)' != '' and
'%(ReferencePath.ReferenceSourceTarget)' != 'ProjectReference'" />
<!-- Take all additional files that get copied to the output directory and are not satellite assemblies -->
<_CopyLocalDependency Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')"
Exclude="@(_Dependency)"
Condition="'%(ReferenceCopyLocalPaths.Culture)' == ''">
<_AssemblyPath>%(ReferenceCopyLocalPaths.Identity)</_AssemblyPath>
</_CopyLocalDependency>
</ItemGroup>
<RoslynTools.GetAssemblyFullName Items="@(_CopyLocalDependency)" PathMetadata="_AssemblyPath" FullNameMetadata="FusionName">
<Output TaskParameter="ItemsWithFullName" ItemName="_Dependency"/>
</RoslynTools.GetAssemblyFullName>
<!--
Exclude dependencies that are not inserted from Roslyn repo.
Note: can't use globs due to https://github.com/Microsoft/msbuild/issues/3791.
-->
<ItemGroup>
<_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('Microsoft.VisualStudio.'))"/>
<_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('System.Composition.'))"/>
<_Dependency Remove="@(_Dependency)" Condition="$([MSBuild]::ValueOrDefault('%(Identity)', '').StartsWith('Microsoft.Internal.VisualStudio.'))"/>
<_Dependency Remove="EnvDTE"/>
<_Dependency Remove="EnvDTE80"/>
<_Dependency Remove="Microsoft.Build"/>
<_Dependency Remove="Microsoft.Build.Framework"/>
<_Dependency Remove="Microsoft.MSXML"/>
<_Dependency Remove="Newtonsoft.Json"/>
<_Dependency Remove="stdole"/>
<_Dependency Remove="StreamJsonRpc"/>
<_Dependency Remove="System.Threading.Tasks.Dataflow"/>
</ItemGroup>
<!-- Calculate metadata we need -->
<ItemGroup>
<_Dependency Update="@(_Dependency)">
<_AssemblyName>$([MSBuild]::ValueOrDefault('%(_Dependency.FusionName)', '').Split(',')[0])</_AssemblyName>
<_AssemblyVersion>$([MSBuild]::ValueOrDefault('%(_Dependency.FusionName)', '').Split(',')[1])</_AssemblyVersion>
<_NuGetPackageFileName>%(_Dependency.NuGetPackageId).%(_Dependency.NuGetPackageVersion).nupkg</_NuGetPackageFileName>
<_NuGetPackagePath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(_Dependency.NuGetPackageId)', '').ToLower())\%(_Dependency.NuGetPackageVersion)\%(_Dependency.NuGetPackageId).%(_Dependency.NuGetPackageVersion).nupkg</_NuGetPackagePath>
</_Dependency>
</ItemGroup>
<!-- Sanity check that prevents us from accidentally inserting a new dependency without knowing. -->
<ItemGroup>
<_RemainingDependency Include="@(_Dependency)" Exclude="@(ExpectedDependency)"/>
<_UninsertedExpectedDependency Include="@(ExpectedDependency)" Exclude="@(_Dependency)"/>
</ItemGroup>
<Error Text="Unexpected dependencies found -- update ExpectedDependency list: @(_RemainingDependency)" Condition="'@(_RemainingDependency)' != ''"/>
<Error Text="Missing dependencies expected to be inserted -- update ExpectedDependency list: @(_UninsertedExpectedDependency)" Condition="'@(_UninsertedExpectedDependency)' != ''"/>
</Target>
<!--
Write a list of assembly names and versions that the insertion tool uses to update assembly versions in DevDiv.
-->
<Target Name="_GenerateDependentAssemblyVersions"
AfterTargets="Build"
DependsOnTargets="_CalculateDependenciesToInsert"
Inputs="$(MSBuildAllProjects)"
Outputs="$(_DependentAssemblyVersionsFile)">
<MakeDir Directories="$(_DevDivInsertionFilesDir)"/>
<WriteLinesToFile Lines="@(_Dependency->'%(_AssemblyName),%(_AssemblyVersion)')" File="$(_DependentAssemblyVersionsFile)" Overwrite="true"/>
<ItemGroup>
<FileWrites Include="$(_DependentAssemblyVersionsFile)"/>
</ItemGroup>
</Target>
<<<<<<< HEAD
=======
<!--
Unpack dependent packages to a temp folder where optimization data will be applied.
-->
<Target Name="_UnpackOptimizedDependencies" Condition="'@(_DependencyWithOptimizationData)' != ''">
<MakeDir Directories="@(_DependencyWithOptimizationData->'%(_UnpackDir)')"/>
<RoslynTools.Unzip SourceFiles="%(_DependencyWithOptimizationData._NuGetPackageDir)%(_DependencyWithOptimizationData._NuGetPackageFileName)"
DestinationFolder="%(_DependencyWithOptimizationData._UnpackDir)" />
</Target>
>>>>>>> bbe1bc535b... DDIF Fixes
<!--
Copy NuGet packages to be inserted into VS by the insertion tool.
-->
<Target Name="_CopyPackagesToInsert"
AfterTargets="Build"
DependsOnTargets="_CalculateDependenciesToInsert"
Inputs="$(MSBuildAllProjects)"
Outputs="@(_Dependency->'$(_ManagedDependenciesDir)%(_NuGetPackageFileName)')"
Condition="'$(OfficialBuild)' == 'true'">
<MakeDir Directories="$(_ManagedDependenciesDir)"/>
<Copy SourceFiles="@(_Dependency->'%(_NuGetPackagePath)')" DestinationFolder="$(_ManagedDependenciesDir)"/>
<ItemGroup>
<FileWrites Include="@(_Dependency->'$(_ManagedDependenciesDir)%(_NuGetPackageFileName)')"/>
</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. -->
<Project>
<Import Project="..\..\..\Directory.Build.targets" />
<Import Project="..\..\..\build\Targets\PackageProject.targets"/>
</Project>
\ No newline at end of file
{
"profiles": {
"DevDivInsertionFiles": {
"commandName": "Project",
"commandLineArgs": "E:\\code\\roslyn\\Binaries\\Debug E:\\code\\roslyn e:\\nuget"
}
}
}
\ 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. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputType>Exe</OutputType>
<StartupObject>Sub Main</StartupObject>
<RootNamespace>Roslyn.BuildDevDivInsertionFiles</RootNamespace>
<TargetFramework>net472</TargetFramework>
<BaseNuGetRuntimeIdentifier>$(RoslynDesktopRuntimeIdentifier)</BaseNuGetRuntimeIdentifier>
<RuntimeIdentifier>$(RoslynDesktopRuntimeIdentifier)</RuntimeIdentifier>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<OptionStrict>Off</OptionStrict>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="WindowsBase" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
</ItemGroup>
<ItemGroup>
<Import Include="System.Data" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="BuildDevDivInsertionFiles.vb" />
</ItemGroup>
</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. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputType>Exe</OutputType>
<RootNamespace>DevDivPackagesDebugger</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader.PortablePdb" Version="$(MicrosoftDiaSymReaderPortablePdbVersion)" />
</ItemGroup>
</Project>
\ No newline at end of file
using System;
namespace DoNotUse
{
public class Program
{
private static void Main(string[] args)
{
throw new Exception("Do not use");
}
}
}
......@@ -54,9 +54,6 @@
<PackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Setup\DevDivPackages\Debugger\DevDivPackagesDebugger_DoNotUse.csproj" />
</ItemGroup>
<!--
Workaround to make Roslyn work on Dev15. Deploys System.ValueTuple 4.0.3.0 and binding redirects to override System.ValueTuple 4.0.1.0 in PrivateAssemblies.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册