Imported Upstream version 5.10.0.116

Former-commit-id: 8f2f8afd053f1b5b4b35b0827e7a9424613038ae
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-02-15 19:17:22 +00:00
parent 05e67c9e5f
commit c10090095e
48 changed files with 115 additions and 73 deletions

View File

@@ -5,10 +5,13 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<Import Project="Mono.Cecil.props" />
<PropertyGroup Condition="'$(NetStandard)' == 'true'">
<PropertyGroup Condition="$(NetStandard)">
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup Condition="'$(NetStandard)' == 'true'">
<PropertyGroup Condition="!$(NetStandard)">
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup Condition="$(NetStandard)">
<PackageReference Include="NUnit">
<Version>3.7.1</Version>
</PackageReference>
@@ -17,9 +20,9 @@
</PackageReference>
<PackageReference Include="NUnit3TestAdapter">
<Version>3.8.0</Version>
</PackageReference>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(NetStandard)' != 'true'">
<ItemGroup Condition="!$(NetStandard)">
<Reference Include="nunit.core">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(MSBuildThisFileDirectory)\Test\libs\nunit-2.6.2\nunit.core.dll</HintPath>
@@ -37,7 +40,7 @@
<Target Name="ForceGenerationOfBindingRedirects"
AfterTargets="ResolveAssemblyReferences"
BeforeTargets="GenerateBindingRedirects"
Condition="'$(AutoGenerateBindingRedirects)' == 'true'">
Condition="$(AutoGenerateBindingRedirects)">
<PropertyGroup>
<!-- Needs to be set in a target because it has to be set after the initial evaluation in the common targets -->
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

View File

@@ -14,6 +14,7 @@
<MSBuildCSharpTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</MSBuildCSharpTargets>
<NetStandard Condition=" $(Configuration.StartsWith('netstandard')) Or '$(NuGetRestoreTargets)' != '' ">true</NetStandard>
<NetStandard Condition=" '$(NetStandard)' == '' ">false</NetStandard>
<IsTestProject Condition=" '$(IsTestProject)' == '' ">false</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition=" $(Configuration.Contains('Debug')) ">
<DebugSymbols>true</DebugSymbols>
@@ -42,13 +43,13 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<DefineConstants>$(DefineConstants);NET_4_0;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(NetStandard)' == 'true'">
<TargetFramework Condition="'$(IsTestProject)' == 'true'">netcoreapp2.0</TargetFramework>
<TargetFramework Condition="'$(IsTestProject)' != 'true'">netstandard1.3</TargetFramework>
<PropertyGroup Condition="$(NetStandard)">
<TargetFramework Condition="$(IsTestProject)">netcoreapp2.0</TargetFramework>
<TargetFramework Condition="!$(IsTestProject)">netstandard1.3</TargetFramework>
</PropertyGroup>
<Import Project="NetStandard.props" Condition="'$(NetStandard)' == 'true'" />
<Import Project="NetStandard.props" Condition="$(NetStandard)" />
<!-- Shared References -->
<ItemGroup Condition="'$(NetStandard)' != 'true'">
<ItemGroup Condition="!$(NetStandard)">
<Reference Include="System.Core" />
<Reference Include="System" />
</ItemGroup>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Mono.Cecil.Tests</RootNamespace>
<AssemblyName>Mono.Cecil.Tests</AssemblyName>
</PropertyGroup>
<ItemGroup Condition="'$(NetStandard)' == 'true'">
<ItemGroup Condition="$(NetStandard)">
<PackageReference Include="System.Reflection.TypeExtensions">
<Version>4.3.0</Version>
</PackageReference>
@@ -50,5 +50,5 @@
<ItemGroup>
<None Include="Resources\**\*" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(NetStandard)' != 'true'" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="!$(NetStandard)" />
</Project>

View File

@@ -89,5 +89,19 @@ namespace Mono.Cecil.Tests {
Assert.AreEqual (module.AssemblyReferences [0], module.TypeSystem.CoreLibrary);
}, verify: !Platform.OnMono);
}
[Test]
public void MismatchedLibraryAndSymbols_DoNotThrow ()
{
// SQLite-net.dll (from nuget) shiped with mismatched symbol files, but throwIfNoSymbol did not prevent it from throwing
var readerParms = new ReaderParameters {
ReadSymbols = true,
SymbolReaderProvider = new Cil.DefaultSymbolReaderProvider (throwIfNoSymbol: false)
};
using (var module = GetResourceModule ("SQLite-net.dll", readerParms)) {
Assert.Null (module.SymbolReader);
}
}
}
}

Binary file not shown.