feat/full-build-script #1
49
README.md
49
README.md
@ -1,18 +1,55 @@
|
|||||||
# CSharp to Flutter
|
# CSharp to Flutter
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
All the following tools must be in your `PATH` :
|
||||||
|
|
||||||
|
* All platforms
|
||||||
|
+ [Bash >= 4.0](https://www.gnu.org/software/bash/)
|
||||||
|
+ [BeyondNetGen](https://github.com/royalapplications/beyondnet)
|
||||||
|
+ [Android NDK](https://developer.android.com/ndk/downloads) if you want to build for Android
|
||||||
|
* MacOS
|
||||||
|
+ [XCode](https://developer.apple.com/xcode/) if you want to build for iOS
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
Simply run the build script
|
Simply run the build script
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./build.sh
|
./build.sh -i MyLib.Managed
|
||||||
|
```
|
||||||
|
|
||||||
|
More advanced usage:
|
||||||
|
|
||||||
|
> Context: You want to build a library named `AwesomeFeature` for Android only, and you have the Android NDK installed in `$ANDROID_NDK_ROOT` but not in `$ANDROID_NDK_HOME`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build.sh -i AwesomeFeature --ndk $ANDROID_NDK_ROOT --no-ios
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```shell-session
|
||||||
|
Usage: ./build.sh [options]
|
||||||
|
Options:
|
||||||
|
-h, --help Print this help and exit
|
||||||
|
-i Input project name (required)
|
||||||
|
-g Generated project name (default: <input-project-name>.Generated)
|
||||||
|
-o Output folder name (default: libs)
|
||||||
|
--ndk Android NDK path (default: ANDROID_NDK_HOME environment variable)
|
||||||
|
--no-android Disable Android build (default: false)
|
||||||
|
--no-ios Disable iOS build (default: false)
|
||||||
```
|
```
|
||||||
|
|
||||||
## What is this?
|
## What is this?
|
||||||
|
|
||||||
This script:
|
This script:
|
||||||
- Run `dotnet publish` on the CoreRT managed library to get intermediate dlls
|
* Run `dotnet publish` on the CoreRT managed library to get intermediate dlls
|
||||||
- Run `beyondnetgen` to generate the C header file and the *unmanaged* csharp code
|
* Copy configuration files templates
|
||||||
- Run `dotnet publish` on the *unmanaged* csharp code for the target platforms.
|
* Android:
|
||||||
- Copy the header file and the libs to the flutter project
|
* Run `beyondnetgen` to generate the C header file and the *unmanaged* csharp code
|
||||||
- Run `ffigen` to generate the dart bindings against the header file
|
* Build a complete intermediate csproject with the *unmanaged* csharp code and the generated header file
|
||||||
|
* Run `dotnet publish` on the *unmanaged* csharp code for the target platforms.
|
||||||
|
* iOS:
|
||||||
|
* Run `beyondnetgen` and follow full process to get xframework
|
||||||
|
* Copy the generated files to the output folder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user