From e5de63ea942c83f1cdb1dfb77fa16753a0b1e2d3 Mon Sep 17 00:00:00 2001 From: YoshiRulz <OSSYoshiRulz@gmail.com> Date: Sat, 1 Aug 2020 11:34:16 +1000 Subject: [PATCH] Cleanup VersionInfo and code gen --- .gitignore | 4 +- Build/standin.sh | 2 +- .../BizHawk.BizInvoke.csproj | 2 - .../BizHawk.Bizware.BizwareGL.csproj | 2 - .../BizHawk.Client.Common.csproj | 2 - src/BizHawk.Client.Common/FilesystemFilter.cs | 2 + .../movie/MovieConversionExtensions.cs | 1 + .../savestates/ZipStateSaver.cs | 2 + .../BizHawk.Client.DiscoHawk.csproj | 2 - src/BizHawk.Client.EmuHawk/BizBox.cs | 1 + .../BizHawk.Client.EmuHawk.csproj | 3 +- src/BizHawk.Client.EmuHawk/UpdateChecker.cs | 1 + .../tools/Lua/Libraries/ClientLuaLibrary.cs | 1 + .../tools/Lua/LuaFunctionsForm.cs | 1 + .../tools/Lua/Win32LuaLibraries.cs | 1 + .../tools/TAStudio/TAStudio.MenuItems.cs | 1 + src/BizHawk.Client.EmuHawk/tools/ToolBox.cs | 1 + .../tools/VirtualPads/VirtualpadsTool.cs | 1 + src/BizHawk.Common/BizHawk.Common.csproj | 4 +- src/BizHawk.Common/VersionInfo.cs | 49 +++++++++++++++++++ .../BizHawk.Emulation.Common.csproj | 2 - .../BizHawk.Emulation.Cores.csproj | 2 - .../BizHawk.Emulation.DiscSystem.csproj | 2 - src/BizHawk.Version/BizHawk.Version.csproj | 23 +++------ src/BizHawk.Version/VersionInfo.cs | 48 ------------------ .../BizHawk.WinForms.Controls.csproj | 2 - 26 files changed, 73 insertions(+), 89 deletions(-) create mode 100644 src/BizHawk.Common/VersionInfo.cs delete mode 100644 src/BizHawk.Version/VersionInfo.cs diff --git a/.gitignore b/.gitignore index 478e08b4c4..dd1dcf38b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ /snes9xgit -svnrev.cs **/.vs/** **/bin/** **/obj/** @@ -26,7 +25,7 @@ svnrev.cs /BizHawk.Client.EmuHawk/tools/TAStudio/HistoryBox.resx -/BizHawk.Emulation.DiscSystem/Properties/svnrev.cs +/src/BizHawk.Common/SubWCRev.cs @@ -37,7 +36,6 @@ svnrev.cs /LuaInterface/LuaInterface/Properties /Version/bin /Version/obj -/Version/svnrev.cs /attic/PsxHawk.API/Release /attic/PsxHawk.Core/Debug /attic/PsxHawk.Core/Release diff --git a/Build/standin.sh b/Build/standin.sh index 3aec9e17c4..8c3b222c11 100755 --- a/Build/standin.sh +++ b/Build/standin.sh @@ -1,2 +1,2 @@ #!/bin/sh -cd "$(dirname "$0")/../src/BizHawk.Version" && printf "static class SubWCRev\n{\n\tpublic const string SVN_REV = \"%s\";\n\tpublic const string GIT_BRANCH = \"%s\";\n\tpublic const string GIT_SHORTHASH = \"%s\";\n}" "$(git rev-list HEAD --count)" "$(git rev-parse --abbrev-ref HEAD)" "$(git log -1 --format="%h")" >svnrev.cs +cd "$(dirname "$0")/.." && printf "internal static class SubWCRev\n{\n\tpublic const string SVN_REV = \"%s\";\n\tpublic const string GIT_BRANCH = \"%s\";\n\tpublic const string GIT_SHORTHASH = \"%s\";\n}" "$(git rev-list HEAD --count)" "$(git rev-parse --abbrev-ref HEAD)" "$(git log -1 --format="%h")" >"$1" diff --git a/src/BizHawk.BizInvoke/BizHawk.BizInvoke.csproj b/src/BizHawk.BizInvoke/BizHawk.BizInvoke.csproj index ec82c3fae2..6332aa4df2 100644 --- a/src/BizHawk.BizInvoke/BizHawk.BizInvoke.csproj +++ b/src/BizHawk.BizInvoke/BizHawk.BizInvoke.csproj @@ -7,7 +7,5 @@ <ItemGroup> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Common/BizHawk.Common.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> </ItemGroup> </Project> diff --git a/src/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj b/src/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj index b407d75eca..1141ee0c60 100644 --- a/src/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj +++ b/src/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj @@ -9,8 +9,6 @@ <PackageReference Include="System.Drawing.Common" Version="4.7.0" /> <PackageReference Include="OpenTK" Version="3.0.1" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Common/BizHawk.Common.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> </ItemGroup> <ItemGroup> <Compile Update="IGuiRenderer.cs" SubType="Code" /> diff --git a/src/BizHawk.Client.Common/BizHawk.Client.Common.csproj b/src/BizHawk.Client.Common/BizHawk.Client.Common.csproj index b5cd4b6c97..d38d5defde 100644 --- a/src/BizHawk.Client.Common/BizHawk.Client.Common.csproj +++ b/src/BizHawk.Client.Common/BizHawk.Client.Common.csproj @@ -11,8 +11,6 @@ <PackageReference Include="SharpZipLib" Version="1.1.0" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> </ItemGroup> <ItemGroup> <Compile Update="movie/bk2/Bk2Movie.HeaderApi.cs" DependentUpon="Bk2Movie.cs" /> diff --git a/src/BizHawk.Client.Common/FilesystemFilter.cs b/src/BizHawk.Client.Common/FilesystemFilter.cs index ee394c3478..7f7fc30ff0 100644 --- a/src/BizHawk.Client.Common/FilesystemFilter.cs +++ b/src/BizHawk.Client.Common/FilesystemFilter.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; +using BizHawk.Common; + namespace BizHawk.Client.Common { public sealed class FilesystemFilter diff --git a/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs b/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs index 5e20232d6f..c0b5c7ea5a 100644 --- a/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs +++ b/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs @@ -2,6 +2,7 @@ using System.IO; using System.Linq; +using BizHawk.Common; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.Gameboy; using BizHawk.Emulation.Cores.Nintendo.GBHawk; diff --git a/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs b/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs index 402168556b..491fc157e7 100644 --- a/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs +++ b/src/BizHawk.Client.Common/savestates/ZipStateSaver.cs @@ -1,6 +1,8 @@ using System; using System.IO; +using BizHawk.Common; + namespace BizHawk.Client.Common { public class ZipStateSaver : IDisposable diff --git a/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj b/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj index 9019cd7be1..a8d0bf6e5c 100755 --- a/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj +++ b/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj @@ -65,8 +65,6 @@ <Reference Include="System.Web" /> <Reference Include="System.Windows.Forms" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> <Content Include="discohawk.ico" /> </ItemGroup> <ItemGroup> diff --git a/src/BizHawk.Client.EmuHawk/BizBox.cs b/src/BizHawk.Client.EmuHawk/BizBox.cs index b07d092651..1b039f2609 100644 --- a/src/BizHawk.Client.EmuHawk/BizBox.cs +++ b/src/BizHawk.Client.EmuHawk/BizBox.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Windows.Forms; using BizHawk.Client.EmuHawk.Properties; +using BizHawk.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk diff --git a/src/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/src/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index c6ddbf334b..e95bc455e6 100755 --- a/src/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/src/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -100,8 +100,7 @@ <ProjectReference Include="$(ProjectDir)../BizHawk.Client.Common/BizHawk.Client.Common.csproj" /> <ProjectReference Include="$(ProjectDir)../BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj" /> <Compile Include="$(ProjectDir)../BizHawk.Common/OSTailoredCode.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> + <Compile Include="$(ProjectDir)../BizHawk.Common/SubWCRev.cs" /><!-- bit of a hack - should this be public? --> <Compile Remove="Properties/Settings.Designer.cs" /> <Content Include="images/logo.ico" /> <EmbeddedResource Include="images/**/*" /> diff --git a/src/BizHawk.Client.EmuHawk/UpdateChecker.cs b/src/BizHawk.Client.EmuHawk/UpdateChecker.cs index 6ab1d0e36f..25e356ae1e 100644 --- a/src/BizHawk.Client.EmuHawk/UpdateChecker.cs +++ b/src/BizHawk.Client.EmuHawk/UpdateChecker.cs @@ -4,6 +4,7 @@ using System.Net; using System.Threading; using BizHawk.Client.Common; +using BizHawk.Common; using Newtonsoft.Json.Linq; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ClientLuaLibrary.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ClientLuaLibrary.cs index f20530b5b3..7c241630d0 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ClientLuaLibrary.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/ClientLuaLibrary.cs @@ -7,6 +7,7 @@ using System.Threading; using BizHawk.Client.Common; using BizHawk.Client.Common.cheats; +using BizHawk.Common; using BizHawk.Emulation.Common; using NLua; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs index a32426fa73..877135034d 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs @@ -5,6 +5,7 @@ using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; +using BizHawk.Common; using BizHawk.Common.CollectionExtensions; namespace BizHawk.Client.EmuHawk diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Win32LuaLibraries.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Win32LuaLibraries.cs index 276ea2b823..0791b7505f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Win32LuaLibraries.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Win32LuaLibraries.cs @@ -7,6 +7,7 @@ using System.Threading; using NLua; +using BizHawk.Common; using BizHawk.Emulation.Common; using BizHawk.Client.Common; diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index f3d6b08119..279f7b59ce 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -6,6 +6,7 @@ using System.Windows.Forms; using BizHawk.Client.Common; using BizHawk.Client.EmuHawk.ToolExtensions; +using BizHawk.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk diff --git a/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs b/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs index 715e6762c8..c2b3a5f0d6 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs @@ -6,6 +6,7 @@ using System.Reflection; using System.Windows.Forms; using BizHawk.Client.Common; +using BizHawk.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs index 10e127a944..9e9d9e7c91 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Windows.Forms; +using BizHawk.Common; using BizHawk.Emulation.Common; using BizHawk.Client.Common; diff --git a/src/BizHawk.Common/BizHawk.Common.csproj b/src/BizHawk.Common/BizHawk.Common.csproj index 061aaf80c6..f139f6743f 100644 --- a/src/BizHawk.Common/BizHawk.Common.csproj +++ b/src/BizHawk.Common/BizHawk.Common.csproj @@ -12,8 +12,6 @@ <PackageReference Include="Menees.Analyzers" Version="2.0.4" Condition=" '$(MachineRunAnalyzersDuringBuild)' != '' " /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" Condition=" '$(MachineRunAnalyzersDuringBuild)' != '' " /> <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" Condition=" '$(MachineRunAnalyzersDuringBuild)' != '' " /> - <ProjectReference Include="$(ProjectDir)../BizHawk.Version/BizHawk.Version.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> + <ProjectReference Include="$(ProjectDir)../BizHawk.Version/BizHawk.Version.csproj" /><!-- generates SubWCRev.cs --> </ItemGroup> </Project> diff --git a/src/BizHawk.Common/VersionInfo.cs b/src/BizHawk.Common/VersionInfo.cs new file mode 100644 index 0000000000..65dbb1f813 --- /dev/null +++ b/src/BizHawk.Common/VersionInfo.cs @@ -0,0 +1,49 @@ +using System.IO; +using System.Reflection; + +namespace BizHawk.Common +{ + public static class VersionInfo + { + // keep this updated at every major release + public const string MainVersion = "2.4.0"; // Use numbers only or the new version notification won't work + public const string ReleaseDate = "January 18, 2020"; + public const string HomePage = "http://tasvideos.org/BizHawk.html"; + public static readonly bool DeveloperBuild = true; + + public static readonly string? CustomBuildString; + + public static string GetEmuVersion() + { + return DeveloperBuild + ? "GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH + : "Version " + MainVersion; + } + + static VersionInfo() + { + string path = Path.Combine(GetExeDirectoryAbsolute(), "dll"); + path = Path.Combine(path, "custombuild.txt"); + if (File.Exists(path)) + { + var lines = File.ReadAllLines(path); + if (lines.Length > 0) + { + CustomBuildString = lines[0]; + } + } + } + + // code copied to avoid depending on code in other projects + private static string GetExeDirectoryAbsolute() + { + var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? ""; + if (path.EndsWith(Path.DirectorySeparatorChar.ToString())) + { + path = path.Remove(path.Length - 1, 1); + } + + return path; + } + } +} diff --git a/src/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj b/src/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj index 3a82dc6f33..8100a4f752 100644 --- a/src/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj +++ b/src/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj @@ -8,7 +8,5 @@ <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Common/BizHawk.Common.csproj" /> <ProjectReference Include="$(ProjectDir)../BizHawk.BizInvoke/BizHawk.BizInvoke.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> </ItemGroup> </Project> diff --git a/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 9da7006f0a..511a7cb059 100644 --- a/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -13,8 +13,6 @@ <ProjectReference Include="$(ProjectDir)../BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj" /> <ProjectReference Include="$(ProjectDir)../BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj" /> <ProjectReference Include="..\BizHawk.Common\BizHawk.Common.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> <EmbeddedResource Include="Resources/**/*" /> </ItemGroup> <ItemGroup> diff --git a/src/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj b/src/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj index d585f02769..836f7dfdde 100644 --- a/src/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj +++ b/src/BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj @@ -6,7 +6,5 @@ </PropertyGroup> <ItemGroup> <ProjectReference Include="$(ProjectDir)../BizHawk.Common/BizHawk.Common.csproj" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> </ItemGroup> </Project> diff --git a/src/BizHawk.Version/BizHawk.Version.csproj b/src/BizHawk.Version/BizHawk.Version.csproj index 9f3d2f2d02..8823f9a4fa 100644 --- a/src/BizHawk.Version/BizHawk.Version.csproj +++ b/src/BizHawk.Version/BizHawk.Version.csproj @@ -1,24 +1,15 @@ <Project Sdk="Microsoft.NET.Sdk"> + <Import Project="../MainSlnCommon.props" /> <PropertyGroup> - <DebugType>pdbonly</DebugType> - <DefineConstants>TRACE</DefineConstants> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> - <ErrorReport>prompt</ErrorReport> - <Optimize>true</Optimize> - <OutputPath>./bin</OutputPath> - <PlatformTarget>AnyCPU</PlatformTarget> + <NoWarn>CS2008</NoWarn> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> - <ItemGroup> - <!-- svnrev.cs / VersionInfo.cs are only used in other projects --> - <Compile Include="dummy.cs" /><!-- there was a bug in 1.x when no source files were included, including an empty file fixed it --> - </ItemGroup> - <Target Name="Build"> - <!-- when is this called? it has never run and failed on Linux --> - <Exec Command=""$(MSBuildProjectDirectory)\subwcrev.bat" $(MSBuildProjectDirectory)" Condition=" '$(OS)' == 'Windows_NT' " WorkingDirectory="$(MSBuildProjectDirectory)" /> - </Target> <Target Name="PreBuild" AfterTargets="PreBuildEvent"> - <Exec Command='"$(ProjectDir)..\..\Build\BizHawk.Build.Tool.exe" GIT_REV --wc "$(ProjectDir).." --template "$(ProjectDir)svnrev_template" --out "$(ProjectDir)svnrev.cs"' Condition=" '$(OS)' == 'Windows_NT' " /> - <Exec Command='"$(ProjectDir)../../Build/standin.sh"' Condition=" '$(OS)' != 'Windows_NT' " /> + <Exec Condition=" '$(OS)' == 'Windows_NT' " Command='"$(ProjectDir)..\..\Build\BizHawk.Build.Tool.exe" GIT_REV --wc "$(ProjectDir).." --template "$(ProjectDir)svnrev_template" --out "$(ProjectDir)..\BizHawk.Common\SubWCRev.cs"' /> + <Exec Condition=" '$(OS)' != 'Windows_NT' " Command='"$(ProjectDir)../../Build/standin.sh" "$(ProjectDir)..\BizHawk.Common\SubWCRev.cs"' /> + </Target> + <Target Name="PostBuild" AfterTargets="PostBuildEvent"> + <Delete Files="$(OutputPath)BizHawk.Version.csproj" /><!-- no source files, generated svnrev.cs is included in BizHawk.Common --> </Target> </Project> diff --git a/src/BizHawk.Version/VersionInfo.cs b/src/BizHawk.Version/VersionInfo.cs deleted file mode 100644 index 36f7bf09c9..0000000000 --- a/src/BizHawk.Version/VersionInfo.cs +++ /dev/null @@ -1,48 +0,0 @@ -#nullable enable - -using System.IO; -using System.Reflection; - -internal static class VersionInfo -{ - // keep this updated at every major release - public const string MainVersion = "2.4.0"; // Use numbers only or the new version notification won't work - public const string ReleaseDate = "January 18, 2020"; - public const string HomePage = "http://tasvideos.org/BizHawk.html"; - public static readonly bool DeveloperBuild = true; - - public static readonly string? CustomBuildString; - - public static string GetEmuVersion() - { - return DeveloperBuild - ? "GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH - : "Version " + MainVersion; - } - - static VersionInfo() - { - string path = Path.Combine(GetExeDirectoryAbsolute(), "dll"); - path = Path.Combine(path, "custombuild.txt"); - if (File.Exists(path)) - { - var lines = File.ReadAllLines(path); - if (lines.Length > 0) - { - CustomBuildString = lines[0]; - } - } - } - - // code copied to avoid depending on code in other projects - private static string GetExeDirectoryAbsolute() - { - var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? ""; - if (path.EndsWith(Path.DirectorySeparatorChar.ToString())) - { - path = path.Remove(path.Length - 1, 1); - } - - return path; - } -} diff --git a/src/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj b/src/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj index 75e1b8be2e..28351e99fd 100644 --- a/src/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj +++ b/src/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj @@ -7,7 +7,5 @@ <ItemGroup> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" /> <Reference Include="System.Windows.Forms" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/svnrev.cs" /> - <Compile Include="$(ProjectDir)../BizHawk.Version/VersionInfo.cs" /> </ItemGroup> </Project>