14DART_PATH = os.path.normpath(os.path.dirname(__file__) +
'/../../..')
15CLIENT_PATH = os.path.normpath(DART_PATH +
'/client')
18sys.path.append(os.path.abspath(DART_PATH +
'/tools'))
27 Executes the given command in a new process. If the command fails (returns
28 non-zero) halts the script
and returns that exit code.
30 exitcode = subprocess.call(command)
36 buildDir = os.path.join(buildRoot,
'war')
43 execute(DART_PATH +
'/third_party/apache_ant/v1_7_1/bin/ant',
'-f',
44 'build-appengine.xml',
'-Dbuild.dir=' + buildRoot, antTarget)
48 chrome = CLIENT_PATH +
'/tests/drt/chrome'
51 if platform.system() ==
'Darwin':
52 chrome = CLIENT_PATH +
'/tests/drt/Chromium.app/Contents/MacOS/Chromium'
54 keyFile = DART_PATH +
'/samples/swarm/swarm-dev.pem'
55 execute(chrome,
'--pack-extension=' + buildDir,
56 '--pack-extension-key=' + keyFile)
58 resultFile = os.path.join(buildRoot, resultFile)
59 os.rename(buildDir +
'.crx', resultFile)
60 return os.path.abspath(resultFile)
65 dartiumResult =
createChromeApp(buildRoot,
'build_dart_app',
'swarm.crx')
66 dartCResult =
createChromeApp(buildRoot,
'build_js_app',
'swarm-js.crx')
69Successfully created Chrome apps!
74To install, open this URL in Chrome
and select Continue at the bottom.
75''' % (dartiumResult, dartCResult))
79if __name__ ==
'__main__':
def createChromeApp(buildRoot, antTarget, resultFile)
def print(*args, **kwargs)
def GetBuildRoot(host_os, mode=None, arch=None, sanitizer=None)