1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-11 12:15:44 +02:00

Project tweaks (make update installer on build, stopwatch resource swap, formatting)

This commit is contained in:
chylex 2018-07-08 05:03:30 +02:00
parent 2dbf778e56
commit 34c8d44dfe
3 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,4 @@
using System;
using System.IO;
using TweetDuck.Core;
using TweetDuck.Data.Serialization;

View File

@ -5,6 +5,7 @@
using System.Windows.Forms;
using TweetDuck.Core.Controls;
using TweetDuck.Core.Other;
#if DEBUG
using System.Diagnostics;
using System.Reflection;
@ -88,7 +89,7 @@ private static void ShowLoadError(bool silent, Control sync, string message){
static ScriptLoader(){
if (File.Exists(HotSwapRebuildScript)){
Debug.WriteLine("Activating resource hot swap");
Debug.WriteLine("Activating resource hot swap...");
ResetHotSwap();
Application.ApplicationExit += (sender, args) => ResetHotSwap();
@ -104,6 +105,8 @@ public static void HotSwap(){
ResetHotSwap();
Directory.CreateDirectory(HotSwapTargetDir);
Stopwatch sw = Stopwatch.StartNew();
using(Process process = Process.Start(new ProcessStartInfo{
FileName = "powershell",
Arguments = $"-ExecutionPolicy Unrestricted -File \"{HotSwapRebuildScript}\" \"{HotSwapTargetDir}\\\" \"{HotSwapProjectRoot}\\\" \"Debug\" \"{Program.VersionTag}\"",
@ -120,6 +123,9 @@ public static void HotSwap(){
}
}
sw.Stop();
Debug.WriteLine("Finished rebuild script in "+sw.ElapsedMilliseconds+" ms");
// Force update plugin manager setup scripts
string newPluginRoot = Path.Combine(HotSwapTargetDir, "plugins");

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\CefSharp.WinForms.67.0.0-CI2658\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.67.0.0-CI2658\build\CefSharp.WinForms.props')" />
<Import Project="packages\CefSharp.Common.67.0.0-CI2658\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.67.0.0-CI2658\build\CefSharp.Common.props')" />
@ -410,6 +410,7 @@ powershell -ExecutionPolicy Unrestricted -File "$(ProjectDir)Resources\PostBuild
<Exec Command="del &quot;$(TargetDir)*.xml&quot;" />
<Delete Files="$(TargetDir)CefSharp.BrowserSubprocess.exe" />
<Delete Files="$(TargetDir)widevinecdmadapter.dll" />
<Exec Command="&quot;$(ProjectDir)bld\UPDATE ONLY.bat&quot;" WorkingDirectory="$(ProjectDir)bld\" IgnoreExitCode="true" />
</Target>
<PropertyGroup>
<PreBuildEvent>powershell Get-Process TweetDuck.Browser -ErrorAction SilentlyContinue ^| Where-Object {$_.Path -eq '$(TargetDir)TweetDuck.Browser.exe'} ^| Stop-Process; Exit 0</PreBuildEvent>