Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
os: [ubuntu-latest, macos-14, windows-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -57,7 +57,7 @@ jobs:
fi

- name: Setup IOS SDK
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-14'
shell: bash
run: |
IOS_SDK=$(xcrun --sdk iphoneos --show-sdk-path)
Expand All @@ -67,20 +67,21 @@ jobs:
echo "IOS_SIMULATOR_SDK=$IOS_SIMULATOR_SDK" >> $GITHUB_ENV

- name: Setup Emscripten SDK
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-14'
uses: mymindstorm/setup-emsdk@v14
with:
version: '5.0.6'
actions-cache-folder: 'emsdk-cache'

- name: Setup Android NDK
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-14'
uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
link-to-sdk: true

- name: Set Android NDK variables
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-14'
shell: bash
run: |
echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV
Expand All @@ -101,7 +102,7 @@ jobs:

- name: Build Natives
shell: bash
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-14'
working-directory: src/Flecs.NET.Native
run: |
dotnet build -c Debug -r linux-x64
Expand Down Expand Up @@ -138,7 +139,7 @@ jobs:
shell: bash
run: |
dotnet pack --property:VersionSuffix=$FlecsVersionSuffix -p:SkipNatives=true -p:BuildSelectorPackage=true

if [ '${{ github.event.inputs.nuget-registry }}' == 'NuGet' ]; then
dotnet pack --property:VersionSuffix=$FlecsVersionSuffix -p:SkipNatives=true -c Debug
dotnet pack --property:VersionSuffix=$FlecsVersionSuffix -p:SkipNatives=true -c Release
Expand All @@ -148,7 +149,7 @@ jobs:
fi

- name: Upload Artifacts
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: Nuget Packages
Expand All @@ -158,8 +159,7 @@ jobs:

- name: Push NuGet Packages
if: >
matrix.os == 'macos-13' &&
github.repository_owner == 'BeanCheeseBurrito' &&
matrix.os == 'macos-14' &&
(
(github.event_name == 'workflow_dispatch' && github.event.inputs.push-packages == 'true') ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
path = native/flecs
url = https://github.com/SanderMertens/flecs
branch = master
[submodule "submodules/Bindgen.NET"]
path = submodules/Bindgen.NET
url = https://github.com/deathbeam/Bindgen.NET.git
branch = main
6 changes: 6 additions & 0 deletions Flecs.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flecs.NET.Benchmarks", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flecs.NET.Codegen", "src\Flecs.NET.Codegen\Flecs.NET.Codegen.csproj", "{A76AE670-D7DD-47DE-8F5C-DDF7B31C030A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flecs.NET.Sourcegen", "src\Flecs.NET.Sourcegen\Flecs.NET.Sourcegen.csproj", "{8704FC32-087C-4C65-A650-71CF333CA3A3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -54,5 +56,9 @@ Global
{A76AE670-D7DD-47DE-8F5C-DDF7B31C030A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A76AE670-D7DD-47DE-8F5C-DDF7B31C030A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A76AE670-D7DD-47DE-8F5C-DDF7B31C030A}.Release|Any CPU.Build.0 = Release|Any CPU
{8704FC32-087C-4C65-A650-71CF333CA3A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8704FC32-087C-4C65-A650-71CF333CA3A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8704FC32-087C-4C65-A650-71CF333CA3A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8704FC32-087C-4C65-A650-71CF333CA3A3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
[![MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](https://github.com/SanderMertens/flecs/blob/master/LICENSE)
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Flecs.NET.Release?style=for-the-badge&color=blue)](https://www.nuget.org/packages/Flecs.NET.Release)

[Docs](https://www.flecs.dev/flecs/) · [Examples](https://github.com/BeanCheeseBurrito/Flecs.NET/tree/main/src/Flecs.NET.Examples) · [Discord](https://discord.gg/BEzP5Rgrrp)
[Docs](https://www.flecs.dev/flecs/) · [Examples](https://github.com/deathbeam/Flecs.NET/tree/main/src/Flecs.NET.Examples) · [Discord](https://discord.gg/BEzP5Rgrrp)

</div>

**Flecs.NET** is a high-level wrapper for [flecs](https://github.com/SanderMertens/flecs). Low-level bindings to the C api are included and generated with [Bindgen.NET](https://github.com/BeanCheeseBurrito/Bindgen.NET). Native libraries are cross-compiled with [Vezel-Dev's Zig Toolsets](https://github.com/vezel-dev/zig-toolsets).
**Flecs.NET** is a high-level wrapper for [flecs](https://github.com/SanderMertens/flecs). Low-level bindings to the C api are included and generated with [Bindgen.NET](https://github.com/deathbeam/Bindgen.NET). Native libraries are cross-compiled with [Vezel-Dev's Zig Toolsets](https://github.com/vezel-dev/zig-toolsets).

## Show me the code!
```csharp
Expand Down Expand Up @@ -100,16 +100,16 @@ To include both of them in your project based on your build configuration, use t
```

## GitHub Package Registry
For more up-to-date packages, development builds are available on the [GitHub package registry](https://github.com/BeanCheeseBurrito?tab=packages&repo_name=Flecs.NET). Packages are automatically uploaded on every commit to the main branch.
For more up-to-date packages, development builds are available on the [GitHub package registry](https://github.com/deathbeam?tab=packages&repo_name=Flecs.NET). Packages are automatically uploaded on every commit to the main branch.

To access development builds from your project, you first need to create a GitHub personal access token with the ``read:packages`` permission. (See [Creating a personal access token (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic))

Once you have created a personal access token, run the following command to add the GitHub feed as a new package source. Replace ``YOUR_GITHUB_USERNAME`` with your GitHub username and ``YOUR_GITHUB_TOKEN`` with your personal access token.
```bash
dotnet nuget add source --name "flecs.net" --username "YOUR_GITHUB_USERNAME" --password "YOUR_GITHUB_TOKEN" --store-password-in-clear-text "https://nuget.pkg.github.com/BeanCheeseBurrito/index.json"
dotnet nuget add source --name "flecs.net" --username "YOUR_GITHUB_USERNAME" --password "YOUR_GITHUB_TOKEN" --store-password-in-clear-text "https://nuget.pkg.github.com/deathbeam/index.json"
```

You can now reference any package from the [GitHub feed](https://github.com/BeanCheeseBurrito?tab=packages&repo_name=Flecs.NET)!
You can now reference any package from the [GitHub feed](https://github.com/deathbeam?tab=packages&repo_name=Flecs.NET)!

```console
dotnet add PROJECT package Flecs.NET.Release --version *-build.*
Expand All @@ -130,7 +130,7 @@ dotnet add PROJECT package Flecs.NET.Release --version *-build.*
___
By default, the GitHub feed will be added to your global ``nuget.config`` file and can be referenced by any project on your machine. If wish to add the feed to a single project/solution, create a ``nuget.config`` file at the root of your project/solution directory and run the following command with the ``--configfile`` option.
```bash
dotnet nuget add source --configfile "./nuget.config" --name "flecs.net" --username "YOUR_GITHUB_USERNAME" --password "YOUR_GITHUB_TOKEN" --store-password-in-clear-text "https://nuget.pkg.github.com/BeanCheeseBurrito/index.json"
dotnet nuget add source --configfile "./nuget.config" --name "flecs.net" --username "YOUR_GITHUB_USERNAME" --password "YOUR_GITHUB_TOKEN" --store-password-in-clear-text "https://nuget.pkg.github.com/deathbeam/index.json"
```
To remove the GitHub feed from your NuGet package sources, run the following command.
```bash
Expand All @@ -139,7 +139,7 @@ dotnet nuget remove source "flecs.net"
GitHub Actions workflows can be authenticated using the ``GITHUB_TOKEN`` secret.
```yaml
- name: Add GitHub source
run: dotnet nuget add source --name "flecs.net" --username "USERNAME" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text "https://nuget.pkg.github.com/BeanCheeseBurrito/index.json"
run: dotnet nuget add source --name "flecs.net" --username "USERNAME" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text "https://nuget.pkg.github.com/deathbeam/index.json"
```
> [!WARNING]
> Development feed packages may be deleted without warning to free up space.
Expand All @@ -157,7 +157,7 @@ dotnet run --project src/Flecs.NET.Examples --property:Example=Entities_Basics
### Clone the repo
Clone the repo and it's submodules.
```console
git clone --recursive https://github.com/BeanCheeseBurrito/Flecs.NET.git
git clone --recursive https://github.com/deathbeam/Flecs.NET.git
cd Flecs.NET
```
### Restore dependencies
Expand Down Expand Up @@ -188,12 +188,13 @@ Reference the project and import the native libraries. You should now be able to
```

### Running the bindings generator
Low-level bindings to the flecs C API are pre-generated and included in the [Flecs.NET.Bindings](https://github.com/BeanCheeseBurrito/Flecs.NET/tree/main/src/Flecs.NET.Bindings) project by default. If needed, you can run the following command to regenerate the bindings file.
Low-level bindings to the flecs C API are pre-generated and included in the [Flecs.NET.Bindings](https://github.com/deathbeam/Flecs.NET/tree/main/src/Flecs.NET.Bindings) project by default. If needed, you can run the following command to regenerate the bindings file.
```console
dotnet run --project src/Flecs.NET.Bindgen

```
### Running the code generator
**Flecs.NET** relies on code generation to avoid manual code duplication. If any changes are made to the [Flecs.NET.Codegen](https://github.com/BeanCheeseBurrito/Flecs.NET/tree/main/src/Flecs.NET.Codegen) project, you can run the following command to rerun the code generators. The generated files will be output to this [folder](https://github.com/BeanCheeseBurrito/Flecs.NET/tree/main/src/Flecs.NET/Generated).
**Flecs.NET** relies on code generation to avoid manual code duplication. If any changes are made to the [Flecs.NET.Codegen](https://github.com/deathbeam/Flecs.NET/tree/main/src/Flecs.NET.Codegen) project, you can run the following command to rerun the code generators. The generated files will be output to this [folder](https://github.com/deathbeam/Flecs.NET/tree/main/src/Flecs.NET/Generated).
```console
dotnet run --project src/Flecs.NET.Codegen
```
Expand Down
2 changes: 1 addition & 1 deletion native/flecs
Submodule flecs updated 695 files
Loading
Loading