From 83f80d38b5705dd757e5e7d2ae9cde75b551a3e9 Mon Sep 17 00:00:00 2001 From: Ashton Meuser Date: Wed, 25 Mar 2026 15:34:13 -0700 Subject: [PATCH 1/3] Document build & test --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) 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. From 85c4dfbc95c298eb249eee6d9c102b8daf0d269c Mon Sep 17 00:00:00 2001 From: Ashton Meuser Date: Mon, 4 May 2026 08:52:51 -0700 Subject: [PATCH 2/3] Move dev docs to CONTRIBUTING.md --- CONTRIBUTING.md | 41 +++++++++++++++++++++++++++++++++++++++++ README.md | 44 +------------------------------------------- 2 files changed, 42 insertions(+), 43 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..147398de --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,41 @@ +## 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/`. diff --git a/README.md b/README.md index 7124f86c..b4140284 100644 --- a/README.md +++ b/README.md @@ -621,48 +621,6 @@ 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. @@ -688,4 +646,4 @@ While `collectgarbage()` is available, it simply calls the corresponding .NET ga ## License -Lua-CSharp is licensed under the [MIT License](LICENSE). \ No newline at end of file +Lua-CSharp is licensed under the [MIT License](LICENSE). From 01845d76e9d0a48c43330f65f1fa23de01424e33 Mon Sep 17 00:00:00 2001 From: Ashton Meuser Date: Mon, 4 May 2026 08:57:39 -0700 Subject: [PATCH 3/3] Add contributing preamble --- CONTRIBUTING.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 147398de..296ebfd5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,49 @@ +# Contributing + +Thanks for helping improve Lua-CSharp. This project is a Lua interpreter and C# interop library for .NET and Unity, so changes should keep correctness, performance, and AOT-friendly behavior in mind. + +## Pull Requests + +1. Fork the repository and create your branch from `main`. +2. Keep changes focused. Separate unrelated fixes or refactors into separate pull requests. +3. Add or update tests when changing runtime behavior, source generation, standard libraries, or public APIs. +4. Run the relevant test suite locally before opening a pull request: + + ```sh + dotnet test + ``` + + For focused changes, you can run a narrower filter, for example: + + ```sh + dotnet test tests/Lua.Tests/Lua.Tests.csproj --filter LuaObjectTests + ``` + +5. Update documentation when changing public behavior or user-facing APIs. +6. Address review feedback promptly. + +## Bug Fixes + +When fixing a bug, please include: + +- A short description of the problem. +- A test that fails before the fix and passes after it, when practical. +- Notes about any compatibility or performance impact. + +## Issues + +Use GitHub issues for bug reports, feature requests, and design discussions. Please include enough detail to reproduce the problem: + +- Lua-CSharp version or commit. +- .NET/runtime version. +- Unity version, if applicable. +- Minimal C# and Lua code that demonstrates the issue. +- Expected behavior and actual behavior. + +## License + +By contributing, you agree that your contributions will be licensed under the MIT license in the root `LICENSE` file. + ## Development The repository uses the .NET SDK and can be built from the repo root.