You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+45-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,51 @@ Unfortunately, there are many [restrictions](https://learn.microsoft.com/dotnet/
15
15
This is where the code generator, that is at the core of Beyond.NET comes in.
16
16
The generator can target any compiled .NET assembly and generate native code bindings for all public types and APIs contained within it. It does this by loading the targeted assembly and reflecting over all of its types. Next, wrapper functions for all publicly available APIs are generated and decorated with the `UnmanagedCallersOnly` attribute which makes them callable from native code.
17
17
From there, bindings for other languages can be generated. Which language bindings are generated can be controlled by various settings but the C bindings form the basis for all other languages.
18
-
So if you're, for instance targeting Swift the call tree looks like this: Swift -> C -> C# APIs marked with the `UnmanagedCallersOnly` attribute -> Original C# API.
18
+
So if you're, for instance targeting Swift the call tree looks like this: Swift -> C -> .NET APIs marked with the `UnmanagedCallersOnly` attribute -> Original .NET API.
19
+
20
+
Since new C# code is generated as part of the language bindings, it's required to either include the single generated C# source code file in the existing .NET project you're targeting or create a new project soley for the purpose of compiling a native version of the assembly. We recommend the latter as you will need to compile your project using NativeAOT to actually take advantage of the generated bindings and that way, the original assembly stays unmodified.
21
+
22
+
23
+
## Quick Start Guide
24
+
25
+
- Make sure [.NET 8](https://dotnet.microsoft.com/download/dotnet/8.0) is installed.
26
+
- On macOS, make sure [Xcode](https://developer.apple.com/xcode/) is installed.
27
+
- Either clone the Beyond.NET repository or download one of the pre-built generator executables for your platform.
28
+
- If you do not have a pre-compiled executable of the generator, compile it by either running `dotnet publish` within its directory or use one of our provided publish scripts like `publish_macos_universal` for compiling a universal macOS binary.
29
+
- Open a terminal and execute the generator (`./beyonddotnetgen`).
30
+
- Since you've provided no arguments, the generator should show its usage screen.
31
+
- Currently, the generator takes a single required argument: `PathToConfig.json`.
32
+
- Create a [config file](#generator-config).
33
+
- Run the generator with the path to the config file as the first and only argument (`./beyonddotnetgen /Path/To/Config.json`).
34
+
- If the generator was successful it will exit with 0 as exit code and not print anything to stdout or stderr.
35
+
- If errors were encountered they'll appear in terminal.
0 commit comments