12
12
using System . Windows ;
13
13
using System . Windows . Controls ;
14
14
using System . Windows . Input ;
15
+ using System . Windows . Media ;
15
16
using UnityLauncherPro . Helpers ;
16
17
17
18
namespace UnityLauncherPro
@@ -1378,6 +1379,11 @@ public static void OpenAppdataSpecialFolder(string subfolder)
1378
1379
public static void BuildProject ( Project proj , Platform platform )
1379
1380
{
1380
1381
Console . WriteLine ( "Building " + proj . Title + " for " + platform ) ;
1382
+ SetStatus ( "Build process started: " + DateTime . Now . ToString ( "HH:mm:ss" ) ) ;
1383
+
1384
+ // TODO use theme colors, keep list of multiple builds, if click status button show list of builds, if click for single build (show output folder)
1385
+ SetBuildStatus ( Colors . Red ) ;
1386
+
1381
1387
if ( string . IsNullOrEmpty ( proj . Path ) ) return ;
1382
1388
1383
1389
// create builder script template (with template string, that can be replaced with project related paths or names?)
@@ -1454,7 +1460,7 @@ static string[] GetScenes()
1454
1460
1455
1461
// create commandline string for building and launch it
1456
1462
//var buildcmd = $"\"{unityExePath}\" -quit -batchmode -nographics -projectPath \"{proj.Path}\" -executeMethod \"Builder.BuildAndroid\" -buildTarget android -logFile -";
1457
- var buildParams = $ " -quit -batchmode -nographics -projectPath \" { proj . Path } \" -executeMethod \" UnityLauncherProTools.Build{ platform } \" -buildTarget { platform } -logFile - ";
1463
+ var buildParams = $ " -quit -batchmode -nographics -projectPath \" { proj . Path } \" -executeMethod \" UnityLauncherProTools.Build{ platform } \" -buildTarget { platform } -logFile \" { outputFolder } /../build.log \" ";
1458
1464
Console . WriteLine ( "buildcmd= " + buildParams ) ;
1459
1465
1460
1466
// launch build
@@ -1465,6 +1471,9 @@ static string[] GetScenes()
1465
1471
{
1466
1472
Console . WriteLine ( "Build process exited: " + outputFolder ) ;
1467
1473
Tools . ExploreFolder ( outputFolder ) ;
1474
+ SetStatus ( "Build process finished: " + DateTime . Now . ToString ( "HH:mm:ss" ) ) ;
1475
+ // TODO set color based on results
1476
+ SetBuildStatus ( Colors . Green ) ;
1468
1477
} ;
1469
1478
1470
1479
}
@@ -1754,6 +1763,19 @@ internal static string GetBytesReadable(long i)
1754
1763
return readable . ToString ( "0.### " ) + suffix ;
1755
1764
}
1756
1765
1766
+ public static MainWindow mainWindow ;
1767
+
1768
+ // set status bar in main thread
1769
+ public static void SetStatus ( string text )
1770
+ {
1771
+ mainWindow . Dispatcher . Invoke ( ( ) => { mainWindow . SetStatus ( text ) ; } ) ;
1772
+ }
1773
+
1774
+ public static void SetBuildStatus ( Color color )
1775
+ {
1776
+ mainWindow . Dispatcher . Invoke ( ( ) => { mainWindow . SetBuildStatus ( color ) ; } ) ;
1777
+ }
1778
+
1757
1779
} // class
1758
1780
1759
1781
} // namespace
0 commit comments