Skip to content

Commit dfed286

Browse files
jonpryoratsushieno
authored andcommitted
Bump to Mono.Cecil 0.10.0-beta1-v2 (#77)
Mono 4.8 has migrated to Mono.Cecil/master, based on 0.10.0, which is API-incompatible with the previous Mono.Cecil 0.9.6. In particular, `TypeDefinition.Interfaces` now returns a `Collection<InterfaceImplementation>` instead of the previous `Collection<TypeReference>`, which causes all manner of breakage. Since the next version of Xamarin.Android will be based on Mono 4.8, and Xamarin.Android needs Java.Interop, bump Java.Interop to use the Mono.Cecil 0.10.x preview package, and fix the corresponding breakage.
1 parent 37ad96b commit dfed286

File tree

19 files changed

+61
-46
lines changed

19 files changed

+61
-46
lines changed

src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
<ItemGroup>
3232
<Reference Include="System" />
3333
<Reference Include="Mono.Cecil">
34-
<HintPath>$(MSBuildThisFileDirectory)\..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
34+
<HintPath>$(MSBuildThisFileDirectory)\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.dll</HintPath>
3535
</Reference>
3636
<Reference Include="Mono.Cecil.Mdb">
37-
<HintPath>$(MSBuildThisFileDirectory)\..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
37+
<HintPath>$(MSBuildThisFileDirectory)\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
3838
</Reference>
3939
<Reference Include="Mono.Cecil.Pdb">
40-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
40+
<HintPath>$(MSBuildThisFileDirectory)\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
4141
</Reference>
4242
<Reference Include="Mono.Cecil.Rocks">
43-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
43+
<HintPath>$(MSBuildThisFileDirectory)\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
4444
</Reference>
4545
</ItemGroup>
4646
<ItemGroup>
@@ -60,4 +60,4 @@
6060
<None Include="packages.config" />
6161
</ItemGroup>
6262
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
63-
</Project>
63+
</Project>

src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ public DirectoryAssemblyResolver (Action<string, object[]> logWarnings, bool loa
7474
SearchDirectories = new List<string> ();
7575
}
7676

77+
public void Dispose ()
78+
{
79+
Dispose (disposing: false);
80+
GC.SuppressFinalize (this);
81+
}
82+
83+
protected virtual void Dispose (bool disposing)
84+
{
85+
}
86+
7787
public IDictionary ToResolverCache ()
7888
{
7989
var resolver_cache = new Hashtable ();

src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ public static bool IsAssignableFrom (this TypeReference type, TypeReference c)
4141
return true;
4242
if (!t.HasInterfaces)
4343
continue;
44-
foreach (var i in t.Interfaces)
44+
foreach (var ifaceImpl in t.Interfaces) {
45+
var i = ifaceImpl.InterfaceType;
4546
if (IsAssignableFrom (type, i))
4647
return true;
48+
}
4749
}
4850
return false;
4951
}
@@ -56,7 +58,7 @@ public static bool IsSubclassOf (this TypeDefinition type, string typeName)
5658
public static bool ImplementsInterface (this TypeDefinition type, string interfaceName)
5759
{
5860
return type.GetTypeAndBaseTypes ().Any (t => t.HasInterfaces &&
59-
t.Interfaces.Any (i => i.FullName == interfaceName));
61+
t.Interfaces.Any (i => i.InterfaceType.FullName == interfaceName));
6062
}
6163

6264
public static string GetPartialAssemblyQualifiedName (this TypeReference type)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" />
3+
<package id="Mono.Cecil" version="0.10.0-beta1-v2" targetFramework="net40" />
44
</packages>

src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
<ItemGroup>
3232
<Reference Include="System" />
3333
<Reference Include="Mono.Cecil">
34-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
34+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.dll</HintPath>
3535
</Reference>
3636
<Reference Include="Mono.Cecil.Mdb">
37-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
37+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
3838
</Reference>
3939
<Reference Include="Mono.Cecil.Pdb">
40-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
40+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
4141
</Reference>
4242
<Reference Include="Mono.Cecil.Rocks">
43-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
43+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
4444
</Reference>
4545
</ItemGroup>
4646
<ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" />
3+
<package id="Mono.Cecil" version="0.10.0-beta1-v2" targetFramework="net40" />
44
</packages>

src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
<ItemGroup>
3333
<Reference Include="System" />
3434
<Reference Include="Mono.Cecil">
35-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
35+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Mono.Cecil.Mdb">
38-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
38+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
3939
</Reference>
4040
<Reference Include="Mono.Cecil.Pdb">
41-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
41+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
4242
</Reference>
4343
<Reference Include="Mono.Cecil.Rocks">
44-
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
44+
<HintPath>..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
4545
</Reference>
4646
</ItemGroup>
4747
<ItemGroup>
@@ -74,4 +74,4 @@
7474
<None Include="packages.config" />
7575
</ItemGroup>
7676
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
77-
</Project>
77+
</Project>

src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ static SequencePoint LookupSource (MethodDefinition method)
198198
return null;
199199

200200
foreach (var ins in method.Body.Instructions) {
201-
if (ins.SequencePoint != null)
202-
return ins.SequencePoint;
201+
var seqPoint = method.DebugInformation.GetSequencePoint (ins);
202+
if (seqPoint != null)
203+
return seqPoint;
203204
}
204205

205206
return null;
@@ -213,7 +214,7 @@ static SequencePoint LookupSource (TypeDefinition type)
213214
continue;
214215

215216
foreach (var ins in method.Body.Instructions) {
216-
var seq = ins.SequencePoint;
217+
var seq = method.DebugInformation.GetSequencePoint (ins);
217218
if (seq == null)
218219
continue;
219220

src/Java.Interop.Tools.JavaCallableWrappers/Test/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
<HintPath>..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Mono.Cecil">
38-
<HintPath>..\..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
38+
<HintPath>..\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.dll</HintPath>
3939
</Reference>
4040
<Reference Include="Mono.Cecil.Mdb">
41-
<HintPath>..\..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
41+
<HintPath>..\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
4242
</Reference>
4343
<Reference Include="Mono.Cecil.Pdb">
44-
<HintPath>..\..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
44+
<HintPath>..\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
4545
</Reference>
4646
<Reference Include="Mono.Cecil.Rocks">
47-
<HintPath>..\..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
47+
<HintPath>..\..\..\packages\Mono.Cecil.0.10.0-beta1-v2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
4848
</Reference>
4949
</ItemGroup>
5050
<ItemGroup>
@@ -75,4 +75,4 @@
7575
<Import Project="..\..\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems" Label="Shared" Condition="Exists('..\..\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems')" />
7676
<Import Project="..\..\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('..\..\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems')" />
7777
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
78-
</Project>
78+
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" />
3+
<package id="Mono.Cecil" version="0.10.0-beta1-v2" targetFramework="net40" />
44
<package id="NUnit" version="2.6.4" targetFramework="net45" />
55
</packages>

0 commit comments

Comments
 (0)