Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET
Roslyn
提交
5a3d00de
R
Roslyn
项目概览
dotNET
/
Roslyn
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5a3d00de
编写于
10月 06, 2016
作者:
T
Tomáš Matoušek
提交者:
GitHub
10月 06, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stop generating LanguageServiceRegistrationFiles (#14256)
上级
183e50f8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
123 deletion
+7
-123
src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb
src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb
+7
-123
未找到文件。
src/Setup/DevDivInsertionFiles/BuildDevDivInsertionFiles.vb
浏览文件 @
5a3d00de
...
@@ -793,37 +793,20 @@ Public Class BuildDevDivInsertionFiles
...
@@ -793,37 +793,20 @@ Public Class BuildDevDivInsertionFiles
Continue
For
Continue
For
End
If
End
If
If
dependencies
.
ContainsKey
(
partFileName
)
Then
If
IsLanguageServiceRegistrationFile
(
partFileName
)
Then
Continue
For
Continue
For
End
If
End
If
Dim
relativeOutputDir
As
String
If
dependencies
.
ContainsKey
(
partFileName
)
Then
If
IsLanguageServiceRegistrationFile
(
partFileName
)
Then
Continue
For
relativeOutputDir
=
Path
.
Combine
(
GetExternalApiDirectory
(),
"LanguageServiceRegistration"
,
vsixName
)
Else
relativeOutputDir
=
GetExternalApiDirectory
()
End
If
End
If
Dim
relativeOutputFilePath
=
Path
.
Combine
(
relativeOutputDir
,
partFileName
)
Dim
relativeOutputFilePath
=
Path
.
Combine
(
GetExternalApiDirectory
()
,
partFileName
)
If
processedFiles
.
Add
(
relativeOutputFilePath
)
Then
If
processedFiles
.
Add
(
relativeOutputFilePath
)
Then
If
IsLanguageServiceRegistrationFile
(
partFileName
)
Then
' paths are relative to input directory:
Dim
absoluteOutputFilePath
=
GetAbsolutePathInOutputDirectory
(
relativeOutputFilePath
)
filesToInsert
.
Add
(
New
NugetFileInfo
(
partFileName
))
WriteVsixPartToFile
(
vsixPart
,
absoluteOutputFilePath
)
AddXmlDocumentationFile
(
filesToInsert
,
partFileName
)
' We want to rewrite a few of these things from our standard vsix-installable forms
Select
Case
Path
.
GetExtension
(
absoluteOutputFilePath
)
Case
".pkgdef"
RewritePkgDef
(
absoluteOutputFilePath
)
Case
".vsixmanifest"
RewriteVsixManifest
(
absoluteOutputFilePath
)
End
Select
Else
' paths are relative to input directory:
filesToInsert
.
Add
(
New
NugetFileInfo
(
partFileName
))
AddXmlDocumentationFile
(
filesToInsert
,
partFileName
)
End
If
End
If
End
If
Next
Next
End
Using
End
Using
...
@@ -850,12 +833,6 @@ Public Class BuildDevDivInsertionFiles
...
@@ -850,12 +833,6 @@ Public Class BuildDevDivInsertionFiles
End
If
End
If
End
Sub
End
Sub
Private
Sub
WriteVsixPartToFile
(
vsixPart
As
PackagePart
,
path
As
String
)
Using
outputStream
=
New
FileStream
(
path
,
FileMode
.
Create
)
vsixPart
.
GetStream
().
CopyTo
(
outputStream
)
End
Using
End
Sub
''' <summary>
''' <summary>
''' Takes a list of paths relative to <see cref="_outputDirectory"/> and generates a nuspec file that includes them.
''' Takes a list of paths relative to <see cref="_outputDirectory"/> and generates a nuspec file that includes them.
''' </summary>
''' </summary>
...
@@ -872,7 +849,6 @@ Public Class BuildDevDivInsertionFiles
...
@@ -872,7 +849,6 @@ Public Class BuildDevDivInsertionFiles
<
version
>
0.0
</
version
>
<
version
>
0.0
</
version
>
</
metadata
>
</
metadata
>
<
files
>
<
files
>
<
file
src
=<
%
=
Path
.
Combine
(
DevDivInsertionFilesDirName
,
ExternalApisDirName
,
"Roslyn"
,
"**"
)
%
>
target
=
""
/>
<
%
=
filesToInsert
.
<
%
=
filesToInsert
.
OrderBy
(
Function
(
f
)
f
.
Path
).
OrderBy
(
Function
(
f
)
f
.
Path
).
Distinct
().
Distinct
().
...
@@ -883,33 +859,6 @@ Public Class BuildDevDivInsertionFiles
...
@@ -883,33 +859,6 @@ Public Class BuildDevDivInsertionFiles
xml
.
Save
(
GetAbsolutePathInOutputDirectory
(
PackageName
&
".nuspec"
),
SaveOptions
.
OmitDuplicateNamespaces
)
xml
.
Save
(
GetAbsolutePathInOutputDirectory
(
PackageName
&
".nuspec"
),
SaveOptions
.
OmitDuplicateNamespaces
)
End
Sub
End
Sub
Private
Sub
RewriteVsixManifest
(
fileToRewrite
As
String
)
Dim
xml
=
XDocument
.
Load
(
fileToRewrite
)
Dim
installationElement
=
xml
.
<
vsix
:
PackageManifest
>
.
<
vsix
:
Installation
>
.
Single
()
' We want to modify the .vsixmanifest to say this was installed via MSI
installationElement
.
@
InstalledByMsi
=
"true"
' Ensure the VSIX isn't shown in the extension gallery
installationElement
.
@
SystemComponent
=
"true"
' We build our VSIXes with the experimental flag so you can install them as test extensions. In the real MSI, they're not experimental.
installationElement
.
Attribute
(
"Experimental"
)
?
.
Remove
()
' Update the path to our MEF/Analyzer Components to be in their new home under PrivateAssemblies
Dim
assets
=
From
asset
In
xml
.
..<
vsix
:
Asset
>
Where
asset
.
@
Type
=
"Microsoft.VisualStudio.MefComponent"
OrElse
asset
.
@
Type
=
"Microsoft.VisualStudio.Analyzer"
For
Each
asset
In
assets
asset
.
@
Path
=
"$RootFolder$Common7\IDE\PrivateAssemblies\"
&
asset
.
@
Path
Next
xml
.
Save
(
fileToRewrite
)
End
Sub
Private
Shared
Function
IsVisualStudioLanguageServiceComponent
(
fileName
As
String
)
As
Boolean
Return
fileName
.
StartsWith
(
"Microsoft.VisualStudio.LanguageServices."
)
End
Function
Private
Sub
GenerateRoslynCompilerNuSpec
(
filesToInsert
As
IEnumerable
(
Of
String
))
Private
Sub
GenerateRoslynCompilerNuSpec
(
filesToInsert
As
IEnumerable
(
Of
String
))
Const
PackageName
As
String
=
"VS.Tools.Roslyn"
Const
PackageName
As
String
=
"VS.Tools.Roslyn"
...
@@ -973,69 +922,4 @@ set DEVPATH=%RoslynToolsRoot%;%DEVPATH%"
...
@@ -973,69 +922,4 @@ set DEVPATH=%RoslynToolsRoot%;%DEVPATH%"
Return
absolutePath
Return
absolutePath
End
Function
End
Function
''' <summary>
''' Rewrites a .pkgdef file to load any packages from PrivateAssemblies instead of from the .vsix's folder. This allows
''' for better use of ngen'ed images when we are installed into VS.
''' </summary>
Private
Sub
RewritePkgDef
(
fileToRewrite
As
String
)
' Our VSIXes normally contain a number of CodeBase attributes in our .pkgdefs so Visual Studio knows where
' to load assemblies. These come in one of two forms:
'
' 1) as a part of a binding redirection:
'
' [$RootKey$\RuntimeConfiguration\dependentAssembly\bindingRedirection\{A907DD23-73A7-8934-9396-93F10C532071}]
' "name"="System.Reflection.Metadata"
' "publicKeyToken"="b03f5f7f11d50a3a"
' "culture"="neutral"
' "oldVersion"="1.0.0.0-1.0.99.0"
' "newVersion"="1.1.0.0"
' "codeBase"="$PackageFolder$\System.Reflection.Metadata.dll"
'
' 2) as part of a codebase-only specification without a binding redirect:
'
' [$RootKey$\RuntimeConfiguration\dependentAssembly\codeBase\{8C6E3F81-ED3F-306B-107F-60D6E74DA5B0}]
' "name"="Esent.Interop"
' "publicKeyToken"="31bf3856ad364e35"
' "culture"="neutral"
' "version"="1.9.2.0"
' "codeBase"="$PackageFolder$\Esent.Interop.dll"
'
' Each of these use $PackageFolder$ as a way to specify the VSIX-relative path. When we convert our VSIXes
' to be installed as MSIs, we don't want the DLLs in the CommonExtensions next to our .pkgdefs. Instead
' we want them in PrivateAssemblies so they're in the loading path to enable proper ngen. Thus, these CodeBase
' attributes have to go. For #1, we can just delete the codeBase key, and leave the rest of the redirection
' in place. For #2, we can delete the entire section.
Dim
lines
=
File
.
ReadAllLines
(
fileToRewrite
)
Dim
inBindingRedirect
=
False
Dim
inCodebase
=
False
For
i
=
0
To
lines
.
Count
-
1
Dim
line
=
lines
(
i
)
If
line
.
StartsWith
(
"["
)
Then
inBindingRedirect
=
line
.
IndexOf
(
"bindingRedirection"
,
StringComparison
.
OrdinalIgnoreCase
)
>=
0
inCodebase
=
line
.
IndexOf
(
"RuntimeConfiguration\dependentAssembly\codeBase"
,
StringComparison
.
OrdinalIgnoreCase
)
>=
0
End
If
Dim
parts
=
line
.
Split
({
"="
c
},
count
:
=
2
)
If
inCodebase
Then
' Explicit codebase attributes must always be dropped
lines
(
i
)
=
Nothing
ElseIf
String
.
Equals
(
parts
(
0
),
"
""
CodeBase
""
"
,
StringComparison
.
OrdinalIgnoreCase
)
Then
If
inBindingRedirect
Then
' Drop CodeBase from all binding redirects -- they're only for VSIX installs
lines
(
i
)
=
Nothing
End
If
ElseIf
String
.
Equals
(
parts
(
0
),
"
""
isPkgDefOverrideEnabled
""
"
,
StringComparison
.
OrdinalIgnoreCase
)
Then
' We always need to drop this, since this is only for experimental VSIXes
lines
(
i
)
=
Nothing
End
If
Next
File
.
WriteAllLines
(
fileToRewrite
,
lines
.
Where
(
Function
(
l
)
l
IsNot
Nothing
))
End
Sub
End
Class
End
Class
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录