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
289988dc
Unverified
Commit
289988dc
authored
Feb 11, 2022
by
Christopher Fujino
Committed by
GitHub
Feb 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix type error in flutter update-packages --jobs=n (#98283)
parent
fce2f93b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+3
-1
update_packages_test.dart
...ls/test/commands.shard/hermetic/update_packages_test.dart
+24
-0
No files found.
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
289988dc
...
...
@@ -498,7 +498,9 @@ class UpdatePackagesCommand extends FlutterCommand {
'Running "flutter pub get" in affected packages...'
,
);
try
{
final
TaskQueue
<
void
>
queue
=
TaskQueue
<
void
>(
maxJobs:
intArg
(
'jobs'
));
// int.tryParse will convert an empty string to null
final
int
/*?*/
maxJobs
=
int
.
tryParse
(
stringArg
(
'jobs'
)
??
''
);
final
TaskQueue
<
void
>
queue
=
TaskQueue
<
void
>(
maxJobs:
maxJobs
);
for
(
final
Directory
dir
in
packages
)
{
unawaited
(
queue
.
add
(()
async
{
final
Stopwatch
stopwatch
=
Stopwatch
();
...
...
packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
View file @
289988dc
...
...
@@ -148,6 +148,30 @@ void main() {
processManager:
FakeProcessManager
.
any
(),
),
});
testUsingContext
(
'force updates packages --jobs=1'
,
()
async
{
final
UpdatePackagesCommand
command
=
UpdatePackagesCommand
();
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'update-packages'
,
'--force-upgrade'
,
'--jobs=1'
,
]);
expect
(
pub
.
pubGetDirectories
,
equals
(<
String
>[
'/.tmp_rand0/flutter_update_packages.rand0'
,
'/flutter/examples'
,
'/flutter/packages/flutter'
,
]));
expect
(
pub
.
pubBatchDirectories
,
equals
(<
String
>[
'/.tmp_rand0/flutter_update_packages.rand0'
,
]));
},
overrides:
<
Type
,
Generator
>{
Pub:
()
=>
pub
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
Cache:
()
=>
Cache
.
test
(
processManager:
FakeProcessManager
.
any
(),
),
});
});
}
...
...
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