Skip to content

Commit

Permalink
[更新]导表工具更新文件组织方式、删除protobuf编译配置内嵌在exe中
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhihai committed Dec 3, 2021
1 parent 3b72b5d commit ff270bc
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion HelperTools/ExcelToProtobuf/BuildProtos.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ for /r %%i in (*.proto) do (
echo.
echo .proto文件转.cs文件结束
echo.
pause
exit
12 changes: 6 additions & 6 deletions HelperTools/ExcelToProtobuf/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ public static string GetPbFieldName(string str)
// 转换路径 -> dataFileDirPath posDataFileDirPath lawsDataFileDirPath
public static void ParsePath(string[] pathLists)
{
if (pathLists.Length >= 6 && pathLists[5].Length > 0)
if (pathLists.Length >= 5 && pathLists[4].Length > 0)
{
dataFileDirPath = pathLists[5];
dataFileDirPath = pathLists[4];
}

if (pathLists.Length >= 7 && pathLists[6].Length > 0)
if (pathLists.Length >= 6 && pathLists[5].Length > 0)
{
posDataFileDirPath = pathLists[6];
posDataFileDirPath = pathLists[5];
}

if (pathLists.Length >= 8 && pathLists[7].Length > 0)
if (pathLists.Length >= 7 && pathLists[6].Length > 0)
{
lawsDataFileDirPath = pathLists[7];
lawsDataFileDirPath = pathLists[6];
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions HelperTools/ExcelToProtobuf/Config/PathConfig.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
E:\UnityDemo\FrameWork\HelperTools\ExcelToProtobuf\Excel
E:\UnityDemo\FrameWork\HelperTools\ExcelToProtobuf\Protos
E:\UnityDemo\FrameWork\HelperTools\ExcelToProtobuf\BuildProtos.bat
E:\UnityDemo\FrameWork\HelperTools\ExcelToProtobuf\Csharp
E:\UnityDemo\FrameWork\HelperTools\ExcelToProtobuf\bin\Debug\Google.Protobuf.dll
E:\UnityDemo\EliminateGame\HelperTools\ExcelToProtobuf\Excel
E:\UnityDemo\EliminateGame\HelperTools\ExcelToProtobuf\Protos
E:\UnityDemo\EliminateGame\HelperTools\ExcelToProtobuf\BuildProtos.bat
E:\UnityDemo\EliminateGame\HelperTools\ExcelToProtobuf\Csharp
E:\UnityDemo\EliminateGame\Assets\_Res\_Config

E:\UnityDemo\EliminateGame\HelperTools\ExcelToProtobuf\LawsData
Binary file modified HelperTools/ExcelToProtobuf/Csharp/clientData.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added HelperTools/ExcelToProtobuf/Dlls/NPOI.OOXML.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added HelperTools/ExcelToProtobuf/Dlls/NPOI.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
33 changes: 14 additions & 19 deletions HelperTools/ExcelToProtobuf/ExcelToProtobuf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,35 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Protobuf">
<HintPath>Config\Google.Protobuf.dll</HintPath>
<HintPath>Dlls\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Demo\server\tools\Xlsx2Csv\Xlsx2Csv\ICSharpCode.SharpZipLib.dll</HintPath>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>Dlls\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=2.2.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Demo\server\tools\Xlsx2Csv\Xlsx2Csv\NPOI.dll</HintPath>
<Reference Include="NPOI">
<HintPath>Dlls\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML, Version=2.2.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Demo\server\tools\Xlsx2Csv\Xlsx2Csv\NPOI.OOXML.dll</HintPath>
<Reference Include="NPOI.OOXML">
<HintPath>Dlls\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net, Version=2.2.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Demo\server\tools\Xlsx2Csv\Xlsx2Csv\NPOI.OpenXml4Net.dll</HintPath>
<Reference Include="NPOI.OpenXml4Net">
<HintPath>Dlls\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats, Version=2.2.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Demo\server\tools\Xlsx2Csv\Xlsx2Csv\NPOI.OpenXmlFormats.dll</HintPath>
<Reference Include="NPOI.OpenXmlFormats">
<HintPath>Dlls\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers">
<HintPath>..\..\..\TestDemo01\Assets\Plugins\System.Buffers.dll</HintPath>
<HintPath>Dlls\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Memory">
<HintPath>..\..\..\TestDemo01\Assets\Plugins\System.Memory.dll</HintPath>
<HintPath>Dlls\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>..\..\..\TestDemo01\Assets\Plugins\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<HintPath>Dlls\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions HelperTools/ExcelToProtobuf/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ static void Main(string[] args)
if (isGenerat)
{
Console.WriteLine("开始编译C#类…………");
bool isCompiler = Compiler2Dll.Compiler(lines[3], lines[3], lines[4]);
string dllPath = exePath + "\\Google.Protobuf.dll";
bool isCompiler = Compiler2Dll.Compiler(lines[3], lines[3], dllPath);
Console.WriteLine("编译C#类完成…………");

if (isCompiler)
Expand All @@ -51,7 +52,8 @@ static void Main(string[] args)
Console.WriteLine("序列化数据完成…………");
}
}

Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("编表全部结束!!!");
}
else
{
Expand Down
Binary file modified HelperTools/ExcelToProtobuf/bin/Debug/ExcelToProtobuf.exe
Binary file not shown.
Binary file modified HelperTools/ExcelToProtobuf/bin/Debug/ExcelToProtobuf.pdb
Binary file not shown.
Binary file modified HelperTools/ExcelToProtobuf/bin/Release/ExcelToProtobuf.exe
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/>
</startup>
</configuration>
Binary file modified HelperTools/ExcelToProtobuf/bin/Release/ExcelToProtobuf.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added HelperTools/ExcelToProtobuf/bin/Release/NPOI.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion HelperTools/ExcelToProtobuf/readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1��Excel����Ҫ�����ı���
2��Protos�����е�����proto�ļ�
3��Config/PathConfig.txt���ú�·����˳��Ϊ��Excel·����Protos·����protoc������·��,��Ҫ�����cs�ļ�·������������cs�ļ������pb����dll�
3��Config/PathConfig.txt���ú�·����˳��Ϊ��Excel·����Protos·����protoc������·��,��Ҫ�����cs�ļ�·�������л������ݣ�λ���ļ����ݣ��������ݣ
4��ִ��binĿ¼��debug��releaseĿ¼�µ�ExcelToProtobuf.exe

0 comments on commit ff270bc

Please sign in to comment.