Skip to content

Commit d7604b2

Browse files
committed
[增加]1. 增加生成后处理接口
1 parent d0c6d4f commit d7604b2

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

ProtoExport/IProtoGenerateHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@ internal interface IProtoGenerateHelper
1212
/// <param name="outputPath">输出目录</param>
1313
/// <param name="namespaceName">命名空间</param>
1414
void Run(MessageInfoList inputPath, string outputPath, string namespaceName = "GFXHotfix");
15+
16+
/// <summary>
17+
/// 生成后处理
18+
/// </summary>
19+
/// <param name="operationCodeInfo"></param>
20+
/// <param name="launcherOptionsOutputPath"></param>
21+
void Post(List<MessageInfoList> operationCodeInfo, string launcherOptionsOutputPath);
1522
}
1623
}

ProtoExport/Program.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,7 @@ private static int Main(string[] args)
5959
}
6060
}
6161

62-
switch (modeType)
63-
{
64-
case ModeType.TypeScript:
65-
(ProtoGenerateHelper as ProtoBuffTypeScriptHelper)?.Post(messageInfoLists, launcherOptions.OutputPath);
66-
break;
67-
default:
68-
throw new ArgumentOutOfRangeException();
69-
}
62+
ProtoGenerateHelper?.Post(messageInfoLists, launcherOptions.OutputPath);
7063

7164

7265
Console.WriteLine("导出成功,按任意键退出");

ProtoExport/ProtoBuffServerHelper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,10 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
9898

9999
File.WriteAllText(messageInfoList.OutputPath + ".cs", sb.ToString(), Encoding.UTF8);
100100
}
101+
102+
public void Post(List<MessageInfoList> operationCodeInfo, string launcherOptionsOutputPath)
103+
{
104+
105+
}
101106
}
102107
}

ProtoExport/ProtoBuffUnityHelper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,10 @@ public void Run(MessageInfoList messageInfoList, string outputPath, string names
9797

9898
File.WriteAllText(messageInfoList.OutputPath + ".cs", sb.ToString(), Encoding.UTF8);
9999
}
100+
101+
public void Post(List<MessageInfoList> operationCodeInfo, string launcherOptionsOutputPath)
102+
{
103+
104+
}
100105
}
101106
}

0 commit comments

Comments
 (0)