Merge branch 'main' into examples-backport
This commit is contained in:
commit
ec620e5d17
3 changed files with 24 additions and 17 deletions
|
|
@ -7,20 +7,4 @@
|
||||||
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'Raylib-cs' And '$(RuntimeIdentifier)' == 'browser-wasm'">
|
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'Raylib-cs' And '$(RuntimeIdentifier)' == 'browser-wasm'">
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Raylib-cs 8.1.0 is not on nuget.org yet; pack locally so Examples and tests resolve the package with native runtimes. -->
|
|
||||||
<Target Name="_EnsureLocalRaylibCsPackage"
|
|
||||||
BeforeTargets="Restore"
|
|
||||||
Condition="'$(MSBuildProjectName)' != 'Raylib-cs' And Exists('$(MSBuildThisFileDirectory)Raylib-cs/Raylib-cs.csproj')">
|
|
||||||
<PropertyGroup>
|
|
||||||
<_LocalNuGetDir>$(MSBuildThisFileDirectory)nuget</_LocalNuGetDir>
|
|
||||||
<_LocalRaylibCsNupkg>$(_LocalNuGetDir)/Raylib-cs.$(RaylibCsVersion).nupkg</_LocalRaylibCsNupkg>
|
|
||||||
</PropertyGroup>
|
|
||||||
<MakeDir Directories="$(_LocalNuGetDir)" Condition="!Exists('$(_LocalNuGetDir)')"/>
|
|
||||||
<MSBuild Projects="$(MSBuildThisFileDirectory)Raylib-cs/Raylib-cs.csproj"
|
|
||||||
Targets="Restore;Pack"
|
|
||||||
Properties="Configuration=Release;PackageOutputPath=$(_LocalNuGetDir)"
|
|
||||||
RemoveProperties="RuntimeIdentifier;RuntimeIdentifiers;SelfContained;_IsPublishing"
|
|
||||||
Condition="!Exists('$(_LocalRaylibCsNupkg)') Or '$(ForceRaylibCsPack)' == 'true'"/>
|
|
||||||
</Target>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@
|
||||||
|
|
||||||
<Import Project="..\Raylib-cs\Raylib-cs.targets" Condition="'$(UseRaylibCsPackage)' != 'true'"/>
|
<Import Project="..\Raylib-cs\Raylib-cs.targets" Condition="'$(UseRaylibCsPackage)' != 'true'"/>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(UseRaylibCsPackage)' == 'true'">
|
||||||
|
<PackageReference Include="Raylib-cs" Version="$(RaylibCsVersion)"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
|
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">
|
||||||
<WasmExtraFilesToDeploy Include="Web/index.html" TargetPath="index.html"/>
|
<WasmExtraFilesToDeploy Include="Web/index.html" TargetPath="index.html"/>
|
||||||
<WasmExtraFilesToDeploy Include="Web/main.js" TargetPath="main.js"/>
|
<WasmExtraFilesToDeploy Include="Web/main.js" TargetPath="main.js"/>
|
||||||
|
|
@ -66,7 +70,7 @@
|
||||||
<WasmExtraFilesToDeploy Include="..\Raylib-cs\logo\raylib-cs.ico" TargetPath="favicon.ico"/>
|
<WasmExtraFilesToDeploy Include="..\Raylib-cs\logo\raylib-cs.ico" TargetPath="favicon.ico"/>
|
||||||
|
|
||||||
<!-- Bundle the example assets into the wasm virtual filesystem at /resources/...
|
<!-- Bundle the example assets into the wasm virtual filesystem at /resources/...
|
||||||
so examples load from "resources/..." work unchanged. -->
|
so examples loading from "resources/..." work unchanged. -->
|
||||||
<WasmFilesToIncludeInFileSystem Include="resources\**\*.*"
|
<WasmFilesToIncludeInFileSystem Include="resources\**\*.*"
|
||||||
TargetPath="resources\%(RecursiveDir)%(Filename)%(Extension)"/>
|
TargetPath="resources\%(RecursiveDir)%(Filename)%(Extension)"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
19
README.md
19
README.md
|
|
@ -65,6 +65,25 @@ otherwise the command won't work.
|
||||||
|
|
||||||
5. Start coding!
|
5. Start coding!
|
||||||
|
|
||||||
|
## Building from source
|
||||||
|
|
||||||
|
The `Examples` and `Raylib-cs.Tests` projects consume the binding as a NuGet package, and the in-repo
|
||||||
|
version may not be published on nuget.org yet. Pack it once into the local feed before the first build:
|
||||||
|
|
||||||
|
```
|
||||||
|
dotnet pack Raylib-cs -c Release -o nuget
|
||||||
|
dotnet build
|
||||||
|
```
|
||||||
|
|
||||||
|
`NuGet.config` points restore at the local `./nuget` feed, so both projects pick up the freshly packed
|
||||||
|
package. If you skip the pack step on a fresh clone, restore fails with NU1301 (the `./nuget` source
|
||||||
|
doesn't exist) or NU1102 (Raylib-cs not found) — running the pack command fixes both.
|
||||||
|
|
||||||
|
When iterating on the binding itself, note that NuGet caches the extracted package by version and
|
||||||
|
ignores repacks of the same version. After repacking, delete the old package from `./nuget` and clear
|
||||||
|
the cached copy (`dotnet nuget locals global-packages --clear`, or delete
|
||||||
|
`~/.nuget/packages/raylib-cs/<version>`) before restoring again.
|
||||||
|
|
||||||
## Hello, World!
|
## Hello, World!
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue