diff options
Diffstat (limited to 'tests/projects/csharp/web_project')
| -rw-r--r-- | tests/projects/csharp/web_project/.gitignore | 7 | ||||
| -rw-r--r-- | tests/projects/csharp/web_project/src/Program.cs | 8 | ||||
| -rw-r--r-- | tests/projects/csharp/web_project/test.lua | 13 | ||||
| -rw-r--r-- | tests/projects/csharp/web_project/xmake.lua | 7 |
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/projects/csharp/web_project/.gitignore b/tests/projects/csharp/web_project/.gitignore new file mode 100644 index 000000000..53e577525 --- /dev/null +++ b/tests/projects/csharp/web_project/.gitignore @@ -0,0 +1,7 @@ +.xmake/ +build/ +bin/ +obj/ +vsxmake*/ +.vs/ + diff --git a/tests/projects/csharp/web_project/src/Program.cs b/tests/projects/csharp/web_project/src/Program.cs new file mode 100644 index 000000000..7e432aaf0 --- /dev/null +++ b/tests/projects/csharp/web_project/src/Program.cs @@ -0,0 +1,8 @@ +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); + +app.MapGet("/", () => "hello web xmake!"); +app.MapGet("/health", () => Results.Ok(new { status = "ok" })); + +app.Run(); + diff --git a/tests/projects/csharp/web_project/test.lua b/tests/projects/csharp/web_project/test.lua new file mode 100644 index 000000000..d909316b7 --- /dev/null +++ b/tests/projects/csharp/web_project/test.lua @@ -0,0 +1,13 @@ +import("detect.sdks.find_dotnet") + +function test_build(t) + if is_subhost("msys") then + return t:skip("csharp not supported on msys") + end + local dotnet = find_dotnet() + if dotnet and dotnet.sdkver then + t:build() + else + return t:skip("dotnet sdk not found") + end +end diff --git a/tests/projects/csharp/web_project/xmake.lua b/tests/projects/csharp/web_project/xmake.lua new file mode 100644 index 000000000..56bcad79c --- /dev/null +++ b/tests/projects/csharp/web_project/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("webapp") + set_kind("binary") + add_rules("csharp") + add_values("csharp.sdk", "Microsoft.NET.Sdk.Web") + add_files("src/Program.cs") |
