From cb2a2da6b940736726bd559984a9e9a08499508a Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Sat, 28 Nov 2020 21:48:54 +0100 Subject: [PATCH 1/7] Adds appveyor.yml --- appveyor.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..afe9acf8 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,26 @@ +image: Visual Studio 2019 + +cache: +- Bin\$(configuration)\ + +before_build: + - findstr /V "{48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release" .\ReClass.NET.sln > cleaned.sln + - rm ReClass.NET.sln + - nuget restore + +platform: + - x86 + - x64 + +configuration: Release + +build: + project: cleaned.sln + verbosity: minimal + +artifacts: + - + path: Bin\$(configuration)\$(platform)\*\.exe + path: Bin\$(configuration)\$(platform)\*\.dll + name: Reclass.NET $(platform) + type: zip From 68c00b1a5384c85257a205a539b8cc7f1a6cbdb3 Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Sat, 28 Nov 2020 22:10:22 +0100 Subject: [PATCH 2/7] Fixes zip upload --- appveyor.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index afe9acf8..6e50fb70 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,9 @@ image: Visual Studio 2019 -cache: -- Bin\$(configuration)\ - before_build: - - findstr /V "{48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release" .\ReClass.NET.sln > cleaned.sln + - findstr /V "{48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release" .\ReClass.NET.sln > cleaned.sln # This removes the .Unix project from the solution another option would be to create a custom target inside the project - rm ReClass.NET.sln - - nuget restore + - nuget restore # restore nuget dependencies platform: - x86 @@ -18,9 +15,9 @@ build: project: cleaned.sln verbosity: minimal -artifacts: - - - path: Bin\$(configuration)\$(platform)\*\.exe - path: Bin\$(configuration)\$(platform)\*\.dll - name: Reclass.NET $(platform) - type: zip +after_build: + - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder + - cd Bin # CD into the bin + - set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CONFIGURATION%-%PLATFORM%.zip # Set our output archive as projectname-(Debug|Release)-(x86|x64) + - cmd: 7z a -r %BUILD_ARCHIVE% *.dll *.exe # Add all exe and dll files to our archive + - appveyor PushArtifact %BUILD_ARCHIVE% # Upload the archive as an artifact \ No newline at end of file From 547ee61172d9aa52cdfe9759a01c924233688bac Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Sat, 28 Nov 2020 22:23:39 +0100 Subject: [PATCH 3/7] Adds custom package job test --- appveyor.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6e50fb70..9f632d77 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,23 +1,39 @@ image: Visual Studio 2019 -before_build: - - findstr /V "{48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release" .\ReClass.NET.sln > cleaned.sln # This removes the .Unix project from the solution another option would be to create a custom target inside the project - - rm ReClass.NET.sln - - nuget restore # restore nuget dependencies - +environment: + matrix: + - job_name: Package + platform: - x86 - x64 configuration: Release +before_build: + - findstr /V "{48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release" .\ReClass.NET.sln > cleaned.sln # This removes the .Unix project from the solution another option would be to create a custom target inside the project + - rm ReClass.NET.sln + - nuget restore # restore nuget dependencies + +# Build the solution with the name cleaned.sln build: project: cleaned.sln verbosity: minimal +# job-specific configurations +for: + - + matrix: + only: + - job_name: Package + build_script: + - echo Job 1 + +# Package the builded files into a zip and push as artifacts after_build: - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder - - cd Bin # CD into the bin + - cd Bin # CD into Bin + - cd Release # CD into Release - set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CONFIGURATION%-%PLATFORM%.zip # Set our output archive as projectname-(Debug|Release)-(x86|x64) - cmd: 7z a -r %BUILD_ARCHIVE% *.dll *.exe # Add all exe and dll files to our archive - appveyor PushArtifact %BUILD_ARCHIVE% # Upload the archive as an artifact \ No newline at end of file From b8642cd8792217b472d329c4ad0931433342c9e0 Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Mon, 30 Nov 2020 19:34:12 +0100 Subject: [PATCH 4/7] Adds custom jobs Adds custom release and package jobs --- appveyor.yml | 73 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9f632d77..54448dd7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,38 +2,67 @@ image: Visual Studio 2019 environment: matrix: - - job_name: Package + - job_name: Windows Builds x86 + job_group: build + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + + - job_name: Windows Builds x64 + job_group: build + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + + - job_name: Build Combined + job_depends_on: build + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 -platform: - - x86 - - x64 - -configuration: Release before_build: - findstr /V "{48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Debug {48C5258A-FA49-4173-AEE5-0FCA5190DFF2}.Release" .\ReClass.NET.sln > cleaned.sln # This removes the .Unix project from the solution another option would be to create a custom target inside the project - rm ReClass.NET.sln - nuget restore # restore nuget dependencies -# Build the solution with the name cleaned.sln -build: - project: cleaned.sln - verbosity: minimal - -# job-specific configurations for: - - - matrix: - only: - - job_name: Package - build_script: - - echo Job 1 - -# Package the builded files into a zip and push as artifacts -after_build: +# ====================================== +# Build +# ====================================== +- + matrix: + only: + - job_name: Windows Builds x86 + # Build the solution with the name cleaned.sln + # Build the solution with the name cleaned.sln + build_script: + - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder + - msbuild "cleaned.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:Configuration=Release /property:Platform=x86 + +- + matrix: + only: + - job_name: Windows Builds x64 + + # Build the solution with the name cleaned.sln + build_script: + - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder + - msbuild "cleaned.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:Configuration=Release /property:Platform=x64 + + +# ====================================== +# Release +# ====================================== +- + matrix: + only: + - job_name: Build Combined + + build_script: + - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder + - msbuild "cleaned.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:Configuration=Release /property:Platform=x86 + - msbuild "cleaned.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:Configuration=Release /property:Platform=x64 + + # Package the builded files into a zip and push as artifacts + after_build: - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder - cd Bin # CD into Bin - cd Release # CD into Release - set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CONFIGURATION%-%PLATFORM%.zip # Set our output archive as projectname-(Debug|Release)-(x86|x64) - cmd: 7z a -r %BUILD_ARCHIVE% *.dll *.exe # Add all exe and dll files to our archive - - appveyor PushArtifact %BUILD_ARCHIVE% # Upload the archive as an artifact \ No newline at end of file + - appveyor PushArtifact %BUILD_ARCHIVE% # Upload the archive as an artifact From c8dd47b63a238d72afae8e2d4905de06d398ca3a Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Mon, 30 Nov 2020 19:39:26 +0100 Subject: [PATCH 5/7] Fixes project name in artifact zip --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 54448dd7..0bd6c2df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -63,6 +63,6 @@ for: - cd %APPVEYOR_BUILD_FOLDER% # CD into the cloned project folder - cd Bin # CD into Bin - cd Release # CD into Release - - set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CONFIGURATION%-%PLATFORM%.zip # Set our output archive as projectname-(Debug|Release)-(x86|x64) + - set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%.zip # Set our output archive as projectname-(Debug|Release)-(x86|x64) - cmd: 7z a -r %BUILD_ARCHIVE% *.dll *.exe # Add all exe and dll files to our archive - appveyor PushArtifact %BUILD_ARCHIVE% # Upload the archive as an artifact From 9713e0803257b04d20522b214bb41611633accf8 Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Thu, 9 Dec 2021 16:50:27 +0100 Subject: [PATCH 6/7] Update project to VS22 Update project to VS2022 --- NativeCore/Windows/NativeCore.vcxproj | 8 ++++---- appveyor.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 565980de..5715bcb4 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -28,26 +28,26 @@ DynamicLibrary true - v142 + v143 Unicode DynamicLibrary false - v142 + v143 true MultiByte DynamicLibrary true - v142 + v143 MultiByte DynamicLibrary false - v142 + v143 true MultiByte diff --git a/appveyor.yml b/appveyor.yml index 0bd6c2df..448f358a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,18 +1,18 @@ -image: Visual Studio 2019 +image: Visual Studio 2022 environment: matrix: - job_name: Windows Builds x86 job_group: build - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - job_name: Windows Builds x64 job_group: build - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - job_name: Build Combined job_depends_on: build - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 before_build: From be338b4e498d7de99c37b21ec41b42be3a03771e Mon Sep 17 00:00:00 2001 From: Artur Komaristych Date: Thu, 16 Dec 2021 21:17:18 +0100 Subject: [PATCH 7/7] Modernize switch c++ generator --- ReClass.NET/CodeGenerator/CppCodeGenerator.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs index 4cefbf8f..6140c506 100644 --- a/ReClass.NET/CodeGenerator/CppCodeGenerator.cs +++ b/ReClass.NET/CodeGenerator/CppCodeGenerator.cs @@ -563,15 +563,12 @@ private string GetTypeDefinition(BaseNode node, ILogger logger) return type; } - switch (node) + return node switch { - case ClassInstanceNode classInstanceNode: - return $"class {classInstanceNode.InnerNode.Name}"; - case EnumNode enumNode: - return enumNode.Enum.Name; - } - - return null; + ClassInstanceNode classInstanceNode => $"class {classInstanceNode.InnerNode.Name}", + EnumNode enumNode => enumNode.Enum.Name, + _ => null, + }; } ///