Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
d631ebe5
Commit
d631ebe5
authored
Jan 29, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a regex in the ios logs command
fixed sub-process stdout parsing; added todos
parent
b89935e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
28 deletions
+40
-28
process.dart
packages/flutter_tools/lib/src/base/process.dart
+14
-20
start.dart
packages/flutter_tools/lib/src/commands/start.dart
+11
-2
device_ios.dart
packages/flutter_tools/lib/src/ios/device_ios.dart
+15
-6
No files found.
packages/flutter_tools/lib/src/base/process.dart
View file @
d631ebe5
...
@@ -21,26 +21,20 @@ Future<int> runCommandAndStreamOutput(List<String> cmd, {
...
@@ -21,26 +21,20 @@ Future<int> runCommandAndStreamOutput(List<String> cmd, {
cmd
.
sublist
(
1
),
cmd
.
sublist
(
1
),
workingDirectory:
workingDirectory
workingDirectory:
workingDirectory
);
);
process
.
stdout
.
transform
(
UTF8
.
decoder
).
listen
((
String
data
)
{
process
.
stdout
List
<
String
>
dataLines
=
data
.
trimRight
().
split
(
'
\n
'
);
.
transform
(
UTF8
.
decoder
)
if
(
filter
!=
null
)
{
.
transform
(
const
LineSplitter
())
// TODO(ianh): This doesn't handle IO buffering (where the data might be split half-way through a line)
.
where
((
String
line
)
=>
filter
==
null
?
true
:
filter
.
hasMatch
(
line
))
dataLines
=
dataLines
.
where
((
String
s
)
=>
filter
.
hasMatch
(
s
)).
toList
();
.
listen
((
String
line
)
{
}
printStatus
(
'
$prefix$line
'
);
if
(
dataLines
.
length
>
0
)
{
});
printStatus
(
'
$prefix${dataLines.join('\n$prefix')}
'
);
process
.
stderr
}
.
transform
(
UTF8
.
decoder
)
});
.
transform
(
const
LineSplitter
())
process
.
stderr
.
transform
(
UTF8
.
decoder
).
listen
((
String
data
)
{
.
where
((
String
line
)
=>
filter
==
null
?
true
:
filter
.
hasMatch
(
line
))
List
<
String
>
dataLines
=
data
.
trimRight
().
split
(
'
\n
'
);
.
listen
((
String
line
)
{
if
(
filter
!=
null
)
{
printError
(
'
$prefix$line
'
);
// TODO(ianh): This doesn't handle IO buffering (where the data might be split half-way through a line)
});
dataLines
=
dataLines
.
where
((
String
s
)
=>
filter
.
hasMatch
(
s
));
}
if
(
dataLines
.
length
>
0
)
{
printError
(
'
$prefix${dataLines.join('\n$prefix')}
'
);
}
});
return
await
process
.
exitCode
;
return
await
process
.
exitCode
;
}
}
...
...
packages/flutter_tools/lib/src/commands/start.dart
View file @
d631ebe5
...
@@ -137,7 +137,7 @@ Future<int> startApp(
...
@@ -137,7 +137,7 @@ Future<int> startApp(
if
(
clearLogs
!=
null
)
if
(
clearLogs
!=
null
)
platformArgs
[
'clear-logs'
]
=
clearLogs
;
platformArgs
[
'clear-logs'
]
=
clearLogs
;
printStatus
(
'Starting
$
mainPath
on
${device.name}
...'
);
printStatus
(
'Starting
$
{_getDisplayPath(mainPath)}
on
${device.name}
...'
);
bool
result
=
await
device
.
startApp
(
bool
result
=
await
device
.
startApp
(
package
,
package
,
...
@@ -149,7 +149,7 @@ Future<int> startApp(
...
@@ -149,7 +149,7 @@ Future<int> startApp(
);
);
if
(!
result
)
{
if
(!
result
)
{
printError
(
'
Could not start
\'
${package.name}
\'
on
\'
${device.id}
\'
'
);
printError
(
'
Error starting application on
${device.name}
.
'
);
}
else
{
}
else
{
startedSomething
=
true
;
startedSomething
=
true
;
}
}
...
@@ -165,3 +165,12 @@ Future<int> startApp(
...
@@ -165,3 +165,12 @@ Future<int> startApp(
return
startedSomething
?
0
:
2
;
return
startedSomething
?
0
:
2
;
}
}
/// Return a relative path if [fullPath] is contained by the cwd, else return an
/// absolute path.
String
_getDisplayPath
(
String
fullPath
)
{
String
cwd
=
Directory
.
current
.
path
+
Platform
.
pathSeparator
;
if
(
fullPath
.
startsWith
(
cwd
))
return
fullPath
.
substring
(
cwd
.
length
);
return
fullPath
;
}
packages/flutter_tools/lib/src/ios/device_ios.dart
View file @
d631ebe5
...
@@ -131,7 +131,7 @@ class IOSDevice extends Device {
...
@@ -131,7 +131,7 @@ class IOSDevice extends Device {
if
(
Platform
.
isMacOS
)
{
if
(
Platform
.
isMacOS
)
{
printError
(
'
$command
not found.
$macInstructions
'
);
printError
(
'
$command
not found.
$macInstructions
'
);
}
else
{
}
else
{
printError
(
'Cannot control iOS devices or simulators.
$command
is not available on your platform.'
);
printError
(
'Cannot control iOS devices or simulators.
$command
is not available on your platform.'
);
}
}
}
}
return
command
;
return
command
;
...
@@ -261,7 +261,7 @@ class IOSDevice extends Device {
...
@@ -261,7 +261,7 @@ class IOSDevice extends Device {
return
2
;
return
2
;
}
}
return
await
runCommandAndStreamOutput
([
loggerPath
],
return
await
runCommandAndStreamOutput
([
loggerPath
],
prefix:
'iOS: '
,
filter:
new
RegExp
(
'FlutterRunner
'
));
prefix:
'iOS: '
,
filter:
new
RegExp
(
r'(FlutterRunner|flutter.runner.Runner)
'
));
}
}
}
}
...
@@ -315,8 +315,8 @@ class IOSSimulator extends Device {
...
@@ -315,8 +315,8 @@ class IOSSimulator extends Device {
'which is not supposed to happen.'
);
'which is not supposed to happen.'
);
for
(
Match
match
in
matches
)
{
for
(
Match
match
in
matches
)
{
if
(
match
.
groupCount
>
0
)
{
if
(
match
.
groupCount
>
0
)
{
// TODO
: We're killing simulator devices inside an accessor method;
// TODO
(devoncarew): We're killing simulator devices inside an accessor
// we probably shouldn't be changing state here.
//
method;
we probably shouldn't be changing state here.
printError
(
'Killing simulator
${match.group(1)}
'
);
printError
(
'Killing simulator
${match.group(1)}
'
);
runSync
([
xcrunPath
,
'simctl'
,
'shutdown'
,
match
.
group
(
2
)]);
runSync
([
xcrunPath
,
'simctl'
,
'shutdown'
,
match
.
group
(
2
)]);
}
}
...
@@ -518,12 +518,21 @@ class IOSSimulator extends Device {
...
@@ -518,12 +518,21 @@ class IOSSimulator extends Device {
String
logFilePath
=
path
.
join
(
String
logFilePath
=
path
.
join
(
homeDirectory
,
'Library'
,
'Logs'
,
'CoreSimulator'
,
simulatorDeviceID
,
'system.log'
homeDirectory
,
'Library'
,
'Logs'
,
'CoreSimulator'
,
simulatorDeviceID
,
'system.log'
);
);
if
(
clear
)
if
(
clear
)
runSync
([
'rm'
,
logFilePath
]);
runSync
([
'rm'
,
logFilePath
]);
// TODO(devoncarew): The log message prefix could be shortened or removed.
// Jan 29 01:31:44 devoncarew-macbookpro3 SpringBoard[96648]:
// TODO(devoncarew): This truncates multi-line messages like:
// Jan 29 01:31:43 devoncarew-macbookpro3 CoreSimulatorBridge[96656]: Requesting... {
// environment = {
// };
// }
return
await
runCommandAndStreamOutput
(
return
await
runCommandAndStreamOutput
(
[
'tail'
,
'-f'
,
logFilePath
],
[
'tail'
,
'-f'
,
logFilePath
],
prefix:
'iOS
sim
: '
,
prefix:
'iOS: '
,
filter:
new
RegExp
(
r'
.*SkyShell.*
'
)
filter:
new
RegExp
(
r'
(FlutterRunner|flutter.runner.Runner)
'
)
);
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment