diff --git a/.gitignore b/.gitignore
index b97d80721c..75f2abc969 100644
--- a/.gitignore
+++ b/.gitignore
@@ -473,6 +473,7 @@ src/**/build/
# Silk.NET Build System
*.gen.sln
*.gen.txt
+excluded-platforms.txt
# Silk.NET Website Generation Output
#/docs/
diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json
index 0e92b20a51..442ad86962 100644
--- a/.nuke/build.schema.json
+++ b/.nuke/build.schema.json
@@ -27,6 +27,8 @@
"Clean",
"Compile",
"DeclareApi",
+ "DisablePlatforms",
+ "FinishRelease",
"Pack",
"Prerequisites",
"PushToNuGet",
@@ -134,6 +136,10 @@
"Release"
]
},
+ "DiscordWebhook": {
+ "type": "string",
+ "description": "Discord release announcement webhook"
+ },
"MsbuildProperties": {
"type": "array",
"description": "Extra properties passed to MSBuild commands",
@@ -161,6 +167,13 @@
"type": "string",
"description": "NuGet username"
},
+ "Platforms": {
+ "type": "array",
+ "description": "A list of platforms that DisablePlatforms should exclude from MSBuild usages, both inside and outside of NUKE. This can be reset by running DisablePlatforms with no platforms, or by deleting the excluded-platforms.txt file",
+ "items": {
+ "type": "string"
+ }
+ },
"SilkTouchAdditionalArgs": {
"type": "array",
"description": "Additional arguments to prepend to SilkTouch invocations",
diff --git a/Directory.Build.props b/Directory.Build.props
index 28890ca2d8..bf5682339b 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -77,4 +77,15 @@
true
snupkg
+
+
+
+ $([System.IO.File]::ReadAllText("$(MSBuildThisFileDirectory)excluded-platforms.txt"))
+ $(SilkExcludedPlatforms) ios tvos mac maccatalyst
+ true
+ true
+ true
+ true
+ true
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 7d0da4f662..b2e5050aa6 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -201,7 +201,7 @@
-
+
@@ -260,4 +260,14 @@
Condition="'$(IncludeBuildOutput)' == 'false'" />
+
+
+
+
+
+
+
+
diff --git a/docs/for-contributors/README.md b/docs/for-contributors/README.md
new file mode 100644
index 0000000000..f681d2a239
--- /dev/null
+++ b/docs/for-contributors/README.md
@@ -0,0 +1,57 @@
+# The Silk.NET Contributors Guide
+
+Welcome to the Silk.NET project! We're so glad you want to help us create the best native interoperation experience that
+.NET has ever seen.
+
+This contributors guide covers many topics about Silk.NET's internals in great detail to help anyone pick up any part of
+the codebase and hit the ground running.
+
+## Table of Contents
+
+- [Getting Started (you are here!)](#getting-started)
+- [Build System](build-system.md)
+
+
+## Getting Started
+
+### Prerequisites
+
+To get started, first clone Silk.NET using `git clone https://github.com/dotnet/Silk.NET --depth 1`. Your development
+environment will need the latest production-ready .NET SDK, so make sure you've installed that from
+[get.dot.net](https://get.dot.net). We also recommend installing NUKE using `dotnet tool install -g NUKE.GlobalTool` to
+enable our auxiliary build commands/utilities, but this is optional and in fact can be accessed using the
+`./build.sh`/`.\build.cmd`/`.\build.ps1` scripts in place of `nuke` in usages in this guide without installing the tool.
+
+If you'd like to build and/or work with the mobile support in Silk.NET, you'll need to install the workloads using
+`dotnet workload restore`. It is highly likely you need to prefix this with `sudo` on macOS and Linux. In addition,
+you'll need to install the Android SDK with API 34 and API 35 support to ensure a successful build. Furthermore, on
+macOS you will need Xcode installed with the iOS platform installed. Alternatively, if you don't want to work with our
+mobile support, you can disable it for your local builds using `nuke disable-platforms --platforms android ios` for
+example. The acceptable values for `--platforms` are any valid platform identifiers (i.e. right-hand side of the `-` of
+a `TargetFramework`, without platform version information).
+
+We automatically disable iOS support on Linux, as these workloads are only available on Windows and macOS. For more
+information about the NUKE utilities, consult the [Build System](build-system.md) documentation or use `nuke --help`.
+
+### Building from Source
+
+Assuming you've got the prerequisites installed, `dotnet build`! Or `dotnet pack` to produce all the NuPkgs in
+`artifacts/pkg`.
+
+To learn more about the build system, see the [Build System](build-system.md) documentation. It is intentionally
+designed to be as compatible as possible with the regular `dotnet build` system such that you can use the built-in
+utilities of your favourite IDE.
+
+### Regenerating Bindings
+
+You can regenerate bindings using NUKE with `nuke regenerate-bindings`, but this isn't recommended. A full regeneration
+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
+create loads of unrelated changes in your working tree. Instead, it is preferred to run SilkTouch manually using a
+command like
+`dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -c Release -- generator.json -s Job1 -s Job2 ...`
+where the values for the `-s` arguments are replaced with the job names (the keys of the `Jobs` dictionary in
+`generator.json` e.g. `SDL`, `OpenGL`, etc).
+
+For more information on SilkTocuh arguments, consult the [SilkTouch User Guide](../silktouch) or use
+`dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -- --help`.
+
diff --git a/docs/for-contributors/build-system.md b/docs/for-contributors/build-system.md
index 09b72db789..d6edd205fb 100644
--- a/docs/for-contributors/build-system.md
+++ b/docs/for-contributors/build-system.md
@@ -6,6 +6,15 @@ library itself that are provided by a auxiliary build system implemented using t
## MSBuild Usage
+### Target Frameworks
+
+It is our goal to always target the latest LTS .NET release, and optionally multi-targeting to the next non-LTS version
+thereafter. We also make use of the mobile frameworks e.g. `net8.0-android`, `net8.0-ios`, but these shall always be
+guarded using properties such as `SilkAndroidDisabled`, `SilkiOSDisabled` etc which are set in `Directory.Build.props`,
+which in turn check whether a file named `excluded-platforms.txt` exists and contains the target platform identifier.
+This can be quickly modified by using the NUKE target `nuke disable-platforms`, which just writes to this file the
+values provided for `--platforms`.
+
### Package READMEs
NuGet has recently added functionality to include a "README" rendered from Markdown on the front page of a package in
@@ -160,6 +169,21 @@ automatically, however in some cases there are specific linker flags required wh
The `.targets` injected can be seen at `eng/native/nuget/NativeNuGetPackage.targets` with the `TO_BE_REPLACED`
placeholders replaced in `Directory.Build.targets`.
+Obviously, the native packages only work when consumed as a NuGet. However, we have a "best effort" attempt to copy the
+appropriate native binary to the output directory for projects that `ProjectReference` a native binary, whether directly
+or transitively. To make this work however, projects must include this:
+```xml
+
+
+ $(NETCoreSdkRuntimeIdentifier)
+
+
+```
+
+This logic is defined in the `SilkProjectReferenceNatives` target in `Directory.Build.targets`.
+
+We currently have not explored doing this for static linking (i.e. iOS) builds.
+
## Native Build Workflow
As mentioned previously, we build all of our native binaries in CI to ensure they come from a trusted source and also to
diff --git a/eng/build/Build.cs b/eng/build/Build.cs
index 3bea6f3031..71b95c9b92 100644
--- a/eng/build/Build.cs
+++ b/eng/build/Build.cs
@@ -2,6 +2,7 @@
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.Tools.DotNet;
+using Nuke.Common.Utilities;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
partial class Build : NukeBuild
@@ -112,4 +113,22 @@ out var releaseNotes
await SendWebhookAsync(version, versionSuffix, releaseNotes);
})
);
+
+ [Parameter(
+ $"A list of platforms that {nameof(DisablePlatforms)} should exclude from MSBuild usages, both "
+ + $"inside and outside of NUKE. This can be reset by running {nameof(DisablePlatforms)} with no platforms, "
+ + $"or by deleting the excluded-platforms.txt file."
+ )]
+ readonly string[]? Platforms;
+
+ Target DisablePlatforms =>
+ CommonTarget(x =>
+ x.Executes(
+ () =>
+ File.WriteAllText(
+ RootDirectory / "excluded-platforms.txt",
+ (Platforms ?? []).Join(' ')
+ )
+ )
+ );
}
diff --git a/sources/Playground/Playground.csproj b/sources/Playground/Playground.csproj
index 05760ab6bf..8752ac2ed3 100644
--- a/sources/Playground/Playground.csproj
+++ b/sources/Playground/Playground.csproj
@@ -5,6 +5,7 @@
net8.0
enable
enable
+ $(NETCoreSdkRuntimeIdentifier)
diff --git a/sources/Playground/libSDL3.dylib b/sources/Playground/libSDL3.dylib
deleted file mode 100644
index c614ebf0c0..0000000000
Binary files a/sources/Playground/libSDL3.dylib and /dev/null differ
diff --git a/sources/SDL/Native/Silk.NET.SDL.Native.csproj b/sources/SDL/Native/Silk.NET.SDL.Native.csproj
index cf694ad540..d46e7ce41f 100644
--- a/sources/SDL/Native/Silk.NET.SDL.Native.csproj
+++ b/sources/SDL/Native/Silk.NET.SDL.Native.csproj
@@ -1,7 +1,8 @@
- net8.0;net8.0-android
+ net8.0
+ $(TargetFrameworks);net8.0-android
Native binaries for SDL3.
true
true
diff --git a/sources/SDL/SDL/Silk.NET.SDL.csproj b/sources/SDL/SDL/Silk.NET.SDL.csproj
index 39c9fb9abd..0581ecbe19 100644
--- a/sources/SDL/SDL/Silk.NET.SDL.csproj
+++ b/sources/SDL/SDL/Silk.NET.SDL.csproj
@@ -7,6 +7,7 @@
+