@@ -2096,6 +2096,7 @@ void RefreshBuildReports()
2096
2096
bool collectedBuildTime = false ;
2097
2097
2098
2098
bool gotProjectPath = false ;
2099
+ bool hasTimeStamps = false ;
2099
2100
2100
2101
// TODO cleanup here
2101
2102
while ( ! sr . EndOfStream )
@@ -2108,8 +2109,23 @@ void RefreshBuildReports()
2108
2109
currentBuildReportProjectPath = line ;
2109
2110
gotProjectPath = false ;
2110
2111
}
2111
- if ( line == "-projectPath" ) gotProjectPath = true ;
2112
2112
2113
+ // if have timestamps, trim until 2nd | char at start
2114
+
2115
+ // check arguments
2116
+ if ( line . IndexOf ( "-projectPath" ) > - 1 ) gotProjectPath = true ;
2117
+ if ( hasTimeStamps == false && line . IndexOf ( "-timestamps" ) > - 1 )
2118
+ {
2119
+ hasTimeStamps = true ;
2120
+ // need to fix projectpath then
2121
+ currentBuildReportProjectPath = currentBuildReportProjectPath . Substring ( currentBuildReportProjectPath . IndexOf ( "|" , currentBuildReportProjectPath . IndexOf ( "|" ) + 1 ) + 1 ) ;
2122
+ }
2123
+
2124
+ // remove timestamp from line, NOTE if | character exists somewhere else than timestamp, causes issue
2125
+ if ( hasTimeStamps && line . IndexOf ( "|" ) > - 1 )
2126
+ {
2127
+ line = line . Substring ( line . IndexOf ( "|" , line . IndexOf ( "|" ) + 1 ) + 1 ) . Trim ( ) ;
2128
+ }
2113
2129
2114
2130
// build report starts
2115
2131
if ( collectRows == false && line . IndexOf ( "Used Assets and files from the Resources folder, sorted by uncompressed size:" ) == 0 )
@@ -2151,14 +2167,19 @@ void RefreshBuildReports()
2151
2167
{
2152
2168
// it wasnt clean build, no report
2153
2169
if ( singleReport == null ) continue ;
2170
+ int start = line . IndexOf ( "(" ) + 1 ;
2171
+ int end = line . IndexOf ( " ms)" , start ) ;
2154
2172
2155
- var ms = line . Substring ( line . IndexOf ( "(" ) + 1 , line . IndexOf ( ")" ) - line . IndexOf ( "(" ) - 1 ) . Trim ( ) . Replace ( " ms" , "" ) ;
2156
- singleReport . ElapsedTimeMS = long . Parse ( ms ) ;
2157
- collectedBuildTime = true ;
2173
+ if ( start > 0 && end > start )
2174
+ {
2175
+ string numberString = line . Substring ( start , end - start ) ;
2176
+ singleReport . ElapsedTimeMS = long . Parse ( numberString ) ;
2177
+ collectedBuildTime = true ;
2178
+ }
2158
2179
2159
2180
if ( string . IsNullOrEmpty ( currentBuildReportProjectPath ) == false )
2160
2181
{
2161
- // get streamingassets folder size and add to report, NOTE need to recalculate sizes then?
2182
+ // get streamingassets folder size and add as last item to report, NOTE need to recalculate sizes then?
2162
2183
string streamingAssetPath = Path . Combine ( currentBuildReportProjectPath , "Assets" , "StreamingAssets" ) ;
2163
2184
var streamingAssetFolderSize = Tools . GetFolderSizeInBytes ( streamingAssetPath ) ;
2164
2185
singleReport . Stats . Insert ( singleReport . Stats . Count - 1 , new BuildReportItem ( ) { Category = "StreamingAssets" , Size = Tools . GetBytesReadable ( streamingAssetFolderSize ) } ) ;
@@ -2214,8 +2235,10 @@ void RefreshBuildReports()
2214
2235
2215
2236
if ( collectStats == true )
2216
2237
{
2238
+
2239
+ //if (hasTimeStamps)
2217
2240
var line2 = line . Trim ( ) ;
2218
- // get 2xspace after category name
2241
+ // get 2x space after category name
2219
2242
var space1 = line2 . IndexOf ( " " ) ;
2220
2243
// get tab after first size
2221
2244
var space2 = line2 . IndexOf ( '\t ' ) ;
0 commit comments