@@ -65,6 +65,7 @@ class BuildImpl {
6565 {DateTime validAsOf, Map <AssetId , ChangeType > updates}) async {
6666 validAsOf ?? = new DateTime .now ();
6767 updates ?? = < AssetId , ChangeType > {};
68+ var watch = new Stopwatch ()..start ();
6869
6970 /// Assume incremental, change if necessary.
7071 var buildType = BuildType .Incremental ;
@@ -104,13 +105,11 @@ class BuildImpl {
104105 .forEach (
105106 (node) => (node as GeneratedAssetNode ).needsUpdate = true );
106107 } else {
107- var message = 'Build abandoned due to change to the build script or '
108- 'one of its dependencies. This could be caused by a pub get or '
109- 'any other change. Please terminate the build script and restart '
110- 'it.' ;
111- _logger.severe (message);
112108 done.complete (new BuildResult (BuildStatus .Failure , buildType, [],
113- exception: message));
109+ exception: 'Build abandoned due to change to the build script or '
110+ 'one of its dependencies. This could be caused by a pub get '
111+ 'or any other change. Please terminate the build script and '
112+ 'restart it.' ));
114113 return ;
115114 }
116115 }
@@ -139,16 +138,23 @@ class BuildImpl {
139138 new Asset (_assetGraphId, JSON .encode (_assetGraph.serialize ()));
140139 await _writer.writeAsString (assetGraphAsset);
141140
142- _logger.info ('Build succeeded' );
143141 done.complete (result);
144142 }, onError: (e, Chain chain) {
145- _logger.severe ('Build failed: $e \n\n ${chain .terse }' );
146143 done.complete (new BuildResult (BuildStatus .Failure , buildType, [],
147144 exception: e, stackTrace: chain.toTrace ()));
148145 });
149146 var result = await done.future;
150147 _buildRunning = false ;
151148 _isFirstBuild = false ;
149+ if (result.status == BuildStatus .Success ) {
150+ _logger.info ('Succeeded after ${watch .elapsedMilliseconds }ms with '
151+ '${result .outputs .length } outputs\n ' );
152+ } else {
153+ var stackTraceString =
154+ result.stackTrace != null ? '\n\n ${result .stackTrace }' : '' ;
155+ _logger.severe ('Failed after ${watch .elapsedMilliseconds }ms:'
156+ '${result .exception }$stackTraceString \n ' );
157+ }
152158 return result;
153159 }
154160
@@ -344,13 +350,13 @@ class BuildImpl {
344350 // Check conflictingOuputs, prompt user to delete files.
345351 if (conflictingOutputs.isEmpty) return ;
346352
347- stdout.writeln ('Found ${conflictingOutputs .length } declared outputs '
353+ stdout.writeln ('\n\n Found ${conflictingOutputs .length } declared outputs '
348354 'which already exist on disk. This is likely because the `.build` '
349355 'folder was deleted, or you are submitting generated files to your '
350356 'source repository.' );
351357 var done = false ;
352358 while (! done) {
353- stdout.write ('Delete these files (y/n) (or list them (l))?: ' );
359+ stdout.write ('\n Delete these files (y/n) (or list them (l))?: ' );
354360 var input = stdin.readLineSync ();
355361 switch (input.toLowerCase ()) {
356362 case 'y' :
0 commit comments