Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
build
rust
run.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
4
# for details. All rights reserved. Use of this source code is governed by a
5
# BSD-style license that can be found in the LICENSE file.
6
7
# Runs rust tools, overriding the PATH variable so they can locate each other.
8
9
import
os
10
import
subprocess
11
import
sys
12
import
time
13
14
def
run
(cmd):
15
bindir = os.path.dirname(cmd[0]);
16
env = os.environ
17
if
'PATH'
in
env:
18
env[
'PATH'
] += os.pathsep + bindir
19
else
:
20
env[
'PATH'
] = bindir
21
out =
''
22
err =
''
23
proc = subprocess.Popen(
24
cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
25
while
proc.returncode
is
None
:
26
time.sleep(1)
27
stdout, stderr = proc.communicate()
28
out += stdout
29
err += stderr
30
proc.poll()
31
if
proc.returncode == 0:
32
return
0
33
print
(out)
34
print
(err)
35
return
proc.returncode
36
37
if
__name__ ==
'__main__'
:
38
sys.exit(
run
(sys.argv[1:]))
print
void print(void *str)
Definition
bridge.cpp:126
run
Definition
run.py:1
Generated on Fri Apr 26 2024 06:14:39 for Flutter Engine by
1.9.8