Преглед изворни кода

去掉NOT_UNITY跟SERVER宏,用UNITY跟APPS宏代替

tanghai пре 3 година
родитељ
комит
71e045fcfb

+ 2 - 2
Apps/App/Apps.App.csproj

@@ -14,13 +14,13 @@
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <DefineConstants>TRACE2_0;SERVER;NOT_UNITY</DefineConstants>
+    <DefineConstants>TRACE2_0;SERVER;NOT_UNITY;APPS</DefineConstants>
     <OutputPath>..\..\Bin\</OutputPath>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
-    <DefineConstants>TRACE2_0;SERVER;NOT_UNITY</DefineConstants>
+    <DefineConstants>TRACE2_0;SERVER;NOT_UNITY;APPS</DefineConstants>
     <OutputPath>..\..\Bin\</OutputPath>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
   </PropertyGroup>

+ 4 - 4
Apps/Hotfix/Apps.Hotfix.csproj

@@ -10,12 +10,12 @@
         <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-        <DefineConstants>TRACE2_0;NOT_UNITY;SERVER;</DefineConstants>
+        <DefineConstants>TRACE2_0;NOT_UNITY;APPS;</DefineConstants>
         <OutputPath>..\..\Bin\</OutputPath>
         <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
-        <DefineConstants>TRACE2_0;SERVER;NOT_UNITY</DefineConstants>
+        <DefineConstants>TRACE2_0;SERVER;NOT_UNITY;APPS</DefineConstants>
         <OutputPath>..\..\Bin\</OutputPath>
         <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     </PropertyGroup>
@@ -49,7 +49,7 @@
         </Compile>
     </ItemGroup>
     <ItemGroup>
-        <ProjectReference Include="..\Model\Apps.Model.csproj"/>
-        <ProjectReference Include="..\..\Share\Analyzer\Share.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
+        <ProjectReference Include="..\Model\Apps.Model.csproj" />
+        <ProjectReference Include="..\..\Share\Analyzer\Share.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
     </ItemGroup>
 </Project>

+ 2 - 2
Apps/Model/Apps.Model.csproj

@@ -10,13 +10,13 @@
         <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-        <DefineConstants>TRACE2_0;NOT_UNITY;SERVER</DefineConstants>
+        <DefineConstants>TRACE2_0;NOT_UNITY;APPS</DefineConstants>
         <OutputPath>..\..\Bin\</OutputPath>
         <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
         <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
-        <DefineConstants>TRACE2_0;SERVER;NOT_UNITY</DefineConstants>
+        <DefineConstants>TRACE2_0;SERVER;NOT_UNITY;APPS</DefineConstants>
         <OutputPath>..\..\Bin\</OutputPath>
         <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
         <TreatWarningsAsErrors>true</TreatWarningsAsErrors>

+ 2 - 2
Apps/ThirdParty/Apps.ThirdParty.csproj

@@ -14,14 +14,14 @@
     </PropertyGroup>
     
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <DefineConstants>TRACE;NOT_UNITY</DefineConstants>
+      <DefineConstants>TRACE;NOT_UNITY;APPS</DefineConstants>
       <OutputPath>..\..\Bin\</OutputPath>
       <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
       <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     </PropertyGroup>
     
     <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-      <DefineConstants>TRACE;NOT_UNITY</DefineConstants>
+      <DefineConstants>TRACE;NOT_UNITY;APPS</DefineConstants>
       <OutputPath>..\..\Bin\</OutputPath>
       <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
       <TreatWarningsAsErrors>true</TreatWarningsAsErrors>

+ 2 - 2
Apps/Tool/Apps.Tool.csproj

@@ -19,14 +19,14 @@
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
       <OutputPath>..\..\Bin\</OutputPath>
       <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-      <DefineConstants>TRACECOREAPP;NOT_UNITY</DefineConstants>
+      <DefineConstants>TRACECOREAPP;NOT_UNITY;APPS</DefineConstants>
       <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     </PropertyGroup>
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
       <OutputPath>..\..\Bin\</OutputPath>
       <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-      <DefineConstants>TRACECOREAPP;NOT_UNITY</DefineConstants>
+      <DefineConstants>TRACECOREAPP;NOT_UNITY;APPS</DefineConstants>
       <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     </PropertyGroup>
     

+ 2 - 2
Unity/Assets/Mono/Core/Helper/ProcessHelper.cs

@@ -61,12 +61,12 @@ namespace ET
         private static async ETTask WaitExitAsync(Process process)
         {
             await process.WaitForExitAsync();
-#if !NOT_UNITY
+#if UNITY
             Log.Info($"process exit, exitcode: {process.ExitCode} {process.StandardOutput.ReadToEnd()} {process.StandardError.ReadToEnd()}");
 #endif
         }
         
-#if !NOT_UNITY
+#if UNITY
         private static async Task WaitForExitAsync(this Process self)
         {
             if (!self.HasExited)

+ 1 - 1
Unity/Assets/Mono/Core/Log/Log.cs

@@ -3,7 +3,7 @@ using System.Diagnostics;
 using System.IO;
 using System.Net;
 
-#if NOT_UNITY
+#if APPS
 using NLog;
 #endif
 

+ 1 - 1
Unity/Assets/Mono/Core/Log/NLogger.cs

@@ -1,4 +1,4 @@
-#if NOT_UNITY
+#if APPS
 using NLog;
 
 namespace ET

+ 1 - 1
Unity/Assets/Mono/Core/Log/UnityLogger.cs

@@ -1,4 +1,4 @@
-#if !NOT_UNITY
+#if UNITY
 using System;
 
 namespace ET

+ 2 - 2
Unity/Codes/Model/Core/Timer/TimerComponent.cs

@@ -327,7 +327,7 @@ namespace ET
 
         public static long NewFrameTimer(this TimerComponent self, int type, object args)
         {
-#if SERVER
+#if APPS
 			return self.NewRepeatedTimerInner(100, type, args);
 #else
             return self.NewRepeatedTimerInner(0, type, args);
@@ -339,7 +339,7 @@ namespace ET
         /// </summary>
         private static long NewRepeatedTimerInner(this TimerComponent self, long time, int type, object args)
         {
-#if SERVER
+#if APPS
 			if (time < 100)
 			{ 
 				throw new Exception($"repeated timer < 100, timerType: time: {time}");