|
@@ -1,5 +1,22 @@
|
|
|
-using YSAI.Log;
|
|
|
|
|
|
|
+using System.Diagnostics;
|
|
|
|
|
+using System.Text;
|
|
|
|
|
+using YSAI.Log;
|
|
|
using YSAI.Unility;
|
|
using YSAI.Unility;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+LogHelper.Info(@"
|
|
|
|
|
+ ██╗ ██╗ ████████╗ ██╗ ████████╗
|
|
|
|
|
+ ██╗ ██╔╝ ██╔═══██║ ████╗ ╚══██╔══╝
|
|
|
|
|
+ ██╗ ██╔╝ ██║ ╚═╝ ██╝ ██╗ ██║
|
|
|
|
|
+ ████╔╝ ████████╗ ██╝ ██╗ ██║
|
|
|
|
|
+ ██╔╝ ██║ ██████████╗ ██║
|
|
|
|
|
+ ██║ ██ ██║ ██╔═══════██╗ ██║
|
|
|
|
|
+ ██║ ████████║ ██╔╝ ╚██╗ ████████╗
|
|
|
|
|
+ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ ╚═══════╝
|
|
|
|
|
+");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//版本工具
|
|
//版本工具
|
|
|
//需要版本更新的库
|
|
//需要版本更新的库
|
|
|
//【注意:更新完后请注释掉】
|
|
//【注意:更新完后请注释掉】
|
|
@@ -32,7 +49,6 @@ List<string> strings = new List<string>
|
|
|
//"YSAI.Omron",
|
|
//"YSAI.Omron",
|
|
|
//"YSAI.Opc",
|
|
//"YSAI.Opc",
|
|
|
//"YSAI.Siemens",
|
|
//"YSAI.Siemens",
|
|
|
-
|
|
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -79,11 +95,87 @@ foreach (var lib in libs)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+int index = 0;
|
|
|
|
|
+//修改此文件的中的版本号
|
|
|
foreach (var var in paths)
|
|
foreach (var var in paths)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (index == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ LogHelper.Info("╔═══════════════════════════════════╦═══════════════════════════════╗");
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ LogHelper.Info("╠═══════════════════════════════════╬═══════════════════════════════╣");
|
|
|
|
|
+ }
|
|
|
string ver = $"{DateTime.UtcNow.ToString("yy")}.{DateTime.UtcNow.DayOfYear.ToString("0")}.{DateTime.UtcNow.TimeOfDay.TotalSeconds.ToString("0")}";
|
|
string ver = $"{DateTime.UtcNow.ToString("yy")}.{DateTime.UtcNow.DayOfYear.ToString("0")}.{DateTime.UtcNow.TimeOfDay.TotalSeconds.ToString("0")}";
|
|
|
- LogHelper.Info($"{var.name} - Ver:{ver}");
|
|
|
|
|
|
|
+ LogHelper.Info(string.Format("║{0,-10}{1,-20}{2,-5}║{3,-10}{4,-21}║", string.Empty, var.name, string.Empty, string.Empty, ver));
|
|
|
XmlTool.Update(var.path, xmlPath, string.Empty, ver);
|
|
XmlTool.Update(var.path, xmlPath, string.Empty, ver);
|
|
|
|
|
+ index++;
|
|
|
}
|
|
}
|
|
|
|
|
+index = 0;
|
|
|
|
|
+LogHelper.Info("╠═══════════════════════════════════╩═══════════════════════════════╣");
|
|
|
|
|
+LogHelper.Info(string.Format("║{0,-10}{1}{2,-20}║", string.Empty, "版本更新已完成,正在打包中,请等待...", string.Empty));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//执行生成包
|
|
|
|
|
+foreach (var item in paths)
|
|
|
|
|
+{
|
|
|
|
|
+ using (Process process = new Process())
|
|
|
|
|
+ {
|
|
|
|
|
+ //设置要启动的应用程序
|
|
|
|
|
+ process.StartInfo.FileName = "cmd.exe";
|
|
|
|
|
+ process.StartInfo.StandardOutputEncoding = Encoding.UTF8;
|
|
|
|
|
+ //是否使用操作系统shell启动
|
|
|
|
|
+ process.StartInfo.UseShellExecute = false;
|
|
|
|
|
+ // 接受来自调用程序的输入信息
|
|
|
|
|
+ process.StartInfo.RedirectStandardInput = true;
|
|
|
|
|
+ //输出信息
|
|
|
|
|
+ process.StartInfo.RedirectStandardOutput = true;
|
|
|
|
|
+ // 输出错误
|
|
|
|
|
+ process.StartInfo.RedirectStandardError = true;
|
|
|
|
|
+ //不显示程序窗口
|
|
|
|
|
+ process.StartInfo.CreateNoWindow = true;
|
|
|
|
|
+ process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
|
|
|
|
|
+ //显示信息
|
|
|
|
|
+ process.OutputDataReceived += delegate (object sender, DataReceivedEventArgs e)
|
|
|
|
|
+ {
|
|
|
|
|
+ //LogHelper.Verbose(e.Data);
|
|
|
|
|
+ };
|
|
|
|
|
+ //显示异常信息
|
|
|
|
|
+ process.ErrorDataReceived += delegate (object sender, DataReceivedEventArgs e)
|
|
|
|
|
+ {
|
|
|
|
|
+ //LogHelper.Verbose(e.Data);
|
|
|
|
|
+ };
|
|
|
|
|
+ //启动程序
|
|
|
|
|
+ process.Start();
|
|
|
|
|
+ //写入命令
|
|
|
|
|
+ process.StandardInput.WriteLine($"dotnet pack {item.path} -c Release");
|
|
|
|
|
+ process.StandardInput.AutoFlush = true;
|
|
|
|
|
+
|
|
|
|
|
+ process.BeginErrorReadLine();
|
|
|
|
|
+ process.BeginOutputReadLine();
|
|
|
|
|
+
|
|
|
|
|
+ process.StandardInput.WriteLine("exit");
|
|
|
|
|
+
|
|
|
|
|
+ //等待程序执行完退出进程
|
|
|
|
|
+ process.WaitForExit();
|
|
|
|
|
+ process.Close();
|
|
|
|
|
+ if (index == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ LogHelper.Info("╠═══════════════════════════════════╦═══════════════════════════════╣");
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ LogHelper.Info("╠═══════════════════════════════════╬═══════════════════════════════╣");
|
|
|
|
|
+ }
|
|
|
|
|
+ LogHelper.Info(string.Format("║{0,-10}{1,-20}{2,-5}║{3,-10}{4,-17}║", string.Empty, item.name, string.Empty, string.Empty, "打包成功"));
|
|
|
|
|
+ index++;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+LogHelper.Info("╚═══════════════════════════════════╩═══════════════════════════════╝");
|
|
|
|
|
+
|
|
|
|
|
+//包输出路基
|
|
|
|
|
+string outPath = Path.Combine(Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetParent(Environment.CurrentDirectory).FullName).FullName).FullName).FullName, "YSAI.Publish\\Release\\AAAAA.NuGet.Pack.Publish.bat");
|
|
|
|
|
|
|
|
-LogHelper.Info("~~~~~~~~~~版本更新完成~~~~~~~~~~");
|
|
|
|
|
|
|
+//打开文件夹,选中文件
|
|
|
|
|
+Process.Start("explorer.exe", $"/select,{outPath}");
|