
Enables integration of MAUI with multiplatform code by generating iOS and Android bindings from shared code, offering features like generating iOS bindings from annotated source code.
This toolkit allows you to combine MAUI with Kotlin Multiplatform (KMP) by generating bindings for iOS and Android from Kotlin common code.
Currently the following features are supported:
You can configure the namespace and prefix used for generated C# bindings by adding KSP arguments in your build.gradle.kts:
ksp {
arg("maui.kmp.csharp.ios.namespace", "YourNamespace")
arg("maui.kmp.csharp.ios.frameworkPrefix", "YourPrefix")
}Parameters:
maui.kmp.csharp.ios.namespace: The namespace for generated C# bindings (required)maui.kmp.csharp.ios.frameworkPrefix: The name of the framework generated by kotlin (required)Example:
ksp {
arg("maui.kmp.csharp.ios.namespace", "MyCompany.Mobile")
arg("maui.kmp.csharp.ios.frameworkPrefix", "Native")
}This will generate C# bindings like:
namespace MyCompany.Mobile
{
interface NativeBase : ObjCRuntime.INativeObject
{
// ...
}
}The gradle plugin uses https://github.com/aasitnikov/fat-aar-android to generate fat aar file. You need to add the following to your buildscript repositories:
maven {
setUrl("https://jitpack.io")
content {
includeGroup("com.github.aasitnikov")
}
}This toolkit allows you to combine MAUI with Kotlin Multiplatform (KMP) by generating bindings for iOS and Android from Kotlin common code.
Currently the following features are supported:
You can configure the namespace and prefix used for generated C# bindings by adding KSP arguments in your build.gradle.kts:
ksp {
arg("maui.kmp.csharp.ios.namespace", "YourNamespace")
arg("maui.kmp.csharp.ios.frameworkPrefix", "YourPrefix")
}Parameters:
maui.kmp.csharp.ios.namespace: The namespace for generated C# bindings (required)maui.kmp.csharp.ios.frameworkPrefix: The name of the framework generated by kotlin (required)Example:
ksp {
arg("maui.kmp.csharp.ios.namespace", "MyCompany.Mobile")
arg("maui.kmp.csharp.ios.frameworkPrefix", "Native")
}This will generate C# bindings like:
namespace MyCompany.Mobile
{
interface NativeBase : ObjCRuntime.INativeObject
{
// ...
}
}The gradle plugin uses https://github.com/aasitnikov/fat-aar-android to generate fat aar file. You need to add the following to your buildscript repositories:
maven {
setUrl("https://jitpack.io")
content {
includeGroup("com.github.aasitnikov")
}
}