From b2aa34938b789040b83577ea26ea37ff8c1e5c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=BB=E4=BD=93?= Date: Sun, 22 Feb 2026 15:41:13 +0100 Subject: [PATCH 1/6] Fix C-interface and add UnitTests for dotnet bindings to catch these errors in the future --- .gitignore | 3 + bindings/c/c_interface.cpp | 157 +++++++++--------- bindings/dotnet/CompilerResponse.cs | 13 +- bindings/dotnet/GS2Compiler.cs | 54 +++--- .../InterfacesTests.cs | 67 ++++++++ ...nal.Scripting.GS2Compiler.UnitTests.csproj | 35 ++++ .../Preagonal.Scripting.GS2Compiler.csproj | 48 +++++- .../Preagonal.Scripting.GS2Compiler.sln | 6 + ...onal.Scripting.GS2Compiler.sln.DotSettings | 2 + bindings/dotnet/Response.cs | 19 ++- 10 files changed, 279 insertions(+), 125 deletions(-) create mode 100644 bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/InterfacesTests.cs create mode 100644 bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/Preagonal.Scripting.GS2Compiler.UnitTests.csproj create mode 100644 bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln.DotSettings diff --git a/.gitignore b/.gitignore index 9b3ee8c..64b023b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# User files +*.user + # Prerequisites *.d diff --git a/bindings/c/c_interface.cpp b/bindings/c/c_interface.cpp index d626e14..6b5483d 100644 --- a/bindings/c/c_interface.cpp +++ b/bindings/c/c_interface.cpp @@ -1,92 +1,87 @@ #include "compiler/GS2Context.h" #ifdef _WIN32 -#define DLL_EXPORT __declspec(dllexport) + #define DLL_EXPORT extern "C" __declspec(dllexport) #else -#define DLL_EXPORT + #define DLL_EXPORT extern "C" __attribute__((visibility("default"))) #endif -extern "C" { - struct Response { - bool Success; - const char *ErrMsg; - unsigned char *ByteCode; - uint32_t ByteCodeSize; - }; - - DLL_EXPORT void *get_context() { - return new GS2Context(); +struct Response { + bool Success; + const char *ErrMsg; + unsigned char *ByteCode; + uint32_t ByteCodeSize; +}; + +DLL_EXPORT void *get_context() { + return new GS2Context(); +} + +DLL_EXPORT Response compile_code_no_header(void *context, const char *code) { + Response result{}; + result.Success = false; + + if (const auto gs2Context = static_cast(context); gs2Context != nullptr) { + const std::string script = code; + std::string errMsg; + const auto response = gs2Context->compile(script); + + if (!response.errors.empty()) { + errMsg.clear(); + for (const auto &err: response.errors) + errMsg.append(err.msg()).append("\n"); + + const int lenStr = errMsg.length() + 1; + result.ErrMsg = new char[lenStr]; + strcpy(const_cast(result.ErrMsg), errMsg.c_str()); + + result.ByteCode = nullptr; + result.ByteCodeSize = 0; + } else { + result.ErrMsg = nullptr; + result.ByteCode = new unsigned char[response.bytecode.length()]; // Allocate memory + memcpy(result.ByteCode, response.bytecode.buffer(), response.bytecode.length()); + result.ByteCodeSize = response.bytecode.length(); } - - DLL_EXPORT Response compile_code_no_header(void *context, const char *code) { - Response result{}; - result.Success = false; - - auto gs2Context = (GS2Context *) context; - - if (gs2Context != nullptr) { - std::string script = code; - std::string errMsg; - auto response = gs2Context->compile(script); - - if (!response.errors.empty()) { - errMsg.clear(); - for (const auto &err: response.errors) - errMsg.append(err.msg()).append("\n"); - - int lenStr = errMsg.length() + 1; - result.ErrMsg = new char[lenStr]; - strcpy(const_cast(result.ErrMsg), errMsg.c_str()); - - result.ByteCode = nullptr; - result.ByteCodeSize = 0; - } else { - result.ErrMsg = nullptr; - result.ByteCode = new unsigned char[response.bytecode.length()]; // Allocate memory - memcpy((void *) result.ByteCode, response.bytecode.buffer(), response.bytecode.length()); - result.ByteCodeSize = response.bytecode.length(); - } - result.Success = response.success; - } - - return result; + result.Success = response.success; + } + + return result; +} + +DLL_EXPORT Response compile_code(void *context, const char *code, const char *type, const char *name) { + Response result{}; + result.Success = false; + + if (const auto gs2Context = static_cast(context); + gs2Context != nullptr) { + const std::string script = code; + std::string errMsg; + const auto response = gs2Context->compile(script, type, name, true); + + if (!response.errors.empty()) { + errMsg.clear(); + for (const auto &err: response.errors) + errMsg.append(err.msg()).append("\n"); + + const int lenStr = errMsg.length() + 1; + result.ErrMsg = new char[lenStr]; + strcpy(const_cast(result.ErrMsg), errMsg.c_str()); + + result.ByteCode = nullptr; + result.ByteCodeSize = 0; + } else { + result.ErrMsg = nullptr; + result.ByteCode = new unsigned char[response.bytecode.length()]; // Allocate memory + memcpy(result.ByteCode, response.bytecode.buffer(), response.bytecode.length()); + result.ByteCodeSize = response.bytecode.length(); } + result.Success = response.success; + } - DLL_EXPORT Response compile_code(void *context, const char *code, const char *type, const char *name) { - Response result{}; - result.Success = false; - - auto gs2Context = (GS2Context *) context; - - if (gs2Context != nullptr) { - std::string script = code; - std::string errMsg; - auto response = gs2Context->compile(script, type, name, true); - - if (!response.errors.empty()) { - errMsg.clear(); - for (const auto &err: response.errors) - errMsg.append(err.msg()).append("\n"); - - int lenStr = errMsg.length() + 1; - result.ErrMsg = new char[lenStr]; - strcpy(const_cast(result.ErrMsg), errMsg.c_str()); - - result.ByteCode = nullptr; - result.ByteCodeSize = 0; - } else { - result.ErrMsg = nullptr; - result.ByteCode = new unsigned char[response.bytecode.length()]; // Allocate memory - memcpy((void *) result.ByteCode, response.bytecode.buffer(), response.bytecode.length()); - result.ByteCodeSize = response.bytecode.length(); - } - result.Success = response.success; - } - - return result; - } + return result; +} - DLL_EXPORT void delete_context(void *context) { - delete (GS2Context *) context; - } +DLL_EXPORT void delete_context(void *context) { + delete static_cast(context); } \ No newline at end of file diff --git a/bindings/dotnet/CompilerResponse.cs b/bindings/dotnet/CompilerResponse.cs index 89345ae..665499a 100644 --- a/bindings/dotnet/CompilerResponse.cs +++ b/bindings/dotnet/CompilerResponse.cs @@ -1,9 +1,8 @@ -namespace Preagonal.Scripting.GS2Compiler +namespace Preagonal.Scripting.GS2Compiler; + +public struct CompilerResponse { - public struct CompilerResponse - { - public bool Success; - public string? ErrMsg; - public byte[] ByteCode; - } + public bool Success; + public string? ErrMsg; + public byte[] ByteCode; } \ No newline at end of file diff --git a/bindings/dotnet/GS2Compiler.cs b/bindings/dotnet/GS2Compiler.cs index 4c683f1..0f9477d 100644 --- a/bindings/dotnet/GS2Compiler.cs +++ b/bindings/dotnet/GS2Compiler.cs @@ -1,38 +1,40 @@ using System.Runtime.InteropServices; -namespace Preagonal.Scripting.GS2Compiler +namespace Preagonal.Scripting.GS2Compiler; + +public static class Interface { - public static class Interface - { - [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] - private static extern IntPtr get_context(); + [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr get_context(); - [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] - private static extern Response compile_code(IntPtr context, string? code, string? type, string? name); + [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] + private static extern Response compile_code(IntPtr context, string? code, string? type, string? name); - [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] - private static extern void delete_context(IntPtr context); + [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] + private static extern Response compile_code_no_header(IntPtr context, string? code); - public static CompilerResponse CompileCode(string? code, string? type = "weapon", string? name = "npc") - { - IntPtr context = get_context(); - Response response = compile_code(context, code, type, name); + [DllImport("gs2compiler", CallingConvention = CallingConvention.Cdecl)] + private static extern void delete_context(IntPtr context); - CompilerResponse compilerResponse = new() - { - Success = response.Success, - ErrMsg = response.ErrMsg, - }; - - if (response.ByteCodeSize > 0) - { - compilerResponse.ByteCode = new byte[response.ByteCodeSize]; - Marshal.Copy(response.ByteCode, compilerResponse.ByteCode, 0, (int)response.ByteCodeSize); - } + public static CompilerResponse CompileCode(string? code, string? type = "weapon", string? name = "npc", bool withHeader = true) + { + var context = get_context(); + var response = withHeader ? compile_code(context, code, type, name) : compile_code_no_header(context, code); - delete_context(context); + CompilerResponse compilerResponse = new() + { + Success = response.Success, + ErrMsg = response.ErrMsg, + }; - return compilerResponse; + if (response.ByteCodeSize > 0) + { + compilerResponse.ByteCode = new byte[response.ByteCodeSize]; + Marshal.Copy(response.ByteCode, compilerResponse.ByteCode, 0, (int)response.ByteCodeSize); } + + delete_context(context); + + return compilerResponse; } } \ No newline at end of file diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/InterfacesTests.cs b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/InterfacesTests.cs new file mode 100644 index 0000000..18b0105 --- /dev/null +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/InterfacesTests.cs @@ -0,0 +1,67 @@ +using Xunit; +using Xunit.Abstractions; + +namespace Preagonal.Scripting.GS2Compiler.UnitTests; + +public class InterfacesTests(ITestOutputHelper testOutputHelper) +{ + [Fact] + public void Given_script_that_is_faulty_When_compiling_Then_success_is_false_and_error_message_is_returned() + { + //Arrange + const string scriptText = + """ + //#CLIENTSIDE + function onCreated() + } + """; + + + //Act + var result = Interface.CompileCode(scriptText); + + //Assert + Assert.False(result.Success); + Assert.Equal("malformed input at line 3: \t\t\t}\n", result.ErrMsg); + } + + [Fact] + public void Given_script_that_is_correct_When_compiling_Then_success_is_true_and_bytecode_is_not_empty() + { + //Arrange + const string scriptText = + """ + //#CLIENTSIDE + function onCreated() { + } + """; + + + //Act + var result = Interface.CompileCode(scriptText); + + //Assert + Assert.True(result.Success); + Assert.NotEmpty(result.ByteCode); + } + + [Fact] + public void Given_script_that_is_correct_When_compiling_without_header_Then_success_is_true_and_bytecode_is_not_empty() + { + //Arrange + const string scriptText = + """ + //#CLIENTSIDE + function onCreated() { + } + """; + + + //Act + var result = Interface.CompileCode(scriptText, withHeader: false); + + //Assert + Assert.True(result.Success); + Assert.NotEmpty(result.ByteCode); + } +} \ No newline at end of file diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/Preagonal.Scripting.GS2Compiler.UnitTests.csproj b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/Preagonal.Scripting.GS2Compiler.UnitTests.csproj new file mode 100644 index 0000000..44300b6 --- /dev/null +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.UnitTests/Preagonal.Scripting.GS2Compiler.UnitTests.csproj @@ -0,0 +1,35 @@ + + + + net10.0 + enable + enable + + false + + default + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + \ No newline at end of file diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj index 1ebabbb..9f5ec36 100644 --- a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj @@ -12,7 +12,7 @@ 1.0.0 1.0.0 en-US - netstandard2.0 + netstandard2.1 Preagonal.Scripting.GS2Compiler Preagonal.Scripting.GS2Compiler Preagonal.Scripting.GS2Compiler @@ -26,12 +26,56 @@ true true - + + + + + + + + + + + true + + + + + libgs2compiler.so + PreserveNewest + + + + libgs2compiler.so + PreserveNewest + + + + gs2compiler.dll + PreserveNewest + + + + gs2compiler.dylib + PreserveNewest + + + + gs2compiler.dylib + PreserveNewest + + + diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln index 2d013aa..bb5ffc3 100644 --- a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Preagonal.Scripting.GS2Compiler", "Preagonal.Scripting.GS2Compiler.csproj", "{B47BCFF5-10F6-4D45-96B8-A6E2E7F40AFA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Preagonal.Scripting.GS2Compiler.UnitTests", "Preagonal.Scripting.GS2Compiler.UnitTests\Preagonal.Scripting.GS2Compiler.UnitTests.csproj", "{5C15D15C-91B0-446C-9B03-AE1440726EF8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,5 +14,9 @@ Global {B47BCFF5-10F6-4D45-96B8-A6E2E7F40AFA}.Debug|Any CPU.Build.0 = Debug|Any CPU {B47BCFF5-10F6-4D45-96B8-A6E2E7F40AFA}.Release|Any CPU.ActiveCfg = Release|Any CPU {B47BCFF5-10F6-4D45-96B8-A6E2E7F40AFA}.Release|Any CPU.Build.0 = Release|Any CPU + {5C15D15C-91B0-446C-9B03-AE1440726EF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C15D15C-91B0-446C-9B03-AE1440726EF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C15D15C-91B0-446C-9B03-AE1440726EF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C15D15C-91B0-446C-9B03-AE1440726EF8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln.DotSettings b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln.DotSettings new file mode 100644 index 0000000..9c94afc --- /dev/null +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.sln.DotSettings @@ -0,0 +1,2 @@ + + GS \ No newline at end of file diff --git a/bindings/dotnet/Response.cs b/bindings/dotnet/Response.cs index 7ca512d..5c3f159 100644 --- a/bindings/dotnet/Response.cs +++ b/bindings/dotnet/Response.cs @@ -1,11 +1,12 @@ #pragma warning disable CS0649 // Field is never assigned to, and will always have its default value -namespace Preagonal.Scripting.GS2Compiler +namespace Preagonal.Scripting.GS2Compiler; + +internal struct Response { - internal struct Response - { - public bool Success; - public string ErrMsg; - public IntPtr ByteCode; - public uint ByteCodeSize; - } -} \ No newline at end of file + public bool Success; + public string ErrMsg; + public IntPtr ByteCode; + public uint ByteCodeSize; +} + +#pragma warning restore CS0649 \ No newline at end of file From 83ca2503a0e4696f3d6850d63bc974356a0f0f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=BB=E4=BD=93?= Date: Sun, 22 Feb 2026 15:48:48 +0100 Subject: [PATCH 2/6] Add test step for dotnet bindings --- Jenkinsfile | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ee10ba0..fd748c3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -93,7 +93,7 @@ def buildStepDocker() { def split_job_name = env.JOB_NAME.split(/\/{1}/); def fixed_job_name = split_job_name[1].replace('%2F',' '); - def customImage = docker.image("mcr.microsoft.com/dotnet/sdk:9.0"); + def customImage = docker.image("mcr.microsoft.com/dotnet/sdk:10.0"); customImage.pull(); try { @@ -138,6 +138,51 @@ def buildStepDocker() { } } } + + stage("Run tests...") { + customImage.inside("-u 0") { + dir("bindings/dotnet/") { + try{ + sh("dotnet test --logger \"trx;LogFileName=../../Testing/unit_tests.xml\""); + sh("dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"); + sh("chmod 777 -R ."); + } catch(err) { + currentBuild.result = 'FAILURE' + sh("chmod 777 -R ."); + discordSend(description: "Testing Failed: ${fixed_job_name} #${env.BUILD_NUMBER}", footer: "", link: env.BUILD_URL, result: currentBuild.currentResult, title: "[${split_job_name[0]}] Tests Failed: ${fixed_job_name} #${env.BUILD_NUMBER}", webhookURL: env.GS2EMU_WEBHOOK); + notify('Build failed') + } + + archiveArtifacts ( + artifacts: 'Testing/**.xml', + fingerprint: true + ) + + withCredentials([string(credentialsId: 'PREAGONAL_GS2ENGINE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) { + sh("curl -s https://codecov.io/bash > codecov && chmod +x codecov && ./codecov -f \"Testing/unit_tests.xml\" -t ${env.CODECOV_TOKEN} && ./codecov -f \"Preagonal.Scripting.GS2Compiler.UnitTests/coverage.opencover.xml\" -t ${env.CODECOV_TOKEN}") + } + + stage("Xunit") { + xunit ( + testTimeMargin: '3000', + thresholdMode: 1, + thresholds: [ + skipped(failureThreshold: '1000'), + failed(failureThreshold: '0') + ], + tools: [MSTest( + pattern: 'Testing/**.xml', + deleteOutputFiles: true, + failIfNotNew: false, + skipNoTestFiles: true, + stopProcessingIfError: true + )], + skipPublishingChecks: false + ); + } + } + } + } def archive_date = sh ( script: 'date +"-%Y%m%d-%H%M"', @@ -266,7 +311,7 @@ killall_jobs(); parallel(branches); - def customImage = docker.image("mcr.microsoft.com/dotnet/sdk:9.0"); + def customImage = docker.image("mcr.microsoft.com/dotnet/sdk:10.0"); customImage.pull(); project.builds.each { v -> From a8b7fc5ae42fcc3230515de6a918aa3cf8f27df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=BB=E4=BD=93?= Date: Sun, 22 Feb 2026 16:01:37 +0100 Subject: [PATCH 3/6] Make sure to run the tests in debug mode --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd748c3..9f786e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -143,8 +143,8 @@ def buildStepDocker() { customImage.inside("-u 0") { dir("bindings/dotnet/") { try{ - sh("dotnet test --logger \"trx;LogFileName=../../Testing/unit_tests.xml\""); - sh("dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"); + sh("dotnet test -c Debug --logger \"trx;LogFileName=../../Testing/unit_tests.xml\""); + sh("dotnet test -c Debug /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"); sh("chmod 777 -R ."); } catch(err) { currentBuild.result = 'FAILURE' From 83ba54087c8abdd993adc053bc22be429d7aefaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=BB=E4=BD=93?= Date: Sun, 22 Feb 2026 16:11:24 +0100 Subject: [PATCH 4/6] try to fix dotnet tests --- Jenkinsfile | 4 +-- .../Preagonal.Scripting.GS2Compiler.csproj | 36 +++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f786e5..9cec600 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -143,8 +143,8 @@ def buildStepDocker() { customImage.inside("-u 0") { dir("bindings/dotnet/") { try{ - sh("dotnet test -c Debug --logger \"trx;LogFileName=../../Testing/unit_tests.xml\""); - sh("dotnet test -c Debug /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"); + sh("dotnet test -c Debug -r linux-x64 --logger \"trx;LogFileName=../../Testing/unit_tests.xml\""); + sh("dotnet test -c Debug -r linux-x64 /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"); sh("chmod 777 -R ."); } catch(err) { currentBuild.result = 'FAILURE' diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj index 9f5ec36..c5d0ede 100644 --- a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj @@ -46,36 +46,60 @@ true + + + <_Rid>$(RuntimeIdentifier) + + + <_IsLinux Condition="'$(_Rid)'=='' and '$(OS)'!='Windows_NT' and '$(MSBuildRuntimeType)'=='Core'">true + <_IsWindows Condition="'$(_Rid)'=='' and '$(OS)'=='Windows_NT'">true + + + <_ProcArch>$(PROCESSOR_ARCHITECTURE) + <_IsArm64 Condition="'$(_ProcArch)'=='ARM64' or '$(_ProcArch)'=='aarch64'">true + <_IsX64 Condition="'$(_ProcArch)'=='AMD64' or '$(_ProcArch)'=='x86_64'">true + + + <_Rid Condition="'$(_Rid)'=='' and '$(_IsWindows)'=='true' and '$(_IsX64)'=='true'">win-x64 + <_Rid Condition="'$(_Rid)'=='' and '$(_IsLinux)'=='true' and '$(_IsX64)'=='true'">linux-x64 + <_Rid Condition="'$(_Rid)'=='' and '$(_IsLinux)'=='true' and '$(_IsArm64)'=='true'">linux-arm64 + + + + + + Condition="'$(_Rid)'=='linux-x64' and Exists('cross-compile/linux-x64/libgs2compiler.so')"> libgs2compiler.so PreserveNewest + Condition="'$(_Rid)'=='linux-arm64' and Exists('cross-compile/linux-arm64/libgs2compiler.so')"> libgs2compiler.so PreserveNewest + + Condition="'$(_Rid)'=='win-x64' and Exists('cross-compile/win-x64/gs2compiler.dll')"> gs2compiler.dll PreserveNewest + + Condition="'$(_Rid)'=='osx-x64' and Exists('cross-compile/osx-x64/gs2compiler.dylib')"> gs2compiler.dylib PreserveNewest + Condition="'$(_Rid)'=='osx-arm64' and Exists('cross-compile/osx-arm64/gs2compiler.dylib')"> gs2compiler.dylib PreserveNewest - + \ No newline at end of file From 4461fe99bb0ec59072e979841e6746c903b1c396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=BB=E4=BD=93?= Date: Sun, 22 Feb 2026 17:32:25 +0100 Subject: [PATCH 5/6] Try to fix tests --- .../Preagonal.Scripting.GS2Compiler.csproj | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj index c5d0ede..2ccfec4 100644 --- a/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj +++ b/bindings/dotnet/Preagonal.Scripting.GS2Compiler.csproj @@ -47,26 +47,13 @@ - + <_Rid>$(RuntimeIdentifier) - - <_IsLinux Condition="'$(_Rid)'=='' and '$(OS)'!='Windows_NT' and '$(MSBuildRuntimeType)'=='Core'">true - <_IsWindows Condition="'$(_Rid)'=='' and '$(OS)'=='Windows_NT'">true - - - <_ProcArch>$(PROCESSOR_ARCHITECTURE) - <_IsArm64 Condition="'$(_ProcArch)'=='ARM64' or '$(_ProcArch)'=='aarch64'">true - <_IsX64 Condition="'$(_ProcArch)'=='AMD64' or '$(_ProcArch)'=='x86_64'">true - - - <_Rid Condition="'$(_Rid)'=='' and '$(_IsWindows)'=='true' and '$(_IsX64)'=='true'">win-x64 - <_Rid Condition="'$(_Rid)'=='' and '$(_IsLinux)'=='true' and '$(_IsX64)'=='true'">linux-x64 - <_Rid Condition="'$(_Rid)'=='' and '$(_IsLinux)'=='true' and '$(_IsArm64)'=='true'">linux-arm64 - - + + <_Rid Condition="'$(_Rid)'==''">$(NETCoreSdkRuntimeIdentifier) - + Date: Sun, 22 Feb 2026 17:38:46 +0100 Subject: [PATCH 6/6] Disable codecov for now --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9cec600..c1fb07e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -157,10 +157,12 @@ def buildStepDocker() { artifacts: 'Testing/**.xml', fingerprint: true ) - + + /* TODO: Enable when codecov is added to GS2Compiler project withCredentials([string(credentialsId: 'PREAGONAL_GS2ENGINE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) { sh("curl -s https://codecov.io/bash > codecov && chmod +x codecov && ./codecov -f \"Testing/unit_tests.xml\" -t ${env.CODECOV_TOKEN} && ./codecov -f \"Preagonal.Scripting.GS2Compiler.UnitTests/coverage.opencover.xml\" -t ${env.CODECOV_TOKEN}") } + */ stage("Xunit") { xunit (