Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: dart/tools/build.py

Issue 223703002: Add DART_BUILD_NOTIFICATION_DELAY to control notifications (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/build.py
diff --git a/dart/tools/build.py b/dart/tools/build.py
index d36e593d879675420b2ecb99bcfa3b4bc22bdcba..48071bd878a5fa418599fc164467e65ccaec05ce 100755
--- a/dart/tools/build.py
+++ b/dart/tools/build.py
@@ -11,6 +11,7 @@ import re
import shutil
import subprocess
import sys
+import time
import utils
HOST_OS = utils.GuessOS()
@@ -302,12 +303,18 @@ PhaseScriptExecution "Action \"upload_sdk_py\"" xcodebuild/dart.build/...
print '\n'.join(chunk)
-def NotifyBuildDone(build_config, success):
+def NotifyBuildDone(build_config, success, start):
if not success:
print "BUILD FAILED"
sys.stdout.flush()
+ # Display a notification if build time exceeded DART_BUILD_NOTIFICATION_DELAY.
+ notification_delay = float(
+ os.getenv('DART_BUILD_NOTIFICATION_DELAY', default=sys.float_info.max))
+ if (time.time() - start) < notification_delay:
+ return
+
if success:
message = 'Build succeeded.'
else:
@@ -355,6 +362,7 @@ def Main():
for target_os in options.os:
for mode in options.mode:
for arch in options.arch:
+ start_time = time.time()
os.environ['DART_BUILD_MODE'] = mode
build_config = utils.GetBuildConf(mode, arch, target_os)
if HOST_OS == 'macos':
@@ -435,10 +443,10 @@ def Main():
process = subprocess.Popen(args, stdin=None)
process.wait()
if process.returncode != 0:
- NotifyBuildDone(build_config, success=False)
+ NotifyBuildDone(build_config, success=False, start=start_time)
return 1
else:
- NotifyBuildDone(build_config, success=True)
+ NotifyBuildDone(build_config, success=True, start=start_time)
return 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698