Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
91ac5dbd
E
et
项目概览
guo450212436
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
91ac5dbd
编写于
3月 01, 2019
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加ProcessHelper类,所有启动进程的地方都使用这个类
上级
c600fd0a
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
123 addition
and
265 deletion
+123
-265
Proto/Proto2CS.dll
Proto/Proto2CS.dll
+0
-0
Proto/Proto2CS.pdb
Proto/Proto2CS.pdb
+0
-0
Proto/protoc
Proto/protoc
+0
-0
Server/Model/Component/AppManagerComponent.cs
Server/Model/Component/AppManagerComponent.cs
+1
-4
Server/Model/Server.Model.csproj
Server/Model/Server.Model.csproj
+3
-0
Tools/Proto2CS/Program.cs
Tools/Proto2CS/Program.cs
+13
-24
Tools/Proto2CS/Proto2CS.csproj
Tools/Proto2CS/Proto2CS.csproj
+4
-1
Unity/Assets/Editor/BuildEditor/BuildHelper.cs
Unity/Assets/Editor/BuildEditor/BuildHelper.cs
+2
-29
Unity/Assets/Editor/Helper/ShellHelper.cs
Unity/Assets/Editor/Helper/ShellHelper.cs
+0
-42
Unity/Assets/Editor/LogRedirection.cs
Unity/Assets/Editor/LogRedirection.cs
+0
-106
Unity/Assets/Editor/LogRedirection.cs.meta
Unity/Assets/Editor/LogRedirection.cs.meta
+0
-12
Unity/Assets/Editor/Proto2CsEditor/Proto2CSEditor.cs
Unity/Assets/Editor/Proto2CsEditor/Proto2CSEditor.cs
+5
-33
Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs
Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs
+1
-8
Unity/Assets/Editor/ServerCommandLineEditor/ServerCommandLineEditor.cs
...Editor/ServerCommandLineEditor/ServerCommandLineEditor.cs
+2
-3
Unity/Assets/Model/Base/ProcessHelper.cs
Unity/Assets/Model/Base/ProcessHelper.cs
+61
-0
Unity/Assets/Model/Base/ProcessHelper.cs.meta
Unity/Assets/Model/Base/ProcessHelper.cs.meta
+1
-1
Unity/Unity.Editor.csproj
Unity/Unity.Editor.csproj
+0
-2
Unity/Unity.Model.csproj
Unity/Unity.Model.csproj
+1
-0
Unity/Unity.sln.DotSettings.user
Unity/Unity.sln.DotSettings.user
+29
-0
未找到文件。
Proto/Proto2CS.dll
浏览文件 @
91ac5dbd
无法预览此类型文件
Proto/Proto2CS.pdb
浏览文件 @
91ac5dbd
无法预览此类型文件
Proto/protoc
0 → 100755
浏览文件 @
91ac5dbd
文件已添加
Server/Model/Component/AppManagerComponent.cs
浏览文件 @
91ac5dbd
...
@@ -56,10 +56,7 @@ namespace ETModel
...
@@ -56,10 +56,7 @@ namespace ETModel
Log
.
Info
(
$"
{
exe
}
{
arguments
}
"
);
Log
.
Info
(
$"
{
exe
}
{
arguments
}
"
);
try
try
{
{
bool
useShellExecute
=
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Windows
);
Process
process
=
ProcessHelper
.
Run
(
exe
,
arguments
);
ProcessStartInfo
info
=
new
ProcessStartInfo
{
FileName
=
exe
,
Arguments
=
arguments
,
CreateNoWindow
=
true
,
UseShellExecute
=
useShellExecute
};
Process
process
=
Process
.
Start
(
info
);
this
.
processes
.
Add
(
startConfig
.
AppId
,
process
);
this
.
processes
.
Add
(
startConfig
.
AppId
,
process
);
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
...
...
Server/Model/Server.Model.csproj
浏览文件 @
91ac5dbd
...
@@ -50,6 +50,9 @@
...
@@ -50,6 +50,9 @@
<Compile Include="..\..\Unity\Assets\Model\Base\Object\IDeserializeSystem.cs">
<Compile Include="..\..\Unity\Assets\Model\Base\Object\IDeserializeSystem.cs">
<Link>Base\Base\IDeserializeSystem.cs</Link>
<Link>Base\Base\IDeserializeSystem.cs</Link>
</Compile>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Base\ProcessHelper.cs">
<Link>Base/ProcessHelper.cs</Link>
</Compile>
<Compile Include="..\..\Unity\Assets\Model\Component\Config\StartConfig.cs">
<Compile Include="..\..\Unity\Assets\Model\Component\Config\StartConfig.cs">
<Link>Component\Config\StartConfig.cs</Link>
<Link>Component\Config\StartConfig.cs</Link>
</Compile>
</Compile>
...
...
Tools/Proto2CS/Program.cs
浏览文件 @
91ac5dbd
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.IO
;
using
System.IO
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Text
;
using
ETModel
;
namespace
ETTools
namespace
ETTools
{
{
...
@@ -16,8 +18,17 @@ namespace ETTools
...
@@ -16,8 +18,17 @@ namespace ETTools
{
{
public
static
void
Main
()
public
static
void
Main
()
{
{
Run
(
"protoc.exe"
,
"--csharp_out=\"../Unity/Assets/Model/Module/Message/\" --proto_path=\"./\" OuterMessage.proto"
);
string
protoc
=
""
;
Run
(
"protoc.exe"
,
"--csharp_out=\"../Unity/Assets/Hotfix/Module/Message/\" --proto_path=\"./\" HotfixMessage.proto"
);
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Windows
))
{
protoc
=
"protoc.exe"
;
}
else
{
protoc
=
"protoc"
;
}
ProcessHelper
.
Run
(
protoc
,
"--csharp_out=\"../Unity/Assets/Model/Module/Message/\" --proto_path=\"./\" OuterMessage.proto"
);
ProcessHelper
.
Run
(
protoc
,
"--csharp_out=\"../Unity/Assets/Hotfix/Module/Message/\" --proto_path=\"./\" HotfixMessage.proto"
);
// InnerMessage.proto生成cs代码
// InnerMessage.proto生成cs代码
InnerProto2CS
.
Proto2CS
();
InnerProto2CS
.
Proto2CS
();
...
@@ -37,28 +48,6 @@ namespace ETTools
...
@@ -37,28 +48,6 @@ namespace ETTools
private
static
readonly
char
[]
splitChars
=
{
' '
,
'\t'
};
private
static
readonly
char
[]
splitChars
=
{
' '
,
'\t'
};
private
static
readonly
List
<
OpcodeInfo
>
msgOpcode
=
new
List
<
OpcodeInfo
>();
private
static
readonly
List
<
OpcodeInfo
>
msgOpcode
=
new
List
<
OpcodeInfo
>();
public
static
void
Run
(
string
exe
,
string
arguments
)
{
Console
.
WriteLine
(
$"execute:
{
exe
}
{
arguments
}
"
);
ProcessStartInfo
info
=
new
ProcessStartInfo
{
FileName
=
exe
,
Arguments
=
arguments
,
CreateNoWindow
=
true
,
UseShellExecute
=
false
,
WorkingDirectory
=
"."
,
RedirectStandardOutput
=
true
,
RedirectStandardError
=
true
,
};
Process
process
=
Process
.
Start
(
info
);
process
.
WaitForExit
();
if
(
process
.
ExitCode
!=
0
)
{
throw
new
Exception
(
process
.
StandardOutput
.
ReadToEnd
()
+
process
.
StandardError
.
ReadToEnd
());
}
}
public
static
void
Proto2CS
(
string
ns
,
string
protoName
,
string
outputPath
,
string
opcodeClassName
,
int
startOpcode
,
bool
isClient
=
true
)
public
static
void
Proto2CS
(
string
ns
,
string
protoName
,
string
outputPath
,
string
opcodeClassName
,
int
startOpcode
,
bool
isClient
=
true
)
{
{
msgOpcode
.
Clear
();
msgOpcode
.
Clear
();
...
...
Tools/Proto2CS/Proto2CS.csproj
浏览文件 @
91ac5dbd
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
<ItemGroup>
<ItemGroup>
<Compile Remove=".vs\**" />
<Compile Remove=".vs\**" />
<Compile Include="..\..\Unity\Assets\Model\Base\ProcessHelper.cs">
<Link>ProcessHelper.cs</Link>
</Compile>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
Unity/Assets/Editor/BuildEditor/BuildHelper.cs
浏览文件 @
91ac5dbd
...
@@ -10,38 +10,11 @@ namespace ETEditor
...
@@ -10,38 +10,11 @@ namespace ETEditor
public
static
string
BuildFolder
=
"../Release/{0}/StreamingAssets/"
;
public
static
string
BuildFolder
=
"../Release/{0}/StreamingAssets/"
;
//[MenuItem("Tools/编译Hotfix")]
public
static
void
BuildHotfix
()
{
System
.
Diagnostics
.
Process
process
=
new
System
.
Diagnostics
.
Process
();
string
unityDir
=
System
.
Environment
.
GetEnvironmentVariable
(
"Unity"
);
if
(
string
.
IsNullOrEmpty
(
unityDir
))
{
Log
.
Error
(
"没有设置Unity环境变量!"
);
return
;
}
process
.
StartInfo
.
FileName
=
$@"
{
unityDir
}
\Editor\Data\MonoBleedingEdge\bin\mono.exe"
;
process
.
StartInfo
.
Arguments
=
$@"
{
unityDir
}
\Editor\Data\MonoBleedingEdge\lib\mono\xbuild\14.0\bin\xbuild.exe .\Hotfix\Unity.Hotfix.csproj"
;
process
.
StartInfo
.
UseShellExecute
=
false
;
process
.
StartInfo
.
WorkingDirectory
=
@".\"
;
process
.
StartInfo
.
RedirectStandardOutput
=
true
;
process
.
StartInfo
.
RedirectStandardError
=
true
;
process
.
Start
();
string
info
=
process
.
StandardOutput
.
ReadToEnd
();
process
.
Close
();
Log
.
Info
(
info
);
}
[
MenuItem
(
"Tools/web资源服务器"
)]
[
MenuItem
(
"Tools/web资源服务器"
)]
public
static
void
OpenFileServer
()
public
static
void
OpenFileServer
()
{
{
string
currentDir
=
System
.
Environment
.
CurrentDirectory
;
ProcessHelper
.
Run
(
"dotnet"
,
"FileServer.dll"
,
"../FileServer/"
);
System
.
Diagnostics
.
Process
process
=
new
System
.
Diagnostics
.
Process
();
process
.
StartInfo
.
FileName
=
"dotnet"
;
process
.
StartInfo
.
Arguments
=
"FileServer.dll"
;
process
.
StartInfo
.
WorkingDirectory
=
"../FileServer/"
;
process
.
StartInfo
.
CreateNoWindow
=
true
;
process
.
Start
();
}
}
public
static
void
Build
(
PlatformType
type
,
BuildAssetBundleOptions
buildAssetBundleOptions
,
BuildOptions
buildOptions
,
bool
isBuildExe
,
bool
isContainAB
)
public
static
void
Build
(
PlatformType
type
,
BuildAssetBundleOptions
buildAssetBundleOptions
,
BuildOptions
buildOptions
,
bool
isBuildExe
,
bool
isContainAB
)
...
...
Unity/Assets/Editor/Helper/ShellHelper.cs
已删除
100644 → 0
浏览文件 @
c600fd0a
using
System.Diagnostics
;
using
UnityEngine
;
namespace
ETEditor
{
public
static
class
ShellHelper
{
public
static
void
Bash
(
this
string
cmd
,
string
workingDirectory
,
bool
startTerminal
=
false
)
{
ProcessStartInfo
startInfo
=
new
ProcessStartInfo
(
"/bin/bash"
)
{
WorkingDirectory
=
workingDirectory
,
UseShellExecute
=
false
,
RedirectStandardInput
=
true
,
RedirectStandardOutput
=
true
};
Process
process
=
new
Process
{
StartInfo
=
startInfo
};
process
.
Start
();
string
code
=
""
;
if
(
startTerminal
)
{
code
=
"osascript -e 'tell application \"Terminal\" to do script \""
+
""
+
cmd
+
"\" in selected tab of the front window'"
;
}
else
{
code
=
cmd
;
}
process
.
StandardInput
.
WriteLine
(
code
);
process
.
StandardInput
.
WriteLine
(
"exit"
);
process
.
StandardInput
.
Flush
();
string
line
=
process
.
StandardOutput
.
ReadLine
();
while
(
line
!=
null
)
{
UnityEngine
.
Debug
.
Log
(
"line:"
+
line
);
line
=
process
.
StandardOutput
.
ReadLine
();
}
process
.
WaitForExit
();
}
}
}
\ No newline at end of file
Unity/Assets/Editor/LogRedirection.cs
已删除
100644 → 0
浏览文件 @
c600fd0a
using
System.Reflection
;
using
System.Text.RegularExpressions
;
using
UnityEditor
;
using
UnityEditor.Callbacks
;
using
UnityEditorInternal
;
using
UnityEngine
;
/// <summary>
/// 日志重定向相关的实用函数。
/// author: NOW
/// Time: 20180226
/// </summary>
internal
static
class
LogRedirection
{
private
static
readonly
Regex
LogRegex
=
new
Regex
(
@" \(at (.+)\:(\d+)\)\r?\n"
);
[
OnOpenAsset
(
0
)]
private
static
bool
OnOpenAsset
(
int
instanceId
,
int
line
)
{
string
selectedStackTrace
=
GetSelectedStackTrace
();
if
(
string
.
IsNullOrEmpty
(
selectedStackTrace
))
{
return
false
;
}
if
(!
selectedStackTrace
.
Contains
(
"ETModel.Log"
))
{
return
false
;
}
Match
match
=
LogRegex
.
Match
(
selectedStackTrace
);
if
(!
match
.
Success
)
{
return
false
;
}
// 跳过第一次匹配的堆栈
match
=
match
.
NextMatch
();
if
(!
match
.
Success
)
{
return
false
;
}
if
(!
selectedStackTrace
.
Contains
(
"ETHotfix.Log"
))
{
InternalEditorUtility
.
OpenFileAtLineExternal
(
Application
.
dataPath
.
Replace
(
"Assets"
,
""
)
+
match
.
Groups
[
1
].
Value
,
int
.
Parse
(
match
.
Groups
[
2
].
Value
));
return
true
;
}
else
{
// 跳过第2次匹配的堆栈
match
=
match
.
NextMatch
();
if
(!
match
.
Success
)
{
return
false
;
}
InternalEditorUtility
.
OpenFileAtLineExternal
(
Application
.
dataPath
.
Replace
(
"Assets"
,
""
)
+
match
.
Groups
[
1
].
Value
,
int
.
Parse
(
match
.
Groups
[
2
].
Value
));
return
true
;
}
}
private
static
string
GetSelectedStackTrace
()
{
Assembly
editorWindowAssembly
=
typeof
(
EditorWindow
).
Assembly
;
if
(
editorWindowAssembly
==
null
)
{
return
null
;
}
System
.
Type
consoleWindowType
=
editorWindowAssembly
.
GetType
(
"UnityEditor.ConsoleWindow"
);
if
(
consoleWindowType
==
null
)
{
return
null
;
}
FieldInfo
consoleWindowFieldInfo
=
consoleWindowType
.
GetField
(
"ms_ConsoleWindow"
,
BindingFlags
.
Static
|
BindingFlags
.
NonPublic
);
if
(
consoleWindowFieldInfo
==
null
)
{
return
null
;
}
EditorWindow
consoleWindow
=
consoleWindowFieldInfo
.
GetValue
(
null
)
as
EditorWindow
;
if
(
consoleWindow
==
null
)
{
return
null
;
}
if
(
consoleWindow
!=
EditorWindow
.
focusedWindow
)
{
return
null
;
}
FieldInfo
activeTextFieldInfo
=
consoleWindowType
.
GetField
(
"m_ActiveText"
,
BindingFlags
.
Instance
|
BindingFlags
.
NonPublic
);
if
(
activeTextFieldInfo
==
null
)
{
return
null
;
}
return
(
string
)
activeTextFieldInfo
.
GetValue
(
consoleWindow
);
}
}
\ No newline at end of file
Unity/Assets/Editor/LogRedirection.cs.meta
已删除
100644 → 0
浏览文件 @
c600fd0a
fileFormatVersion: 2
guid: 311d256107e00ed4bbdd3f0d81922b82
timeCreated: 1525772883
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Editor/Proto2CsEditor/Proto2CSEditor.cs
浏览文件 @
91ac5dbd
using
System
;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
ETModel
;
using
ETModel
;
using
UnityEditor
;
using
UnityEditor
;
...
@@ -10,42 +9,15 @@ namespace ETEditor
...
@@ -10,42 +9,15 @@ namespace ETEditor
public
string
Name
;
public
string
Name
;
public
int
Opcode
;
public
int
Opcode
;
}
}
public
class
Proto2CSEditor
:
EditorWindow
public
class
Proto2CSEditor
:
EditorWindow
{
{
[
MenuItem
(
"Tools/Proto2CS"
)]
[
MenuItem
(
"Tools/Proto2CS"
)]
public
static
void
AllProto2CS
()
public
static
void
AllProto2CS
()
{
{
CommandRun
();
Process
process
=
ProcessHelper
.
Run
(
"dotnet"
,
"Proto2CS.dll"
,
"../Proto/"
,
true
);
Log
.
Info
(
process
.
StandardOutput
.
ReadToEnd
());
AssetDatabase
.
Refresh
();
AssetDatabase
.
Refresh
();
}
}
public
static
void
CommandRun
()
{
try
{
ProcessStartInfo
info
=
new
ProcessStartInfo
{
CreateNoWindow
=
true
,
FileName
=
"dotnet"
,
Arguments
=
"Proto2CS.dll"
,
UseShellExecute
=
false
,
WorkingDirectory
=
"../Proto/"
,
RedirectStandardOutput
=
true
,
RedirectStandardError
=
true
,
};
Process
process
=
Process
.
Start
(
info
);
process
.
WaitForExit
();
if
(
process
.
ExitCode
!=
0
)
{
throw
new
Exception
(
process
.
StandardOutput
.
ReadToEnd
()
+
process
.
StandardError
.
ReadToEnd
());
}
Log
.
Info
(
process
.
StandardOutput
.
ReadToEnd
());
}
catch
(
Exception
e
)
{
Log
.
Error
(
e
);
}
}
}
}
}
}
Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs
浏览文件 @
91ac5dbd
...
@@ -82,14 +82,7 @@ namespace ETEditor
...
@@ -82,14 +82,7 @@ namespace ETEditor
{
{
string
arguments
=
string
arguments
=
$"-vzrtopg --password-file=./Tools/cwRsync/Config/rsync.secrets --exclude-from=./Tools/cwRsync/Config/exclude.txt --delete ./
{
this
.
rsyncConfig
.
Account
}
@
{
this
.
rsyncConfig
.
Host
}
::Upload/
{
this
.
rsyncConfig
.
RelativePath
}
--chmod=ugo=rwX"
;
$"-vzrtopg --password-file=./Tools/cwRsync/Config/rsync.secrets --exclude-from=./Tools/cwRsync/Config/exclude.txt --delete ./
{
this
.
rsyncConfig
.
Account
}
@
{
this
.
rsyncConfig
.
Host
}
::Upload/
{
this
.
rsyncConfig
.
RelativePath
}
--chmod=ugo=rwX"
;
ProcessStartInfo
startInfo
=
new
ProcessStartInfo
();
ProcessHelper
.
Run
(
@"./Tools/cwRsync/rsync.exe"
,
arguments
,
@"..\"
,
waitExit
:
true
);
startInfo
.
FileName
=
@".\Tools\cwRsync\rsync.exe"
;
startInfo
.
Arguments
=
arguments
;
startInfo
.
UseShellExecute
=
true
;
startInfo
.
WorkingDirectory
=
@"..\"
;
Process
p
=
Process
.
Start
(
startInfo
);
p
.
WaitForExit
();
Log
.
Info
(
$"
{
startInfo
.
FileName
}
{
startInfo
.
Arguments
}
"
);
Log
.
Info
(
"同步完成!"
);
Log
.
Info
(
"同步完成!"
);
}
}
}
}
...
...
Unity/Assets/Editor/ServerCommandLineEditor/ServerCommandLineEditor.cs
浏览文件 @
91ac5dbd
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
ETModel
;
using
ETModel
;
using
MongoDB.Bson
;
using
MongoDB.Bson
;
using
UnityEditor
;
using
UnityEditor
;
...
@@ -403,9 +404,7 @@ namespace ETEditor
...
@@ -403,9 +404,7 @@ namespace ETEditor
}
}
string
arguments
=
$"App.dll --appId=
{
startConfig
.
AppId
}
--appType=
{
startConfig
.
AppType
}
--config=../Config/StartConfig/
{
this
.
fileName
}
"
;
string
arguments
=
$"App.dll --appId=
{
startConfig
.
AppId
}
--appType=
{
startConfig
.
AppType
}
--config=../Config/StartConfig/
{
this
.
fileName
}
"
;
ProcessHelper
.
Run
(
"dotnet"
,
arguments
,
"../Bin/"
);
ProcessStartInfo
info
=
new
ProcessStartInfo
(
"dotnet"
,
arguments
)
{
UseShellExecute
=
true
,
WorkingDirectory
=
@"../Bin/"
};
Process
.
Start
(
info
);
}
}
GUILayout
.
EndHorizontal
();
GUILayout
.
EndHorizontal
();
}
}
...
...
Unity/Assets/Model/Base/ProcessHelper.cs
0 → 100644
浏览文件 @
91ac5dbd
using
System
;
using
System.Diagnostics
;
using
System.Runtime.InteropServices
;
namespace
ETModel
{
public
static
class
ProcessHelper
{
public
static
Process
Run
(
string
exe
,
string
arguments
,
string
workingDirectory
=
"."
,
bool
waitExit
=
false
)
{
try
{
bool
redirectStandardOutput
=
true
;
bool
redirectStandardError
=
true
;
bool
useShellExecute
=
false
;
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Windows
))
{
redirectStandardOutput
=
false
;
redirectStandardError
=
false
;
useShellExecute
=
true
;
}
if
(
waitExit
)
{
redirectStandardOutput
=
true
;
redirectStandardError
=
true
;
useShellExecute
=
false
;
}
ProcessStartInfo
info
=
new
ProcessStartInfo
{
FileName
=
exe
,
Arguments
=
arguments
,
CreateNoWindow
=
true
,
UseShellExecute
=
useShellExecute
,
WorkingDirectory
=
workingDirectory
,
RedirectStandardOutput
=
redirectStandardOutput
,
RedirectStandardError
=
redirectStandardError
,
};
Process
process
=
Process
.
Start
(
info
);
if
(
waitExit
)
{
process
.
WaitForExit
();
if
(
process
.
ExitCode
!=
0
)
{
throw
new
Exception
(
process
.
StandardOutput
.
ReadToEnd
()
+
process
.
StandardError
.
ReadToEnd
()
+
"\n"
+
$"请在terminal中执行,目录
{
workingDirectory
}
, 命令
{
exe
}
{
arguments
}
"
);
}
}
return
process
;
}
catch
(
Exception
e
)
{
throw
new
Exception
(
$"请在terminal中执行,目录
{
workingDirectory
}
, 命令
{
exe
}
{
arguments
}
"
,
e
);
}
}
}
}
\ No newline at end of file
Unity/Assets/
Editor/Helper/Shell
Helper.cs.meta
→
Unity/Assets/
Model/Base/Process
Helper.cs.meta
浏览文件 @
91ac5dbd
fileFormatVersion: 2
fileFormatVersion: 2
guid:
7c53f2d83b6153a47ab75bf18c7a96f1
guid:
2526ac32d65b645b3bc103ac14a1953a
MonoImporter:
MonoImporter:
externalObjects: {}
externalObjects: {}
serializedVersion: 2
serializedVersion: 2
...
...
Unity/Unity.Editor.csproj
浏览文件 @
91ac5dbd
...
@@ -103,9 +103,7 @@
...
@@ -103,9 +103,7 @@
<Compile
Include=
"Assets\Editor\ExcelExporterEditor\ExcelExporterEditor.cs"
/>
<Compile
Include=
"Assets\Editor\ExcelExporterEditor\ExcelExporterEditor.cs"
/>
<Compile
Include=
"Assets\Editor\GlobalConfigEditor\GlobalConfigEditor.cs"
/>
<Compile
Include=
"Assets\Editor\GlobalConfigEditor\GlobalConfigEditor.cs"
/>
<Compile
Include=
"Assets\Editor\Helper\EditorResHelper.cs"
/>
<Compile
Include=
"Assets\Editor\Helper\EditorResHelper.cs"
/>
<Compile
Include=
"Assets\Editor\Helper\ShellHelper.cs"
/>
<Compile
Include=
"Assets\Editor\ILRuntimeEditor\ILRuntimeCLRBinding.cs"
/>
<Compile
Include=
"Assets\Editor\ILRuntimeEditor\ILRuntimeCLRBinding.cs"
/>
<Compile
Include=
"Assets\Editor\LogRedirection.cs"
/>
<Compile
Include=
"Assets\Editor\Proto2CsEditor\InnerProto2CS.cs"
/>
<Compile
Include=
"Assets\Editor\Proto2CsEditor\InnerProto2CS.cs"
/>
<Compile
Include=
"Assets\Editor\Proto2CsEditor\Proto2CSEditor.cs"
/>
<Compile
Include=
"Assets\Editor\Proto2CsEditor\Proto2CSEditor.cs"
/>
<Compile
Include=
"Assets\Editor\ReferenceCollectorEditor\ReferenceCollectorEditor.cs"
/>
<Compile
Include=
"Assets\Editor\ReferenceCollectorEditor\ReferenceCollectorEditor.cs"
/>
...
...
Unity/Unity.Model.csproj
浏览文件 @
91ac5dbd
...
@@ -115,6 +115,7 @@
...
@@ -115,6 +115,7 @@
<Compile
Include=
"Assets\Model\Base\Object\ObjectPool.cs"
/>
<Compile
Include=
"Assets\Model\Base\Object\ObjectPool.cs"
/>
<Compile
Include=
"Assets\Model\Base\Object\ObjectSystemAttribute.cs"
/>
<Compile
Include=
"Assets\Model\Base\Object\ObjectSystemAttribute.cs"
/>
<Compile
Include=
"Assets\Model\Base\OneThreadSynchronizationContext.cs"
/>
<Compile
Include=
"Assets\Model\Base\OneThreadSynchronizationContext.cs"
/>
<Compile
Include=
"Assets\Model\Base\ProcessHelper.cs"
/>
<Compile
Include=
"Assets\Model\Base\QueueDictionary.cs"
/>
<Compile
Include=
"Assets\Model\Base\QueueDictionary.cs"
/>
<Compile
Include=
"Assets\Model\Base\RecyclableMemoryStream\Events.cs"
/>
<Compile
Include=
"Assets\Model\Base\RecyclableMemoryStream\Events.cs"
/>
<Compile
Include=
"Assets\Model\Base\RecyclableMemoryStream\RecyclableMemoryStream.cs"
/>
<Compile
Include=
"Assets\Model\Base\RecyclableMemoryStream\RecyclableMemoryStream.cs"
/>
...
...
Unity/Unity.sln.DotSettings.user
0 → 100644
浏览文件 @
91ac5dbd
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=TypesAndNamespaces/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=TypesAndNamespaces/@EntryIndexRemoved">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Interfaces/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=TypeParameters/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Method/@EntryIndexRemoved">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Property/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Event/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Event/@EntryIndexRemoved">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Locals/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=LocalConstants/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=LocalConstants/@EntryIndexRemoved">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Parameters/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PublicFields/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PublicFields/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateInstanceFields/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateStaticFields/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateStaticFields/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Constants/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Constants/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateConstants/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateConstants/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=StaticReadonly/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=StaticReadonly/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PrivateStaticReadonly/@EntryIndexRemoved">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=EnumMember/@EntryIndexRemoved">True</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/AutoNamingCompletedVersion/@EntryValue">2</s:Int64></wpf:ResourceDictionary>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录