diff --git a/README.md b/README.md index e254236f..7124f86c 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ state.Environment["add"] = new LuaFunction((context, ct) => // Set the return value to the context context.Return(arg0 + arg1); - + // If there are multiple values, you need to pass them together as follows. // context.Return(arg0, arg1); // context.Return([arg0, arg1]); @@ -459,7 +459,7 @@ public partial class LuaVector3 vector = a.vector + b.vector }; } - + [LuaMetamethod(LuaObjectMetamethod.Sub)] public static LuaVector3 Sub(LuaVector3 a, LuaVector3 b) { @@ -621,6 +621,48 @@ With `UnityStandardIO`, standard output such as `print` will be output to `Debug These are simple implementations only, so for actual use it is recommended creating your own implementations as needed. +## Development + +The repository uses the .NET SDK and can be built from the repo root. + +### Build + +```sh +dotnet build Lua.slnx -c Release +``` + +If you only want to build the NuGet package project: + +```sh +dotnet build src/Lua/Lua.csproj -c Release +``` + +### Run Tests + +```sh +dotnet test tests/Lua.Tests/Lua.Tests.csproj -c Release +``` + +### Inherited Lua Tests + +The test project includes a set of `.lua` conformance-style tests inherited from the official Lua repository. Most of them are expected to pass, but a few known cases are currently marked with the `ExpectedFailure` category in the test suite. + +To run the test project while excluding those known failures: + +```sh +dotnet test tests/Lua.Tests/Lua.Tests.csproj -c Release --filter "TestCategory!=ExpectedFailure" +``` + +This is the same filter used in GitHub Actions when packing and publishing the NuGet package. + +### Pack for NuGet + +```sh +dotnet pack src/Lua/Lua.csproj -c Release -o ./artifacts/nuget +``` + +The package version is defined in `Directory.Build.props`. After packing, the `.nupkg` file will be written to `artifacts/nuget/`. + ## Compatibility Lua-CSharp is designed with integration into .NET in mind, so there are several differences from the C implementation.