|
| 1 | +# The Silk.NET Contributors Guide |
| 2 | + |
| 3 | +Welcome to the Silk.NET project! We're so glad you want to help us create the best native interoperation experience that |
| 4 | +.NET has ever seen. |
| 5 | + |
| 6 | +This contributors guide covers many topics about Silk.NET's internals in great detail to help anyone pick up any part of |
| 7 | +the codebase and hit the ground running. |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +- [Getting Started (you are here!)](#getting-started) |
| 12 | +- [Build System](build-system.md) |
| 13 | + |
| 14 | + |
| 15 | +## Getting Started |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +To get started, first clone Silk.NET using `git clone https://github.com/dotnet/Silk.NET --depth 1`. Your development |
| 20 | +environment will need the latest production-ready .NET SDK, so make sure you've installed that from |
| 21 | +[get.dot.net](https://get.dot.net). We also recommend installing NUKE using `dotnet tool install -g NUKE.GlobalTool` to |
| 22 | +enable our auxiliary build commands/utilities, but this is optional and in fact can be accessed using the |
| 23 | +`./build.sh`/`.\build.cmd`/`.\build.ps1` scripts in place of `nuke` in usages in this guide without installing the tool. |
| 24 | + |
| 25 | +If you'd like to build and/or work with the mobile support in Silk.NET, you'll need to install the workloads using |
| 26 | +`dotnet workload restore`. It is highly likely you need to prefix this with `sudo` on macOS and Linux. In addition, |
| 27 | +you'll need to install the Android SDK with API 34 and API 35 support to ensure a successful build. Furthermore, on |
| 28 | +macOS you will need Xcode installed with the iOS platform installed. Alternatively, if you don't want to work with our |
| 29 | +mobile support, you can disable it for your local builds using `nuke disable-platforms --platforms android ios` for |
| 30 | +example. The acceptable values for `--platforms` are any valid platform identifiers (i.e. right-hand side of the `-` of |
| 31 | +a `TargetFramework`, without platform version information). |
| 32 | + |
| 33 | +We automatically disable iOS support on Linux, as these workloads are only available on Windows and macOS. For more |
| 34 | +information about the NUKE utilities, consult the [Build System](build-system.md) documentation or use `nuke --help`. |
| 35 | + |
| 36 | +### Building from Source |
| 37 | + |
| 38 | +Assuming you've got the prerequisites installed, `dotnet build`! Or `dotnet pack` to produce all the NuPkgs in |
| 39 | +`artifacts/pkg`. |
| 40 | + |
| 41 | +To learn more about the build system, see the [Build System](build-system.md) documentation. It is intentionally |
| 42 | +designed to be as compatible as possible with the regular `dotnet build` system such that you can use the built-in |
| 43 | +utilities of your favourite IDE. |
| 44 | + |
| 45 | +### Regenerating Bindings |
| 46 | + |
| 47 | +You can regenerate bindings using NUKE with `nuke regenerate-bindings`, but this isn't recommended. A full regeneration |
| 48 | +of Silk.NET takes a long time and has the potential to touch the vast majority of the files that make up Silk.NET and/or |
| 49 | +create loads of unrelated changes in your working tree. Instead, it is preferred to run SilkTouch manually using a |
| 50 | +command like |
| 51 | +`dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -c Release -- generator.json -s Job1 -s Job2 ...` |
| 52 | +where the values for the `-s` arguments are replaced with the job names (the keys of the `Jobs` dictionary in |
| 53 | +`generator.json` e.g. `SDL`, `OpenGL`, etc). |
| 54 | + |
| 55 | +For more information on SilkTocuh arguments, consult the [SilkTouch User Guide](../silktouch) or use |
| 56 | +`dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -- --help`. |
| 57 | + |
0 commit comments