Browse Source

Fix cakebuild script

ghorsington 4 years ago
parent
commit
7b317fbc40

+ 1 - 6
BepInEx.Shared/AssemblyInfo.cs

@@ -5,9 +5,4 @@ using BepInEx.Shared;
 [assembly: AssemblyCopyright("Copyright © 2020 BepInEx Team")]
 [assembly: AssemblyVersion(VersionInfo.VERSION)]
 [assembly: AssemblyFileVersion(VersionInfo.VERSION)]
-[assembly: AssemblyInformationalVersion(VersionInfo.VERSION)]
-
-internal static class VersionInfo
-{
-	public const string VERSION = "6.0.0.0";
-}
+[assembly: AssemblyInformationalVersion(VersionInfo.VERSION)]

+ 1 - 0
BepInEx.Shared/BepInEx.Shared.projitems

@@ -11,5 +11,6 @@
   <ItemGroup>
     <Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)BuildInfoAttribute.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)VersionInfo.cs" />
   </ItemGroup>
 </Project>

+ 7 - 0
BepInEx.Shared/VersionInfo.cs

@@ -0,0 +1,7 @@
+namespace BepInEx.Shared
+{
+	internal static class VersionInfo
+	{
+		public const string VERSION = "6.0.0.0";
+	}
+}

+ 7 - 4
build.cake

@@ -51,12 +51,13 @@ Task("Build")
     .IsDependentOn("PullDependencies")
     .Does(() =>
 {
-    var bepinExProperties = Directory("./BepInEx.Core/Properties");
+    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("AssemblyInfo.cs"), "([0-9]+\\.[0-9]+\\.[0-9]+\\.)[0-9]+", "${1}" + buildId);
+        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")
@@ -66,7 +67,7 @@ Task("Build")
                 .ToString());
     }
 
-    buildVersion = FindRegexMatchInFile(bepinExProperties + File("AssemblyInfo.cs"), "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+", System.Text.RegularExpressions.RegexOptions.None);
+    buildVersion = FindRegexMatchInFile(bepinExProperties + File("VersionInfo.cs"), "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+", System.Text.RegularExpressions.RegexOptions.None);
 
     var buildSettings = new MSBuildSettings {
         Configuration = "Release",
@@ -84,11 +85,13 @@ Task("Build")
 })
 .Finally(() => 
 {
-    var bepinExProperties = Directory("./BepInEx.Core/Properties");
+    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"));
     }
 });