Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
72bd2073
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
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,发现更多精彩内容 >>
提交
72bd2073
编写于
4月 21, 2015
作者:
J
Jared Parsons
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2122 from jaredpar/cross-plat-alt
Cross Platform build issues
上级
0a54d675
a7ae0d3c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
33 deletion
+36
-33
src/Test/Utilities/CLRHelpers.cs
src/Test/Utilities/CLRHelpers.cs
+24
-2
src/Test/Utilities/TestUtilities.csproj
src/Test/Utilities/TestUtilities.csproj
+1
-4
src/Tools/Microsoft.CodeAnalysis.Toolset.Open/Targets/GenerateCompilerInternals.targets
...is.Toolset.Open/Targets/GenerateCompilerInternals.targets
+11
-27
未找到文件。
src/Test/Utilities/CLRHelpers.cs
浏览文件 @
72bd2073
...
...
@@ -3,6 +3,7 @@
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Immutable
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
...
...
@@ -47,6 +48,20 @@ private static Assembly ReflectionOnlyAssemblyResolveHandler(object sender, Reso
return
null
;
}
public
static
bool
IsRunningOnMono
()
{
return
Type
.
GetType
(
"Mono.Runtime"
)
!=
null
;
}
public
static
object
GetRuntimeInterfaceAsObject
(
Guid
clsid
,
Guid
riid
)
{
// This API isn't available on Mono hence we must use reflection to access it.
Debug
.
Assert
(!
IsRunningOnMono
());
var
getRuntimeInterfaceAsObject
=
typeof
(
RuntimeEnvironment
).
GetMethod
(
"GetRuntimeInterfaceAsObject"
,
BindingFlags
.
Public
|
BindingFlags
.
Static
);
return
getRuntimeInterfaceAsObject
.
Invoke
(
null
,
new
object
[]
{
clsid
,
riid
});
}
/// <summary>
/// Verifies the specified image. Subscribe to <see cref="ReflectionOnlyAssemblyResolve"/> to provide a loader for dependent assemblies.
/// </summary>
...
...
@@ -68,6 +83,13 @@ public static string[] PeVerify(string filePath)
private
static
string
[]
PeVerify
(
byte
[]
peImage
,
int
domainId
,
string
assemblyPath
)
{
if
(
IsRunningOnMono
())
{
// PEverify is currently unsupported on Mono hence return an empty
// set of messages
return
new
string
[]
{
};
}
lock
(
s_guard
)
{
GCHandle
pinned
=
GCHandle
.
Alloc
(
peImage
,
GCHandleType
.
Pinned
);
...
...
@@ -75,10 +97,10 @@ private static string[] PeVerify(byte[] peImage, int domainId, string assemblyPa
{
IntPtr
buffer
=
pinned
.
AddrOfPinnedObject
();
ICLRValidator
validator
=
(
ICLRValidator
)
RuntimeEnvironment
.
GetRuntimeInterfaceAsObject
(
s_clsIdClrRuntimeHost
,
typeof
(
ICLRRuntimeHost
).
GUID
);
ICLRValidator
validator
=
(
ICLRValidator
)
GetRuntimeInterfaceAsObject
(
s_clsIdClrRuntimeHost
,
typeof
(
ICLRRuntimeHost
).
GUID
);
ValidationErrorHandler
errorHandler
=
new
ValidationErrorHandler
(
validator
);
IMetaDataDispenser
dispenser
=
(
IMetaDataDispenser
)
RuntimeEnvironment
.
GetRuntimeInterfaceAsObject
(
s_clsIdCorMetaDataDispenser
,
typeof
(
IMetaDataDispenser
).
GUID
);
IMetaDataDispenser
dispenser
=
(
IMetaDataDispenser
)
GetRuntimeInterfaceAsObject
(
s_clsIdCorMetaDataDispenser
,
typeof
(
IMetaDataDispenser
).
GUID
);
// the buffer needs to be pinned during validation
Guid
riid
=
typeof
(
IMetaDataImport
).
GUID
;
...
...
src/Test/Utilities/TestUtilities.csproj
浏览文件 @
72bd2073
...
...
@@ -106,9 +106,6 @@
<Reference
Include=
"xunit"
>
<HintPath>
..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll
</HintPath>
</Reference>
<Reference
Include=
"PresentationCore"
/>
<Reference
Include=
"PresentationFramework"
/>
<Reference
Include=
"ReachFramework"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml"
/>
...
...
@@ -233,4 +230,4 @@
<Import
Project=
"..\..\..\build\Roslyn.Toolsets.Xunit.targets"
/>
<Import
Project=
"$(SolutionDir)\.nuget\NuGet.targets"
Condition=
"Exists('$(SolutionDir)\.nuget\NuGet.targets')"
/>
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
src/Tools/Microsoft.CodeAnalysis.Toolset.Open/Targets/GenerateCompilerInternals.targets
浏览文件 @
72bd2073
...
...
@@ -33,6 +33,10 @@
$(CleanDependsOn)
</CleanDependsOn>
</PropertyGroup>
<PropertyGroup>
<MonoPrefix
Condition=
"'$(OS)' != 'Windows_NT'"
>
mono
</MonoPrefix>
</PropertyGroup>
<Target
Name=
"GenerateSyntaxModel"
...
...
@@ -40,14 +44,9 @@
Outputs=
"@(SyntaxDefinition -> '$(IntermediateOutputPath)%(Filename)%(Extension).Generated$(DefaultLanguageSourceExtension)')"
Condition=
"'$(Language)' == 'VB' or '$(Language)' == 'C#'"
>
<PropertyGroup
Condition=
"'$(Language)' == 'VB'"
>
<SyntaxGenerator>
"$(VBSyntaxGeneratorToolPath)"
</SyntaxGenerator>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Language)' == 'C#'"
>
<SyntaxGenerator
Condition=
" '$(OS)' == 'Windows_NT' "
>
"$(CSharpSyntaxGeneratorToolPath)"
</SyntaxGenerator>
<SyntaxGenerator
Condition=
" '$(OS)' != 'Windows_NT' "
>
mono $(CSharpSyntaxGeneratorToolPath)
</SyntaxGenerator>
</PropertyGroup>
<PropertyGroup>
<SyntaxGenerator
Condition=
"'$(Language)' == 'VB'"
>
$(MonoPrefix) "$(VBSyntaxGeneratorToolPath)"
</SyntaxGenerator>
<SyntaxGenerator
Condition=
"'$(Language)' == 'C#'"
>
$(MonoPrefix) "$(CSharpSyntaxGeneratorToolPath)"
</SyntaxGenerator>
<GeneratedSyntaxModel>
@(SyntaxDefinition -> '$(IntermediateOutputPath)%(Filename)%(Extension).Generated$(DefaultLanguageSourceExtension)')
</GeneratedSyntaxModel>
</PropertyGroup>
...
...
@@ -78,8 +77,6 @@
>
<PropertyGroup>
<SyntaxGenerator>
"$(VBSyntaxGeneratorToolPath)"
</SyntaxGenerator>
</PropertyGroup>
<PropertyGroup>
<GeneratedSyntaxModelGetText>
@(SyntaxGetTextDefinition -> '$(IntermediateOutputPath)\%(FileName)%(Extension).Generated$(DefaultLanguageSourceExtension)')
</GeneratedSyntaxModelGetText>
</PropertyGroup>
...
...
@@ -109,14 +106,9 @@
Outputs=
"@(SyntaxTestDefinition -> '$(IntermediateOutputPath)\%(FileName)%(Extension).Generated$(DefaultLanguageSourceExtension)')"
Condition=
"'$(Language)' == 'VB' or '$(Language)' == 'C#'"
>
<PropertyGroup
Condition=
"'$(Language)' == 'VB'"
>
<SyntaxGenerator>
"$(VBSyntaxGeneratorToolPath)"
</SyntaxGenerator>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Language)' == 'C#'"
>
<SyntaxGenerator
Condition=
" '$(OS)' == 'Windows_NT' "
>
"$(CSharpSyntaxGeneratorToolPath)"
</SyntaxGenerator>
<SyntaxGenerator
Condition=
" '$(OS)' != 'Windows_NT' "
>
mono $(CSharpSyntaxGeneratorToolPath)
</SyntaxGenerator>
</PropertyGroup>
<PropertyGroup>
<SyntaxGenerator
Condition=
"'$(Language)' == 'VB'"
>
$(MonoPrefix) "$(VBSyntaxGeneratorToolPath)"
</SyntaxGenerator>
<SyntaxGenerator
Condition=
"'$(Language)' == 'C#'"
>
$(MonoPrefix) "$(CSharpSyntaxGeneratorToolPath)"
</SyntaxGenerator>
<GeneratedSyntaxModelTests>
@(SyntaxTestDefinition -> '$(IntermediateOutputPath)\%(FileName)%(Extension).Generated$(DefaultLanguageSourceExtension)')
</GeneratedSyntaxModelTests>
</PropertyGroup>
...
...
@@ -147,8 +139,7 @@
Condition=
"'$(Language)' == 'VB' or '$(Language)' == 'C#'"
>
<PropertyGroup>
<BoundTreeGenerator
Condition=
" '$(OS)' == 'Windows_NT' "
>
"$(BoundTreeGeneratorToolPath)"
</BoundTreeGenerator>
<BoundTreeGenerator
Condition=
" '$(OS)' != 'Windows_NT' "
>
mono $(BoundTreeGeneratorToolPath)
</BoundTreeGenerator>
<BoundTreeGenerator>
$(MonoPrefix) "$(BoundTreeGeneratorToolPath)"
</BoundTreeGenerator>
<GeneratedBoundTree>
@(BoundTreeDefinition -> '$(IntermediateOutputPath)%(Filename)%(Extension).Generated$(DefaultLanguageSourceExtension)')
</GeneratedBoundTree>
</PropertyGroup>
...
...
@@ -183,16 +174,9 @@
Outputs=
"@(ErrorCode -> '$(IntermediateOutputPath)ErrorFacts.Generated$(DefaultLanguageSourceExtension)')"
Condition=
"'$(Language)' == 'VB' or '$(Language)' == 'C#'"
>
<PropertyGroup
Condition=
"'$(Language)' == 'VB'"
>
<ErrorFactsGenerator>
"$(VBErrorFactsGeneratorToolPath)"
</ErrorFactsGenerator>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Language)' == 'C#'"
>
<ErrorFactsGenerator
Condition=
" '$(OS)' == 'Windows_NT' "
>
"$(CSharpErrorFactsGeneratorToolPath)"
</ErrorFactsGenerator>
<ErrorFactsGenerator
Condition=
" '$(OS)' != 'Windows_NT' "
>
mono $(CSharpErrorFactsGeneratorToolPath)
</ErrorFactsGenerator>
</PropertyGroup>
<PropertyGroup>
<ErrorFactsGenerator
Condition=
"'$(Language)' == 'VB'"
>
$(MonoPrefix) "$(VBErrorFactsGeneratorToolPath)"
</ErrorFactsGenerator>
<ErrorFactsGenerator
Condition=
"'$(Language)' == 'C#'"
>
$(MonoPrefix) "$(CSharpErrorFactsGeneratorToolPath)"
</ErrorFactsGenerator>
<GeneratedErrorFacts>
@(ErrorCode -> '$(IntermediateOutputPath)ErrorFacts.Generated$(DefaultLanguageSourceExtension)')
</GeneratedErrorFacts>
</PropertyGroup>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录