From 0930cfab96edf82f4bdd3f1d6162aaf97896d82d Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 15:18:35 -0700 Subject: [PATCH 01/10] Create msbuild.yml --- .github/workflows/msbuild.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/msbuild.yml diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml new file mode 100644 index 0000000000..921f09eb93 --- /dev/null +++ b/.github/workflows/msbuild.yml @@ -0,0 +1,44 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: MSBuild + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + + # Configuration type to build. + # You can convert this to a build matrix if you need coverage of multiple configuration types. + # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + BUILD_CONFIGURATION: Release + +permissions: + contents: read + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Restore NuGet packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + - name: Build + working-directory: ${{env.GITHUB_WORKSPACE}} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} From 573e683a6eb363888ad4f2a6eb506708e5d8e4c4 Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 16:57:04 -0700 Subject: [PATCH 02/10] Update working-directory in msbuild.yml to use github.workspace --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 921f09eb93..9c7e236f1a 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -38,7 +38,7 @@ jobs: run: nuget restore ${{env.SOLUTION_FILE_PATH}} - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{github.workspace}} # Add additional options to the MSBuild command line here (like platform or verbosity level). # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} From 27d0cd63ea0fd5405f2bc24b4fbf174da1f5bf8e Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 15:22:16 -0700 Subject: [PATCH 03/10] Update branches in msbuild.yml --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 9c7e236f1a..7ea7843291 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -7,7 +7,7 @@ name: MSBuild on: push: - branches: [ "master" ] + branches: [ "master", "feature/msbuild" ] pull_request: branches: [ "master" ] From 8aa47915ba0ef633a0b65e42c8fb14c50693ae94 Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 15:25:25 -0700 Subject: [PATCH 04/10] Comment out Restore NuGet packages step in msbuild.yml --- .github/workflows/msbuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 7ea7843291..b4cf7a578f 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -33,9 +33,9 @@ jobs: - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.0.2 - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} + # - name: Restore NuGet packages + # working-directory: ${{env.GITHUB_WORKSPACE}} + # run: nuget restore ${{env.SOLUTION_FILE_PATH}} - name: Build working-directory: ${{github.workspace}} From 3734cf0e290aeb5e5565eaf7b5b8753177b81b9c Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 15:29:22 -0700 Subject: [PATCH 05/10] Add step for creategameprojects.bat in msbuild.yml --- .github/workflows/msbuild.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index b4cf7a578f..ad49ecf8a6 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -37,6 +37,10 @@ jobs: # working-directory: ${{env.GITHUB_WORKSPACE}} # run: nuget restore ${{env.SOLUTION_FILE_PATH}} + - working-directory: ./mp/src + shell: cmd + run: creategameprojects.bat + - name: Build working-directory: ${{github.workspace}} # Add additional options to the MSBuild command line here (like platform or verbosity level). From 113b682d18e9d35d0a1affa1282475f9bfadb5d8 Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 15:37:42 -0700 Subject: [PATCH 06/10] Create DefaultProjectExtension.reg --- .github/workflows/DefaultProjectExtension.reg | Bin 0 -> 394 bytes .github/workflows/msbuild.yml | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 .github/workflows/DefaultProjectExtension.reg diff --git a/.github/workflows/DefaultProjectExtension.reg b/.github/workflows/DefaultProjectExtension.reg new file mode 100644 index 0000000000000000000000000000000000000000..079d621bd4eae3a503f02f6ab5f413b7cf19440a GIT binary patch literal 394 zcmY+AK}*9x6okLC;D0E&M~p_P2M@K4C|Z>&1~F1fjZ!I%G*v6&U$=f)>OsP0_szU{ zGrOywoCz}?sraC##ekA$v6=;QK1DLwiB)CY;#PhxJF%Ww@3F0Om+G1nXwcreW$ Date: Sun, 1 Dec 2024 15:46:58 -0700 Subject: [PATCH 07/10] Update SOLUTION_FILE_PATH in msbuild.yml --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index e14692e8de..c9b012e9c5 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -13,7 +13,7 @@ on: env: # Path to the solution file relative to the root of the project. - SOLUTION_FILE_PATH: . + SOLUTION_FILE_PATH: ./mp/src/games.sln # Configuration type to build. # You can convert this to a build matrix if you need coverage of multiple configuration types. From e53a8f64d12078ee63d9be16ab872b05c6d11f2a Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 16:43:25 -0700 Subject: [PATCH 08/10] Create fixsln.sh Fixes solution files after they are generated by devtools/bin/vpc. --- .github/workflows/msbuild.yml | 4 ++++ mp/src/devtools/fixsln.sh | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 mp/src/devtools/fixsln.sh diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index c9b012e9c5..803d30508a 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -43,6 +43,10 @@ jobs: shell: cmd run: creategameprojects.bat + - working-directory: ./mp/src + shell: bash + run: ./devtools/fixsln.sh games.sln + - name: Build working-directory: ${{github.workspace}} # Add additional options to the MSBuild command line here (like platform or verbosity level). diff --git a/mp/src/devtools/fixsln.sh b/mp/src/devtools/fixsln.sh new file mode 100644 index 0000000000..41cdda156f --- /dev/null +++ b/mp/src/devtools/fixsln.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +Global=$(cat << 'EOF' +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Debug|Win32.ActiveCfg = Debug|Win32 + {17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Debug|Win32.Build.0 = Debug|Win32 + {17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Release|Win32.ActiveCfg = Release|Win32 + {17BCE59A-9037-EC8D-433E-F81339E2F1BA}.Release|Win32.Build.0 = Release|Win32 + {BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Debug|Win32.ActiveCfg = Debug|Win32 + {BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Debug|Win32.Build.0 = Debug|Win32 + {BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Release|Win32.ActiveCfg = Release|Win32 + {BAB92FF0-D72A-D7E5-1988-74628D39B94F}.Release|Win32.Build.0 = Release|Win32 + {95D67225-8415-236F-9128-DCB171B7DEC6}.Debug|Win32.ActiveCfg = Debug|Win32 + {95D67225-8415-236F-9128-DCB171B7DEC6}.Debug|Win32.Build.0 = Debug|Win32 + {95D67225-8415-236F-9128-DCB171B7DEC6}.Release|Win32.ActiveCfg = Release|Win32 + {95D67225-8415-236F-9128-DCB171B7DEC6}.Release|Win32.Build.0 = Release|Win32 + {33B7DFDC-BECB-3678-1190-6C951E393EB3}.Debug|Win32.ActiveCfg = Debug|Win32 + {33B7DFDC-BECB-3678-1190-6C951E393EB3}.Debug|Win32.Build.0 = Debug|Win32 + {33B7DFDC-BECB-3678-1190-6C951E393EB3}.Release|Win32.ActiveCfg = Release|Win32 + {33B7DFDC-BECB-3678-1190-6C951E393EB3}.Release|Win32.Build.0 = Release|Win32 + {EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Debug|Win32.ActiveCfg = Debug|Win32 + {EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Debug|Win32.Build.0 = Debug|Win32 + {EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Release|Win32.ActiveCfg = Release|Win32 + {EC1C516D-E1D9-BC0A-F79D-E91E954ED8EC}.Release|Win32.Build.0 = Release|Win32 + {F69B3672-C5E8-CD1A-257F-253A25B5B939}.Debug|Win32.ActiveCfg = Debug|Win32 + {F69B3672-C5E8-CD1A-257F-253A25B5B939}.Debug|Win32.Build.0 = Debug|Win32 + {F69B3672-C5E8-CD1A-257F-253A25B5B939}.Release|Win32.ActiveCfg = Release|Win32 + {F69B3672-C5E8-CD1A-257F-253A25B5B939}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal +EOF +) +echo "$Global" >> "$1" From 38b0d98fff2fabeaa15a96e87d5ecd0afa7d3623 Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sun, 1 Dec 2024 18:18:36 -0700 Subject: [PATCH 09/10] Add /define:VS2022 argument devtools/bin/vpc.exe --- mp/src/createallprojects.bat | 2 +- mp/src/creategameprojects.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mp/src/createallprojects.bat b/mp/src/createallprojects.bat index 40c0f22cb8..2604ccabab 100755 --- a/mp/src/createallprojects.bat +++ b/mp/src/createallprojects.bat @@ -1 +1 @@ -devtools\bin\vpc.exe /hl2mp +everything /mksln everything.sln +devtools\bin\vpc.exe /hl2mp +everything /mksln everything.sln /define:VS2022 diff --git a/mp/src/creategameprojects.bat b/mp/src/creategameprojects.bat index fa11d1c66e..8c401b8c57 100755 --- a/mp/src/creategameprojects.bat +++ b/mp/src/creategameprojects.bat @@ -1 +1 @@ -devtools\bin\vpc.exe /hl2mp +game /mksln games.sln +devtools\bin\vpc.exe /hl2mp +game /mksln games.sln /define:VS2022 From a74a6a34af2307bc129ea7cdd1a89bcb4e87fca6 Mon Sep 17 00:00:00 2001 From: Andrew McWatters Date: Sat, 14 Dec 2024 13:59:24 -0700 Subject: [PATCH 10/10] Add support for Visual Studio 2022 platform toolset in source_win32_base.vpc --- mp/src/vpc_scripts/source_win32_base.vpc | 1 + 1 file changed, 1 insertion(+) diff --git a/mp/src/vpc_scripts/source_win32_base.vpc b/mp/src/vpc_scripts/source_win32_base.vpc index 4d41cb3137..4aa62a790e 100644 --- a/mp/src/vpc_scripts/source_win32_base.vpc +++ b/mp/src/vpc_scripts/source_win32_base.vpc @@ -13,6 +13,7 @@ $Configuration $PlatformToolset "v110" [$VS2012 && $ANALYZE] // VS 2012 for /analyze $PlatformToolset "v120_xp" [$VS2013 && !$ANALYZE] // VS 2013 targeting Windows XP - http://msdn.microsoft.com/en-us/library/vstudio/jj851139.aspx $PlatformToolset "v120" [$VS2013 && $ANALYZE] // VS 2013 for /analyze + $PlatformToolset "v143" [$VS2022] } $General