Browse Source

Remove debug compilation check for BuildInfoAttribute usage

Bepis 6 years ago
parent
commit
4dd30fa43e

+ 3 - 5
BepInEx.Preloader/Preloader.cs

@@ -45,17 +45,15 @@ namespace BepInEx.Preloader
 
                 PreloaderLog.WriteLine(consoleTile);
 
-#if DEBUG
-                object[] attributes =
-                    typeof(DebugInfoAttribute).Assembly.GetCustomAttributes(typeof(DebugInfoAttribute), false);
+				//See BuildInfoAttribute for more information about this section.
+				object[] attributes = typeof(BuildInfoAttribute).Assembly.GetCustomAttributes(typeof(BuildInfoAttribute), false);
 
                 if (attributes.Length > 0)
                 {
-                    var attribute = (DebugInfoAttribute) attributes[0];
+                    var attribute = (BuildInfoAttribute)attributes[0];
 
                     PreloaderLog.WriteLine(attribute.Info);
                 }
-#endif
 
                 Logger.Log(LogLevel.Message, "Preloader started");
 

+ 8 - 8
BepInEx/Contract/Attributes.cs

@@ -197,21 +197,21 @@ namespace BepInEx
 
     #endregion
 
-	#region Debug
+	#region Build configuration
 
-	#if DEBUG
-
-	public class DebugInfoAttribute : Attribute
+	/// <summary>
+	/// 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.
+	/// </summary>
+	internal class BuildInfoAttribute : Attribute
 	{
 		public string Info { get; }
 
-		public DebugInfoAttribute(string info)
+		public BuildInfoAttribute(string info)
 		{
 			Info = info;
 		}
 	}
 
-	#endif
-
 	#endregion
-}
+}

+ 2 - 0
BepInEx/Properties/AssemblyInfo.cs

@@ -24,6 +24,8 @@ using BepInEx;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("4ffba620-f5ed-47f9-b90c-dad1316fd9b9")]
 
+[assembly: InternalsVisibleTo("BepInEx.Preloader")]
+
 // Version information for an assembly consists of the following four values:
 //
 //      Major Version