This commit is contained in:
parent
66b650032a
commit
8c3426ee7e
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
|
||||
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
|
||||
information.
|
||||
|
||||
F# is not tested. If there are usability or functionality problems, please open an issue.
|
||||
|
||||
## Note on stability
|
||||
|
||||
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
|
||||
- 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
|
||||
|
||||
Including this repository as a submodule and building from source is the recommended way of using the library.
|
||||
|
||||
```bash
|
||||
git submodule add https://git.berlin.ccc.de/servicepoint/servicepoint.git
|
||||
git commit -m "add servicepoint submodule"
|
||||
git submodule add https://git.berlin.ccc.de/servicepoint/servicepoint-binding-csharp.git
|
||||
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
|
||||
platform).
|
||||
|
||||
For languages not fully supported, there will be no project file for the library, just the naked source file(s).
|
||||
If you successfully use a language, please open an issue or PR to add the missing ones.
|
||||
|
||||
## .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`).
|
||||
After that, add a reference to the ServicePoint project in your `.csproj` and, if applicable, your `.sln`.
|
||||
```xml
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="servicepoint-binding-csharp/ServicePoint/ServicePoint.csproj"/>
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
That's 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
|
||||
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.
|
||||
|
||||
### Why is there no NuGet-Package?
|
||||
## Why is there no NuGet-Package?
|
||||
|
||||
NuGet packages are not a good way to distribute native
|
||||
binaries ([relevant issue](https://github.com/dotnet/sdk/issues/33845)).
|
||||
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