Skip to content

Commit 439bd83

Browse files
jpobstjonpryor
authored andcommitted
[XA.Tools.Bytecode] Add Kotlin support to our binding process. (#505)
Context: #525 Various fixes and enhancements to allow better default Kotlin libraries bindings: * Hide Kotlin-internal classes, constructors, and methods. * Hide implementation methods (`*-impl*`). * Rename extension method parameter like `$this$decodeBase64` to `obj`. * Use Kotlin provided method parameter names instead of `p0`, `p1`, etc. * Rename any method with a `-<mangling>` to drop the invalid part, e.g. `add-H4uI21a` is bound as `add`. ("Name mangling" like this is how Kotlin ensures `add(UInt)` and `add(Int)` don't clash when compiled to [Java][1].) Note that the final bullet point -- "removing" name mangling -- may result in C# code which is either not valid or not entirely usable. See Issue #525 for details. This will be addressed "later". [1]: https://kotlinlang.org/docs/reference/inline-classes.html#mangling
1 parent 5fa8c18 commit 439bd83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1121
-106
lines changed

src/Xamarin.Android.Tools.Bytecode/ClassFile.cs

+2
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ public bool IsStatic {
186186
public bool IsEnum {
187187
get {return (AccessFlags & ClassAccessFlags.Enum) != 0;}
188188
}
189+
190+
public override string ToString () => ThisClass?.Name.Value;
189191
}
190192

191193
[Flags]

src/Xamarin.Android.Tools.Bytecode/ClassPath.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
44
using System.IO;
@@ -8,7 +8,6 @@
88
using System.Xml.Linq;
99
using System.Xml.XPath;
1010
using System.Text;
11-
using Xamarin.Android.Tools.Bytecode.Kotlin;
1211

1312
namespace Xamarin.Android.Tools.Bytecode {
1413

0 commit comments

Comments
 (0)