diff --git a/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj b/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj index b346a4b..40e5750 100644 --- a/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj +++ b/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj @@ -7,10 +7,6 @@ ..\bin\patcher\ 8 false - false - false - false - false diff --git a/BepInEx.Core/BepInEx.Core.csproj b/BepInEx.Core/BepInEx.Core.csproj index 275336d..fac38ea 100644 --- a/BepInEx.Core/BepInEx.Core.csproj +++ b/BepInEx.Core/BepInEx.Core.csproj @@ -7,10 +7,6 @@ 8 Unity plugin injection framework false - false - false - false - false none diff --git a/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj b/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj index a972200..427d91d 100644 --- a/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj +++ b/BepInEx.IL2CPP/BepInEx.IL2CPP.csproj @@ -7,10 +7,6 @@ ..\bin\IL2CPP\ 8 false - false - false - false - false portable @@ -53,11 +49,5 @@ - - - - - - \ No newline at end of file diff --git a/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj b/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj index 67b2bac..88542ba 100644 --- a/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj +++ b/BepInEx.NetLauncher/BepInEx.NetLauncher.csproj @@ -7,10 +7,6 @@ BepInEx.NetLauncher 8 false - false - false - false - false full @@ -28,11 +24,5 @@ - - - - - - \ No newline at end of file diff --git a/BepInEx.Patcher/BepInEx.Patcher.csproj b/BepInEx.Patcher/BepInEx.Patcher.csproj index 80d0b3e..9e5c6e9 100644 --- a/BepInEx.Patcher/BepInEx.Patcher.csproj +++ b/BepInEx.Patcher/BepInEx.Patcher.csproj @@ -11,10 +11,6 @@ 8 MinimumRecommendedRules.ruleset false - false - false - false - false BepInEx.Patcher.Program @@ -39,11 +35,5 @@ - - - - - - \ No newline at end of file diff --git a/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj b/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj index f3a2935..c11c1e1 100644 --- a/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj +++ b/BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj @@ -6,10 +6,6 @@ ..\bin\ 8 false - false - false - false - false full diff --git a/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj b/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj index e1b42cc..7df59f1 100644 --- a/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj +++ b/BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj @@ -6,10 +6,6 @@ ..\bin\ 8 false - false - false - false - false full @@ -25,11 +21,5 @@ - - - - - - \ No newline at end of file diff --git a/BepInEx.Shared/AssemblyInfo.cs b/BepInEx.Shared/AssemblyInfo.cs deleted file mode 100644 index 7cbdea2..0000000 --- a/BepInEx.Shared/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Reflection; -// ReSharper disable once RedundantUsingDirective -using BepInEx.Shared; - -[assembly: AssemblyCopyright("Copyright © 2020 BepInEx Team")] -[assembly: AssemblyVersion(VersionInfo.VERSION)] -[assembly: AssemblyFileVersion(VersionInfo.VERSION)] -[assembly: AssemblyInformationalVersion(VersionInfo.VERSION)] \ No newline at end of file diff --git a/BepInEx.Shared/BepInEx.Shared.projitems b/BepInEx.Shared/BepInEx.Shared.projitems index 586e81f..c90c02a 100644 --- a/BepInEx.Shared/BepInEx.Shared.projitems +++ b/BepInEx.Shared/BepInEx.Shared.projitems @@ -4,13 +4,19 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) true E312EFD4-47ED-4DCE-B279-6B0EE314989F + Copyright © 2020 BepInEx Team + 6.0.0 BepInEx.Shared - - + + + + + <_Parameter1>$(BuildInfo) + \ No newline at end of file diff --git a/BepInEx.Shared/BuildInfoAttribute.cs b/BepInEx.Shared/BuildInfoAttribute.cs index 2ee5b2f..08265c6 100644 --- a/BepInEx.Shared/BuildInfoAttribute.cs +++ b/BepInEx.Shared/BuildInfoAttribute.cs @@ -6,6 +6,7 @@ namespace BepInEx.Shared /// This class is appended to AssemblyInfo.cs when BepInEx is built via a CI pipeline. /// It is mainly intended to signify that the current build is not a release build and is special, like for instance a bleeding edge build. /// + [AttributeUsage(AttributeTargets.Assembly)] public class BuildInfoAttribute : Attribute { public string Info { get; } diff --git a/BepInEx.Shared/VersionInfo.cs b/BepInEx.Shared/VersionInfo.cs deleted file mode 100644 index 00b62fe..0000000 --- a/BepInEx.Shared/VersionInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace BepInEx.Shared -{ - internal static class VersionInfo - { - public const string VERSION = "6.0.0.0"; - } -} \ No newline at end of file diff --git a/BepInEx.Unity/BepInEx.Unity.csproj b/BepInEx.Unity/BepInEx.Unity.csproj index a2208c7..4f9431e 100644 --- a/BepInEx.Unity/BepInEx.Unity.csproj +++ b/BepInEx.Unity/BepInEx.Unity.csproj @@ -6,10 +6,6 @@ ..\bin\Unity\ 8 false - false - false - false - false full @@ -32,11 +28,5 @@ - - - - - - \ No newline at end of file diff --git a/BepInExTests/BepInExTests.csproj b/BepInExTests/BepInExTests.csproj index 380c54b..2bdbef6 100644 --- a/BepInExTests/BepInExTests.csproj +++ b/BepInExTests/BepInExTests.csproj @@ -10,7 +10,7 @@ BepInExTests BepInExTests - Copyright © 2019 + Copyright © 2020 BepInEx Team bin\$(Platform)\$(Configuration)\ MinimumRecommendedRules.ruleset @@ -39,10 +39,4 @@ - - - - - - \ No newline at end of file diff --git a/build.cake b/build.cake index 0fd3094..f79686b 100644 --- a/build.cake +++ b/build.cake @@ -1,8 +1,8 @@ -#addin nuget:?package=Cake.FileHelpers&version=3.2.1 -#addin nuget:?package=SharpZipLib&version=1.2.0 +#addin nuget:?package=Cake.FileHelpers&version=3.3.0 +#addin nuget:?package=SharpZipLib&version=1.3.0 #addin nuget:?package=Cake.Compression&version=0.2.4 -#addin nuget:?package=Cake.Json&version=4.0.0 -#addin nuget:?package=Newtonsoft.Json&version=11.0.2 +#addin nuget:?package=Cake.Json&version=5.2.0 +#addin nuget:?package=Newtonsoft.Json&version=12.0.3 var target = Argument("target", "Build"); var isBleedingEdge = Argument("bleeding_edge", false); @@ -53,27 +53,30 @@ Task("Build") { var bepinExProperties = Directory("./BepInEx.Shared"); - if(isBleedingEdge) - { - CopyFile(bepinExProperties + File("VersionInfo.cs"), bepinExProperties + File("VersionInfo.cs.bak")); - CopyFile(bepinExProperties + File("AssemblyInfo.cs"), bepinExProperties + File("AssemblyInfo.cs.bak")); - ReplaceRegexInFiles(bepinExProperties + File("VersionInfo.cs"), "([0-9]+\\.[0-9]+\\.[0-9]+\\.)[0-9]+", "${1}" + buildId); - - FileAppendText(bepinExProperties + File("AssemblyInfo.cs"), - TransformText("\n[assembly: BuildInfo(\"BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>\")]\n") - .WithToken("buildNumber", buildId) - .WithToken("shortCommit", currentCommit) - .WithToken("branchName", currentBranch) - .ToString()); - } - - buildVersion = FindRegexMatchInFile(bepinExProperties + File("VersionInfo.cs"), "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+", System.Text.RegularExpressions.RegexOptions.None); + buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\([0-9]+\.[0-9]+\.[0-9]+)\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value; var buildSettings = new MSBuildSettings { Configuration = "Release", Restore = true }; + if (isBleedingEdge) + { + buildSettings.Properties["BuildInfo"] = new[] { + TransformText("BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>") + .WithToken("buildNumber", buildId) + .WithToken("shortCommit", currentCommit) + .WithToken("branchName", currentBranch) + .ToString() + }; + + buildSettings.Properties["AssemblyVersion"] = new[] { buildVersion + "." + buildId }; + + buildVersion += "-ci." + buildId; + + buildSettings.Properties["Version"] = new[] { buildVersion }; + } + //buildSettings.Properties["TargetFrameworks"] = new []{ "net35" }; MSBuild("./BepInEx.Unity/BepInEx.Unity.csproj", buildSettings); @@ -82,17 +85,6 @@ Task("Build") //buildSettings.Properties["TargetFrameworks"] = new []{ "net472" }; MSBuild("./BepInEx.IL2CPP/BepInEx.IL2CPP.csproj", buildSettings); -}) -.Finally(() => -{ - var bepinExProperties = Directory("./BepInEx.Shared"); - if(isBleedingEdge) - { - DeleteFile(bepinExProperties + File("AssemblyInfo.cs")); - DeleteFile(bepinExProperties + File("VersionInfo.cs")); - MoveFile(bepinExProperties + File("AssemblyInfo.cs.bak"), bepinExProperties + File("AssemblyInfo.cs")); - MoveFile(bepinExProperties + File("VersionInfo.cs.bak"), bepinExProperties + File("VersionInfo.cs")); - } }); const string DOORSTOP_VER_WIN = "3.1.0.0";