Skip to content

Commit c825dca

Browse files
authored
[Java.Interop.Tools.JavaCallableWrappers] Refactor (#1174)
Context: #540 Refactor `Java.Interop.Tools.JavaCallableWrappers` to be more maintainable and modular. Adopts the same architecture as `generator`: using a `CecilImporter` to import data from a compiled assembly into an intermediate model. Java code is then generated from the intermediate model. Refactoring and updating this code should make it not only more maintainable, but also easier to extend with potential upcoming features we are considering: - Moving `jcw-gen` into the `ILLink` pipeline - [Sanity-check Java Callable Wrappers][0] - Possibly creating a Kotlin backend [0]: dotnet/android#4278
1 parent ae65609 commit c825dca

File tree

20 files changed

+1487
-1208
lines changed

20 files changed

+1487
-1208
lines changed

src/Java.Interop.Tools.Diagnostics/Java.Interop.Tools.Diagnostics/Diagnostic.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Diagnostics;
6-
6+
using System.Diagnostics.CodeAnalysis;
77
using Mono.Cecil.Cil;
88

99
namespace Java.Interop.Tools.Diagnostics {
@@ -148,6 +148,7 @@ namespace Java.Interop.Tools.Diagnostics {
148148
//
149149

150150
public static class Diagnostic {
151+
[DoesNotReturn]
151152
public static void Error (int code, SequencePoint? location, string message, params object[] args)
152153
{
153154
throw new XamarinAndroidException (code, message, args) {
@@ -156,11 +157,13 @@ public static void Error (int code, SequencePoint? location, string message, par
156157
}
157158

158159

160+
[DoesNotReturn]
159161
public static void Error (int code, string message, params object[] args)
160162
{
161163
throw new XamarinAndroidException (code, message, args);
162164
}
163165

166+
[DoesNotReturn]
164167
public static void Error (int code, Exception innerException, string message, params object[] args)
165168
{
166169
throw new XamarinAndroidException (code, innerException, message, args);

0 commit comments

Comments
 (0)