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
53dd5dbd
Commit
53dd5dbd
authored
Aug 17, 2016
by
Devon Carew
Committed by
GitHub
Aug 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print more logging info when tracing (#5419)
parent
a8369413
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
process.dart
packages/flutter_tools/lib/src/base/process.dart
+19
-14
zip.dart
packages/flutter_tools/lib/src/zip.dart
+2
-4
No files found.
packages/flutter_tools/lib/src/base/process.dart
View file @
53dd5dbd
...
...
@@ -22,7 +22,7 @@ Future<Process> runCommand(List<String> cmd, {
String
workingDirectory
,
bool
allowReentrantFlutter:
false
})
async
{
printTrace
(
cmd
.
join
(
' '
)
);
_traceCommand
(
cmd
,
workingDirectory:
workingDirectory
);
String
executable
=
cmd
[
0
];
List
<
String
>
arguments
=
cmd
.
length
>
1
?
cmd
.
sublist
(
1
)
:
<
String
>[];
Process
process
=
await
Process
.
start
(
...
...
@@ -86,7 +86,7 @@ Future<Null> runAndKill(List<String> cmd, Duration timeout) {
}
Future
<
Process
>
runDetached
(
List
<
String
>
cmd
)
{
printTrace
(
cmd
.
join
(
' '
)
);
_traceCommand
(
cmd
);
Future
<
Process
>
proc
=
Process
.
start
(
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
mode:
ProcessStartMode
.
DETACHED
...
...
@@ -98,7 +98,7 @@ Future<RunResult> runAsync(List<String> cmd, {
String
workingDirectory
,
bool
allowReentrantFlutter:
false
})
async
{
printTrace
(
cmd
.
join
(
' '
)
);
_traceCommand
(
cmd
,
workingDirectory:
workingDirectory
);
ProcessResult
results
=
await
Process
.
run
(
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
...
...
@@ -111,7 +111,7 @@ Future<RunResult> runAsync(List<String> cmd, {
}
bool
exitsHappy
(
List
<
String
>
cli
)
{
printTrace
(
cli
.
join
(
' '
)
);
_traceCommand
(
cli
);
try
{
return
Process
.
runSync
(
cli
.
first
,
cli
.
sublist
(
1
)).
exitCode
==
0
;
}
catch
(
error
)
{
...
...
@@ -124,16 +124,14 @@ bool exitsHappy(List<String> cli) {
/// Throws an error if cmd exits with a non-zero value.
String
runCheckedSync
(
List
<
String
>
cmd
,
{
String
workingDirectory
,
bool
allowReentrantFlutter:
false
,
bool
truncateCommand:
false
bool
allowReentrantFlutter:
false
})
{
return
_runWithLoggingSync
(
cmd
,
workingDirectory:
workingDirectory
,
allowReentrantFlutter:
allowReentrantFlutter
,
checked:
true
,
noisyErrors:
true
,
truncateCommand:
truncateCommand
noisyErrors:
true
);
}
...
...
@@ -149,17 +147,24 @@ String runSync(List<String> cmd, {
);
}
void
_traceCommand
(
List
<
String
>
args
,
{
String
workingDirectory
})
{
final
int
kMaxArgsLength
=
1024
;
String
argsText
=
args
.
join
(
' '
);
if
(
argsText
.
length
>
kMaxArgsLength
)
argsText
=
argsText
.
substring
(
0
,
kMaxArgsLength
)
+
'…'
;
if
(
workingDirectory
==
null
)
printTrace
(
argsText
);
else
printTrace
(
"[
$workingDirectory${Platform.pathSeparator}
]
$argsText
"
);
}
String
_runWithLoggingSync
(
List
<
String
>
cmd
,
{
bool
checked:
false
,
bool
noisyErrors:
false
,
String
workingDirectory
,
bool
allowReentrantFlutter:
false
,
bool
truncateCommand:
false
bool
allowReentrantFlutter:
false
})
{
String
cmdText
=
cmd
.
join
(
' '
);
if
(
truncateCommand
&&
cmdText
.
length
>
160
)
cmdText
=
cmdText
.
substring
(
0
,
160
)
+
'…'
;
printTrace
(
cmdText
);
_traceCommand
(
cmd
,
workingDirectory:
workingDirectory
);
ProcessResult
results
=
Process
.
runSync
(
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
...
...
packages/flutter_tools/lib/src/zip.dart
View file @
53dd5dbd
...
...
@@ -74,16 +74,14 @@ class _ZipToolBuilder extends ZipBuilder {
if
(
_getCompressedNames
().
isNotEmpty
)
{
runCheckedSync
(
<
String
>[
'zip'
,
'-q'
,
outFile
.
absolute
.
path
]..
addAll
(
_getCompressedNames
()),
workingDirectory:
zipBuildDir
.
path
,
truncateCommand:
true
workingDirectory:
zipBuildDir
.
path
);
}
if
(
_getStoredNames
().
isNotEmpty
)
{
runCheckedSync
(
<
String
>[
'zip'
,
'-q'
,
'-0'
,
outFile
.
absolute
.
path
]..
addAll
(
_getStoredNames
()),
workingDirectory:
zipBuildDir
.
path
,
truncateCommand:
true
workingDirectory:
zipBuildDir
.
path
);
}
}
...
...
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