diff --git a/build.cake b/build.cake index c459b99f..b28bda74 100644 --- a/build.cake +++ b/build.cake @@ -208,12 +208,14 @@ Task("copy-debug-plugin") { CreateDirectory("./src/papyrus-lang-vscode/debug-plugin"); + var configuration = isRelease ? "Release" : "Debug"; + CopyFileToDirectory( - "src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Skyrim/x64/Debug/DarkId.Papyrus.DebugServer.Skyrim.dll", + $"src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Skyrim/x64/{configuration}/DarkId.Papyrus.DebugServer.Skyrim.dll", "./src/papyrus-lang-vscode/debug-plugin"); CopyFileToDirectory( - "src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Fallout4/x64/Debug/DarkId.Papyrus.DebugServer.Fallout4.dll", + $"src/DarkId.Papyrus.DebugServer/bin/DarkId.Papyrus.DebugServer.Fallout4/x64/{configuration}/DarkId.Papyrus.DebugServer.Fallout4.dll", "./src/papyrus-lang-vscode/debug-plugin"); } catch (Exception) @@ -239,13 +241,24 @@ Task("restore") Task("build-debugger") .Does(() => { - // TODO: How do we set the version on these? Does AssemblyVersion work? - // TODO: Do release builds when running CI. + var parsedVersion = System.Version.Parse(version); + + var patch = parsedVersion.Build & 0xFFFF0000; + var build = parsedVersion.Build & 0x0000FFFF; MSBuild(debuggerSolution, new MSBuildSettings() { PlatformTarget = PlatformTarget.x64, + Configuration = isRelease ? "Release" : "Debug", + Properties = + { + { "VersionMajor", new List(){ parsedVersion.Major.ToString() } }, + { "VersionMinor", new List(){ parsedVersion.Minor.ToString() } }, + { "VersionPatch", new List(){ patch.ToString() } }, + { "VersionBuild", new List(){ build.ToString() } }, + } }); + }); Task("build") diff --git a/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Fallout4.vcxproj b/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Fallout4.vcxproj index a805f16d..abb3c638 100644 --- a/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Fallout4.vcxproj +++ b/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Fallout4.vcxproj @@ -1,5 +1,6 @@  - + Debug @@ -16,6 +17,10 @@ DarkId::Papyrus::DebugServer Win32Proj 10.0 + 0 + 0 + 0 + 0 @@ -33,10 +38,14 @@ - + - + @@ -59,7 +68,8 @@ $(ProjectDir)obj\$(ProjectName)\$(Platform)\$(Configuration)\ - $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Bethesda Softworks\Fallout4@installed path) + $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Bethesda + Softworks\Fallout4@installed path) $(FalloutInstallPath)Data\F4SE\Plugins @@ -81,7 +91,8 @@ Disabled - WIN32;FALLOUT;SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;F4SE_SUPPORT_XBYAK;_DEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) + + WIN32;FALLOUT;SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;F4SE_SUPPORT_XBYAK;_DEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug Level3 @@ -104,7 +115,8 @@ Use pdsPCH.h /bigobj %(AdditionalOptions) - $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) + + $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) true @@ -129,14 +141,15 @@ - FALLOUT + FALLOUT;DIDPDS_VERSION_MAJOR=$(VersionMajor);DIDPDS_VERSION_MINOR=$(VersionMinor);DIDPDS_VERSION_PATCH=$(VersionPatch);DIDPDS_VERSION_BUILD=$(VersionBuild); MaxSpeed true - WIN32;FALLOUT;SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;F4SE_SUPPORT_XBYAK;NDEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) + + WIN32;FALLOUT;SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL;F4SE_SUPPORT_XBYAK;NDEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) MultiThreaded true Level3 @@ -157,7 +170,8 @@ Use pdsPCH.h /bigobj %(AdditionalOptions) - $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) + + $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) true @@ -180,7 +194,7 @@ - FALLOUT + FALLOUT;DIDPDS_VERSION_MAJOR=$(VersionMajor);DIDPDS_VERSION_MINOR=$(VersionMinor);DIDPDS_VERSION_PATCH=$(VersionPatch);DIDPDS_VERSION_BUILD=$(VersionBuild); diff --git a/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Skyrim.vcxproj b/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Skyrim.vcxproj index 3b4dc054..3f9cd0c0 100644 --- a/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Skyrim.vcxproj +++ b/src/DarkId.Papyrus.DebugServer/DarkId.Papyrus.DebugServer.Skyrim.vcxproj @@ -1,5 +1,6 @@ - + Debug @@ -16,8 +17,10 @@ DarkId::Papyrus::DebugServer Win32Proj 10.0 - $(APPVEYOR_BUILD_NUMBER) - 0 + 0 + 0 + 0 + 0 @@ -35,10 +38,14 @@ - + - + @@ -61,7 +68,8 @@ $(ProjectDir)obj\$(ProjectName)\$(Platform)\$(Configuration)\ - $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Bethesda Softworks\Skyrim Special Edition@installed path) + $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Bethesda Softworks\Skyrim + Special Edition@installed path) $(SkyrimInstallPath)Data\SKSE\Plugins @@ -83,8 +91,10 @@ Disabled - $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) - WIN32;SKYRIM;ENABLE_SKYRIM_VR;ENABLE_SKYRIM_AE;ENABLE_SKYRIM_SE;SKSE_SUPPORT_XBYAK;_DEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) + + $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) + + WIN32;SKYRIM;ENABLE_SKYRIM_VR;ENABLE_SKYRIM_AE;ENABLE_SKYRIM_SE;SKSE_SUPPORT_XBYAK;_DEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug Level3 @@ -131,15 +141,17 @@ - SKYRIM + SKYRIM;DIDPDS_VERSION_MAJOR=$(VersionMajor);DIDPDS_VERSION_MINOR=$(VersionMinor);DIDPDS_VERSION_PATCH=$(VersionPatch);DIDPDS_VERSION_BUILD=$(VersionBuild); MaxSpeed true - $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) - WIN32;SKYRIM;ENABLE_SKYRIM_VR;ENABLE_SKYRIM_AE;ENABLE_SKYRIM_SE;SKSE_SUPPORT_XBYAK;NDEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) + + $(ProjectDir);$(ProjectDir)..\..\dependencies;$(ProjectDir)..\..\dependencies\MetaStuff\include;$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\Champollion;%(AdditionalIncludeDirectories) + + WIN32;SKYRIM;ENABLE_SKYRIM_VR;ENABLE_SKYRIM_AE;ENABLE_SKYRIM_SE;SKSE_SUPPORT_XBYAK;NDEBUG;_WINDOWS;_USRDLL;DARKID_PAPYRUS_DEBUGSERVER_EXPORTS;%(PreprocessorDefinitions) MultiThreaded true Level3 @@ -182,7 +194,7 @@ - SKYRIM + SKYRIM;DIDPDS_VERSION_MAJOR=$(VersionMajor);DIDPDS_VERSION_MINOR=$(VersionMinor);DIDPDS_VERSION_PATCH=$(VersionPatch);DIDPDS_VERSION_BUILD=$(VersionBuild); diff --git a/src/DarkId.Papyrus.DebugServer/version.h b/src/DarkId.Papyrus.DebugServer/version.h index 392dc7e2..8afa2574 100644 --- a/src/DarkId.Papyrus.DebugServer/version.h +++ b/src/DarkId.Papyrus.DebugServer/version.h @@ -1,4 +1,4 @@ -#ifndef DIDPDS_VERSION_INCLUDED +#ifndef DIDPDS_VERSION_INCLUDED #define DIDPDS_VERSION_INCLUDED #define MAKE_STR_HELPER(a_str) #a_str @@ -10,21 +10,23 @@ #define DIDPDS_DLL_NAME "DarkId.Papyrus.DebugServer.Fallout4.dll" #endif -// Manual update for now -#define DIDPDS_VERSION_MAJOR 1 - -#define DIDPDS_VERSION_MINOR 57 +#ifndef DIDPDS_VERSION_MAJOR +#define DIDPDS_VERSION_MAJOR 0 +#endif -#define DIDPDS_VERSION_PATCH 0 +#ifndef DIDPDS_VERSION_MINOR +#define DIDPDS_VERSION_MINOR 0 +#endif -// Just manually update DIDPDS_VERSION_BETA for now -#define DIDPDS_VERSION_BETA 1 +#ifndef DIDPDS_VERSION_PATCH +#define DIDPDS_VERSION_PATCH 0 +#endif -#define DIDPDS_VERSION_WIN_VERSTRING MAKE_STR(DIDPDS_VERSION_MAJOR) "." MAKE_STR(DIDPDS_VERSION_MINOR) "." MAKE_STR(DIDPDS_VERSION_PATCH) "." MAKE_STR(DIDPDS_VERSION_BETA) -#if DIDPDS_VERSION_BETA == 0 -#define DIDPDS_VERSION_SEMVER MAKE_STR(DIDPDS_VERSION_MAJOR) "." MAKE_STR(DIDPDS_VERSION_MINOR) "." MAKE_STR(DIDPDS_VERSION_PATCH) -#else -#define DIDPDS_VERSION_SEMVER MAKE_STR(DIDPDS_VERSION_MAJOR) "." MAKE_STR(DIDPDS_VERSION_MINOR) "." MAKE_STR(DIDPDS_VERSION_PATCH) "-beta" MAKE_STR(DIDPDS_VERSION_BETA) +#ifndef DIDPDS_VERSION_BUILD +#define DIDPDS_VERSION_BUILD 0 #endif -#endif //DIDPDS_VERSION_INCLUDED +#define DIDPDS_VERSION_WIN_VERSTRING MAKE_STR(DIDPDS_VERSION_MAJOR) "." MAKE_STR(DIDPDS_VERSION_MINOR) "." MAKE_STR(DIDPDS_VERSION_PATCH) "." MAKE_STR(DIDPDS_VERSION_BUILD) +#define DIDPDS_VERSION_SEMVER MAKE_STR(DIDPDS_VERSION_MAJOR) "." MAKE_STR(DIDPDS_VERSION_MINOR) "." MAKE_STR(DIDPDS_VERSION_PATCH) + +#endif // DIDPDS_VERSION_INCLUDED diff --git a/src/DarkId.Papyrus.DebugServer/version.rc b/src/DarkId.Papyrus.DebugServer/version.rc index 1830159c..87c58f1e 100644 --- a/src/DarkId.Papyrus.DebugServer/version.rc +++ b/src/DarkId.Papyrus.DebugServer/version.rc @@ -2,8 +2,8 @@ #include 1 VERSIONINFO - FILEVERSION DIDPDS_VERSION_MAJOR, DIDPDS_VERSION_MINOR, DIDPDS_VERSION_PATCH, DIDPDS_VERSION_BETA - PRODUCTVERSION DIDPDS_VERSION_MAJOR, DIDPDS_VERSION_MINOR, DIDPDS_VERSION_PATCH, DIDPDS_VERSION_BETA + FILEVERSION DIDPDS_VERSION_MAJOR, DIDPDS_VERSION_MINOR, DIDPDS_VERSION_PATCH, DIDPDS_VERSION_BUILD + PRODUCTVERSION DIDPDS_VERSION_MAJOR, DIDPDS_VERSION_MINOR, DIDPDS_VERSION_PATCH, DIDPDS_VERSION_BUILD FILEFLAGSMASK 0x17L #ifndef DIDPDS_DLL_NAME @@ -31,7 +31,7 @@ BEGIN VALUE "FileDescription", "Papyrus Debug Server" VALUE "FileVersion", DIDPDS_VERSION_WIN_VERSTRING VALUE "InternalName", DIDPDS_DLL_NAME - VALUE "LegalCopyright", "Copyright (c) 2019 Joel Day" + VALUE "LegalCopyright", "Copyright (c) 2023 Joel Day" VALUE "ProductName", DIDPDS_DLL_NAME VALUE "ProductVersion", DIDPDS_VERSION_WIN_VERSTRING END