This commit is contained in:
parent
58b4756ae9
commit
36201820b5
52
README.md
52
README.md
|
@ -3,11 +3,13 @@
|
||||||
In [CCCB](https://berlin.ccc.de/), there is a big pixel matrix hanging on the wall. It is called "Service Point
|
In [CCCB](https://berlin.ccc.de/), there is a big pixel matrix hanging on the wall. It is called "Service Point
|
||||||
Display" or "Airport Display".
|
Display" or "Airport Display".
|
||||||
|
|
||||||
This crate contains bindings for multiple programming languages, enabling non-rust-developers to use the library.
|
This crate contains C# bindings for the [servicepoint](https://git.berlin.ccc.de/servicepoint/servicepoint) library based on [servicepoint-binding-uniffi](https://git.berlin.ccc.de/servicepoint/servicepoint-binding-uniffi).
|
||||||
|
|
||||||
Also take a look at the main project [README](https://git.berlin.ccc.de/servicepoint/servicepoint/src/branch/main/README.md) for more
|
Also take a look at the main project [README](https://git.berlin.ccc.de/servicepoint/servicepoint/src/branch/main/README.md) for more
|
||||||
information.
|
information.
|
||||||
|
|
||||||
|
F# is not tested. If there are usability or functionality problems, please open an issue.
|
||||||
|
|
||||||
## Note on stability
|
## Note on stability
|
||||||
|
|
||||||
This library is still in early development.
|
This library is still in early development.
|
||||||
|
@ -21,43 +23,29 @@ You can absolutely use it, and it works, but expect minor breaking changes with
|
||||||
- You will not get rust backtraces in release builds of the native code
|
- You will not get rust backtraces in release builds of the native code
|
||||||
- Panic messages will work (PanicException)
|
- Panic messages will work (PanicException)
|
||||||
|
|
||||||
## Supported languages
|
|
||||||
|
|
||||||
| Language | Support level | Notes |
|
|
||||||
|-----------|---------------|-------------------------------------------------------------------------------------------------|
|
|
||||||
| .NET (C#) | Full | see dedicated section |
|
|
||||||
| Ruby | Working | LD_LIBRARY_PATH has to be set, see example project |
|
|
||||||
| Python | Tested once | Required project file not included. The shared library will be loaded from the script location. |
|
|
||||||
| Go | untested | |
|
|
||||||
| Kotlin | untested | |
|
|
||||||
| Swift | untested | |
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Including this repository as a submodule and building from source is the recommended way of using the library.
|
Including this repository as a submodule and building from source is the recommended way of using the library.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git submodule add https://git.berlin.ccc.de/servicepoint/servicepoint.git
|
git submodule add https://git.berlin.ccc.de/servicepoint/servicepoint-binding-csharp.git
|
||||||
git commit -m "add servicepoint submodule"
|
git commit -m "add servicepoint-binding-csharp submodule"
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `generate-bindings.sh` to regenerate all bindings. This will also build `libservicepoint.so` (or equivalent on your
|
After that, add a reference to the ServicePoint project in your `.csproj` and, if applicable, your `.sln`.
|
||||||
platform).
|
```xml
|
||||||
|
<ItemGroup>
|
||||||
For languages not fully supported, there will be no project file for the library, just the naked source file(s).
|
<ProjectReference Include="servicepoint-binding-csharp/ServicePoint/ServicePoint.csproj"/>
|
||||||
If you successfully use a language, please open an issue or PR to add the missing ones.
|
</ItemGroup>
|
||||||
|
```
|
||||||
## .NET (C#)
|
|
||||||
|
|
||||||
This is the best supported language.
|
|
||||||
|
|
||||||
F# is not tested. If there are usability or functionality problems, please open an issue.
|
|
||||||
|
|
||||||
Currently, the project file is hard-coded for Linux and will need tweaks for other platforms (e.g. `.dylib` instead of `.so`).
|
|
||||||
|
|
||||||
|
That's it!
|
||||||
You do not have to compile or copy the rust crate manually, as building `ServicePoint.csproj` also builds it.
|
You do not have to compile or copy the rust crate manually, as building `ServicePoint.csproj` also builds it.
|
||||||
|
|
||||||
### Example
|
Currently, the project file is hard-coded for Linux and will need tweaks for other platforms (e.g. `.dylib` instead of `.so`).
|
||||||
|
Feel free to open an issue or a PR with whatever you OS expects.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -83,8 +71,14 @@ for (ulong offset = 0; offset < ulong.MaxValue; offset++)
|
||||||
|
|
||||||
A full example including project files is available as part of this crate.
|
A full example including project files is available as part of this crate.
|
||||||
|
|
||||||
### Why is there no NuGet-Package?
|
## Why is there no NuGet-Package?
|
||||||
|
|
||||||
NuGet packages are not a good way to distribute native
|
NuGet packages are not a good way to distribute native
|
||||||
binaries ([relevant issue](https://github.com/dotnet/sdk/issues/33845)).
|
binaries ([relevant issue](https://github.com/dotnet/sdk/issues/33845)).
|
||||||
Because of that, there is no NuGet package you can use directly.
|
Because of that, there is no NuGet package you can use directly.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Run `./generate-binding.sh` to regenerate the base library.
|
||||||
|
The generated source file is checked in.
|
||||||
|
The CI enforces that generated bindings do not change.
|
||||||
|
|
Loading…
Reference in a new issue