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
e04de975
Commit
e04de975
authored
Dec 15, 2015
by
Eric Seidel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #922 from eseidelGoogle/pub_is_slow
Add nicer logging/reporting to dev/update_packages.dart
parents
e1fefc06
d8e4fee9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
.travis.yml
.travis.yml
+3
-0
update_packages.dart
dev/update_packages.dart
+18
-5
No files found.
.travis.yml
View file @
e04de975
...
...
@@ -13,3 +13,6 @@ before_script:
-
./travis/setup.sh
script
:
-
./travis/test.sh
cache
:
directories
:
-
$HOME/.pub-cache
dev/update_packages.dart
View file @
e04de975
...
...
@@ -6,27 +6,40 @@
import
'dart:io'
;
final
String
binaryName
=
Platform
.
isWindows
?
'pub.bat'
:
'pub'
;
void
update
(
Directory
directory
,
bool
upgrade
)
{
int
runPub
(
Directory
directory
,
List
<
String
>
pubArgs
)
{
int
updateCount
=
0
;
for
(
FileSystemEntity
dir
in
directory
.
listSync
())
{
if
(
dir
is
Directory
)
{
print
(
"Updating
${dir.path}
..."
);
updateCount
++;
Stopwatch
timer
=
new
Stopwatch
()..
start
();
stdout
.
write
(
"Updating
${dir.path}
..."
);
ProcessResult
result
=
Process
.
runSync
(
binaryName
,
[
upgrade
?
'upgrade'
:
'get'
]
,
pubArgs
,
workingDirectory:
dir
.
path
);
timer
.
stop
();
stdout
.
write
(
" (
${timer.elapsedMilliseconds}
ms)"
);
if
(
result
.
exitCode
!=
0
)
{
print
(
"... failed with exit code
${result.exitCode}
."
);
print
(
result
.
stdout
);
print
(
result
.
stderr
);
}
else
{
stdout
.
write
(
"
\n
"
);
}
}
}
return
updateCount
;
}
void
main
(
List
<
String
>
arguments
)
{
Stopwatch
timer
=
new
Stopwatch
()..
start
();
bool
upgrade
=
arguments
.
length
>
0
&&
arguments
[
0
]
==
'--upgrade'
;
String
FLUTTER_ROOT
=
new
File
(
Platform
.
script
.
toFilePath
()).
parent
.
parent
.
path
;
update
(
new
Directory
(
"
$FLUTTER_ROOT
/packages"
),
upgrade
);
update
(
new
Directory
(
"
$FLUTTER_ROOT
/examples"
),
upgrade
);
List
<
String
>
pubArgs
=
[
upgrade
?
'upgrade'
:
'get'
];
int
count
=
0
;
count
+=
runPub
(
new
Directory
(
"
$FLUTTER_ROOT
/packages"
),
pubArgs
);
count
+=
runPub
(
new
Directory
(
"
$FLUTTER_ROOT
/examples"
),
pubArgs
);
String
command
=
"
$binaryName
${pubArgs.join(' ')}
"
;
print
(
"Ran
\"
$command
\"
$count
times in
${timer.elapsedMilliseconds}
ms"
);
}
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