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, {
...
@@ -22,7 +22,7 @@ Future<Process> runCommand(List<String> cmd, {
String
workingDirectory
,
String
workingDirectory
,
bool
allowReentrantFlutter:
false
bool
allowReentrantFlutter:
false
})
async
{
})
async
{
printTrace
(
cmd
.
join
(
' '
)
);
_traceCommand
(
cmd
,
workingDirectory:
workingDirectory
);
String
executable
=
cmd
[
0
];
String
executable
=
cmd
[
0
];
List
<
String
>
arguments
=
cmd
.
length
>
1
?
cmd
.
sublist
(
1
)
:
<
String
>[];
List
<
String
>
arguments
=
cmd
.
length
>
1
?
cmd
.
sublist
(
1
)
:
<
String
>[];
Process
process
=
await
Process
.
start
(
Process
process
=
await
Process
.
start
(
...
@@ -86,7 +86,7 @@ Future<Null> runAndKill(List<String> cmd, Duration timeout) {
...
@@ -86,7 +86,7 @@ Future<Null> runAndKill(List<String> cmd, Duration timeout) {
}
}
Future
<
Process
>
runDetached
(
List
<
String
>
cmd
)
{
Future
<
Process
>
runDetached
(
List
<
String
>
cmd
)
{
printTrace
(
cmd
.
join
(
' '
)
);
_traceCommand
(
cmd
);
Future
<
Process
>
proc
=
Process
.
start
(
Future
<
Process
>
proc
=
Process
.
start
(
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
mode:
ProcessStartMode
.
DETACHED
mode:
ProcessStartMode
.
DETACHED
...
@@ -98,7 +98,7 @@ Future<RunResult> runAsync(List<String> cmd, {
...
@@ -98,7 +98,7 @@ Future<RunResult> runAsync(List<String> cmd, {
String
workingDirectory
,
String
workingDirectory
,
bool
allowReentrantFlutter:
false
bool
allowReentrantFlutter:
false
})
async
{
})
async
{
printTrace
(
cmd
.
join
(
' '
)
);
_traceCommand
(
cmd
,
workingDirectory:
workingDirectory
);
ProcessResult
results
=
await
Process
.
run
(
ProcessResult
results
=
await
Process
.
run
(
cmd
[
0
],
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
...
@@ -111,7 +111,7 @@ Future<RunResult> runAsync(List<String> cmd, {
...
@@ -111,7 +111,7 @@ Future<RunResult> runAsync(List<String> cmd, {
}
}
bool
exitsHappy
(
List
<
String
>
cli
)
{
bool
exitsHappy
(
List
<
String
>
cli
)
{
printTrace
(
cli
.
join
(
' '
)
);
_traceCommand
(
cli
);
try
{
try
{
return
Process
.
runSync
(
cli
.
first
,
cli
.
sublist
(
1
)).
exitCode
==
0
;
return
Process
.
runSync
(
cli
.
first
,
cli
.
sublist
(
1
)).
exitCode
==
0
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -124,16 +124,14 @@ bool exitsHappy(List<String> cli) {
...
@@ -124,16 +124,14 @@ bool exitsHappy(List<String> cli) {
/// Throws an error if cmd exits with a non-zero value.
/// Throws an error if cmd exits with a non-zero value.
String
runCheckedSync
(
List
<
String
>
cmd
,
{
String
runCheckedSync
(
List
<
String
>
cmd
,
{
String
workingDirectory
,
String
workingDirectory
,
bool
allowReentrantFlutter:
false
,
bool
allowReentrantFlutter:
false
bool
truncateCommand:
false
})
{
})
{
return
_runWithLoggingSync
(
return
_runWithLoggingSync
(
cmd
,
cmd
,
workingDirectory:
workingDirectory
,
workingDirectory:
workingDirectory
,
allowReentrantFlutter:
allowReentrantFlutter
,
allowReentrantFlutter:
allowReentrantFlutter
,
checked:
true
,
checked:
true
,
noisyErrors:
true
,
noisyErrors:
true
truncateCommand:
truncateCommand
);
);
}
}
...
@@ -149,17 +147,24 @@ String runSync(List<String> cmd, {
...
@@ -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
,
{
String
_runWithLoggingSync
(
List
<
String
>
cmd
,
{
bool
checked:
false
,
bool
checked:
false
,
bool
noisyErrors:
false
,
bool
noisyErrors:
false
,
String
workingDirectory
,
String
workingDirectory
,
bool
allowReentrantFlutter:
false
,
bool
allowReentrantFlutter:
false
bool
truncateCommand:
false
})
{
})
{
String
cmdText
=
cmd
.
join
(
' '
);
_traceCommand
(
cmd
,
workingDirectory:
workingDirectory
);
if
(
truncateCommand
&&
cmdText
.
length
>
160
)
cmdText
=
cmdText
.
substring
(
0
,
160
)
+
'…'
;
printTrace
(
cmdText
);
ProcessResult
results
=
Process
.
runSync
(
ProcessResult
results
=
Process
.
runSync
(
cmd
[
0
],
cmd
[
0
],
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
cmd
.
getRange
(
1
,
cmd
.
length
).
toList
(),
...
...
packages/flutter_tools/lib/src/zip.dart
View file @
53dd5dbd
...
@@ -74,16 +74,14 @@ class _ZipToolBuilder extends ZipBuilder {
...
@@ -74,16 +74,14 @@ class _ZipToolBuilder extends ZipBuilder {
if
(
_getCompressedNames
().
isNotEmpty
)
{
if
(
_getCompressedNames
().
isNotEmpty
)
{
runCheckedSync
(
runCheckedSync
(
<
String
>[
'zip'
,
'-q'
,
outFile
.
absolute
.
path
]..
addAll
(
_getCompressedNames
()),
<
String
>[
'zip'
,
'-q'
,
outFile
.
absolute
.
path
]..
addAll
(
_getCompressedNames
()),
workingDirectory:
zipBuildDir
.
path
,
workingDirectory:
zipBuildDir
.
path
truncateCommand:
true
);
);
}
}
if
(
_getStoredNames
().
isNotEmpty
)
{
if
(
_getStoredNames
().
isNotEmpty
)
{
runCheckedSync
(
runCheckedSync
(
<
String
>[
'zip'
,
'-q'
,
'-0'
,
outFile
.
absolute
.
path
]..
addAll
(
_getStoredNames
()),
<
String
>[
'zip'
,
'-q'
,
'-0'
,
outFile
.
absolute
.
path
]..
addAll
(
_getStoredNames
()),
workingDirectory:
zipBuildDir
.
path
,
workingDirectory:
zipBuildDir
.
path
truncateCommand:
true
);
);
}
}
}
}
...
...
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