@@ -1855,7 +1855,7 @@ void RefreshBuildReports()
18551855 var logFile = Path . Combine ( Tools . GetEditorLogsFolder ( ) , "Editor.log" ) ;
18561856 if ( File . Exists ( logFile ) == false ) return ;
18571857
1858- BuildReport singleReport = new BuildReport ( ) ;
1858+ BuildReport singleReport = null ; // new BuildReport();
18591859
18601860 try
18611861 {
@@ -1902,15 +1902,28 @@ void RefreshBuildReports()
19021902 // build report category stats starts
19031903 if ( collectStats == false && line . IndexOf ( "Uncompressed usage by category (Percentages based on user generated assets only):" ) == 0 )
19041904 {
1905+ // start new
1906+ singleReport = new BuildReport ( ) ;
1907+
19051908 // init new list for this build report
19061909 singleReport . Stats = new List < BuildReportItem > ( ) ;
19071910 collectStats = true ;
19081911 continue ;
19091912 }
19101913
1914+ if ( collectStats == false && line . IndexOf ( "Do a clean build to view the Asset build report information." ) == 0 )
1915+ {
1916+ // dont start collecting, no build report
1917+ collectStats = false ;
1918+ continue ;
1919+ }
1920+
19111921 // build report ends with elapsed time
19121922 if ( collectedBuildTime == false && line . IndexOf ( "Build completed with a result of 'Succeeded' in " ) == 0 )
19131923 {
1924+ // it wasnt clean build, no report
1925+ if ( singleReport == null ) continue ;
1926+
19141927 var ms = line . Substring ( line . IndexOf ( "(" ) + 1 , line . IndexOf ( ")" ) - line . IndexOf ( "(" ) - 1 ) . Trim ( ) . Replace ( " ms" , "" ) ;
19151928 singleReport . ElapsedTimeMS = long . Parse ( ms ) ;
19161929 collectedBuildTime = true ;
@@ -1922,8 +1935,8 @@ void RefreshBuildReports()
19221935 // add all rows and stat rows for this build report
19231936 buildReports . Add ( singleReport ) ;
19241937
1925- // make new
1926- singleReport = new BuildReport ( ) ;
1938+ // erase old
1939+ singleReport = null ;
19271940 continue ;
19281941 }
19291942
@@ -2077,13 +2090,13 @@ void UpdateBuildReportLabelAndButtons()
20772090 btnPrevBuildReport . IsEnabled = currentBuildReport > 0 ;
20782091 btnNextBuildReport . IsEnabled = currentBuildReport < buildReports . Count - 1 ;
20792092 lblBuildReportIndex . Content = ( buildReports . Count == 0 ? 0 : ( currentBuildReport + 1 ) ) + "/" + ( buildReports . Count ) ;
2080- txtBuildTime . Text = "" ;
20812093 }
20822094
20832095 private void BtnClearBuildReport_Click ( object sender , RoutedEventArgs e )
20842096 {
20852097 gridBuildReport . ItemsSource = null ;
20862098 gridBuildReportData . ItemsSource = null ;
2099+ txtBuildTime . Text = "" ;
20872100 currentBuildReport = 0 ;
20882101 buildReports . Clear ( ) ;
20892102 UpdateBuildReportLabelAndButtons ( ) ;
0 commit comments