TFS的Revert 与Update:
private void RevertFromTFS(string strLocalPath)
{
string strCommand = "undo " + strLocalPath + " /recursive /login:" + m_strTfsAccount + "," + m_strTfsPassword;
ExecuteCommand( m_txt_TfsPath.Text, strCommand );
}
private void UpdateFromTFS(string strLocalPath, string strChangest)
{
string strCommand = "get " + strLocalPath + " /recursive /noprompt /login:" + m_strTfsAccount + "," + m_strTfsPassword;
if ( strChangest.Length > 0 )
{
strCommand += " /v:" + strChangest;
}
ExecuteCommand( m_txt_TfsPath.Text, strCommand );
}
C#通过命令行调用进程:
private string[] ExecuteCommand(string exePath, string commandLine)
{
System.Diagnostics.Process sysProcess = new System.Diagnostics.Process();
sysProcess.StartInfo.FileName = exePath;
sysProcess.StartInfo.Arguments = commandLine;
sysProcess.StartInfo.UseShellExecute = false; //是否使用操作系统shell启动
sysProcess.StartInfo.RedirectStandardInput = true; //是否接受调用程序的输入信息
sysProcess.StartInfo.RedirectStandardOutput = true; //是否由调用程序获取输出信息
sysProcess.StartInfo.RedirectStandardError = true; //是否重定向标准错误输出
sysProcess.StartInfo.CreateNoWindow = true; //是否不显示程序窗口
sysProcess.Start();
string[] szExecuteInfo = new string[2];
szExecuteInfo[0] = sysProcess.StandardOutput.ReadToEnd();
szExecuteInfo[1] = sysProcess.StandardError.ReadToEnd();
sysProcess.WaitForExit();
sysProcess.Close();
char[] szTrim = { ' ', '\r', '\n' };
RecordLog( "--> processed: " + szExecuteInfo[1].Trim( szTrim ) );
return szExecuteInfo;
}
Unity打Android包的核心设置ProjectSettings/ProjectSettings.asset,配置里包括 iPhoneBundleIdentifier, iPhoneBundleVersion, AndroidBundleVersionCode, AndroidMinSdkVersion, companyName, productName; 注意scriptDefineSymbols包含了宏定义,以7:开头