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
7c24ff2c
Unverified
Commit
7c24ff2c
authored
Aug 24, 2021
by
Sigurd Meldgaard
Committed by
GitHub
Aug 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `dart pub` instead of `pub` to invoke pub from tools (#88509)
Top level `pub` is being deprecated.
parent
6dc18ef7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
50 deletions
+67
-50
pub.dart
packages/flutter_tools/lib/src/dart/pub.dart
+3
-5
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+2
-2
packages_test.dart
...er_tools/test/commands.shard/permeable/packages_test.dart
+4
-4
pub_get_test.dart
...s/flutter_tools/test/general.shard/dart/pub_get_test.dart
+58
-39
No files found.
packages/flutter_tools/lib/src/dart/pub.dart
View file @
7c24ff2c
...
...
@@ -234,9 +234,7 @@ class _DefaultPub implements Pub {
final
bool
verbose
=
_logger
.
isVerbose
;
final
List
<
String
>
args
=
<
String
>[
if
(
verbose
)
'--verbose'
else
'--verbosity=warning'
,
'--verbose'
,
...<
String
>[
command
,
'--no-precompile'
,
...
...
@@ -419,7 +417,7 @@ class _DefaultPub implements Pub {
'cache'
,
'dart-sdk'
,
'bin'
,
'
pub
'
,
'
dart
'
,
]);
if
(!
_processManager
.
canRun
(
sdkPath
))
{
throwToolExit
(
...
...
@@ -428,7 +426,7 @@ class _DefaultPub implements Pub {
'permissions for the current user.'
);
}
return
<
String
>[
sdkPath
,
...
arguments
];
return
<
String
>[
sdkPath
,
'--no-analytics'
,
'pub'
,
...
arguments
];
}
// Returns the environment value that should be used when running pub.
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
7c24ff2c
...
...
@@ -1729,7 +1729,7 @@ void main() {
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--pub'
,
'--offline'
,
projectDir
.
path
]);
expect
(
loggingProcessManager
.
commands
.
first
,
contains
(
matches
(
r'dart-sdk[\\/]bin[\\/]
pub
'
)));
expect
(
loggingProcessManager
.
commands
.
first
,
contains
(
matches
(
r'dart-sdk[\\/]bin[\\/]
dart
'
)));
expect
(
loggingProcessManager
.
commands
.
first
,
contains
(
'--offline'
));
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -1754,7 +1754,7 @@ void main() {
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--pub'
,
projectDir
.
path
]);
expect
(
loggingProcessManager
.
commands
.
first
,
contains
(
matches
(
r'dart-sdk[\\/]bin[\\/]
pub
'
)));
expect
(
loggingProcessManager
.
commands
.
first
,
contains
(
matches
(
r'dart-sdk[\\/]bin[\\/]
dart
'
)));
expect
(
loggingProcessManager
.
commands
.
first
,
isNot
(
contains
(
'--offline'
)));
},
overrides:
<
Type
,
Generator
>{
...
...
packages/flutter_tools/test/commands.shard/permeable/packages_test.dart
View file @
7c24ff2c
...
...
@@ -451,7 +451,7 @@ void main() {
Cache
.
flutterRoot
=
''
;
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'/bin/cache/dart-sdk/bin/pub'
,
'run'
,
'test'
]),
const
FakeCommand
(
command:
<
String
>[
'/bin/cache/dart-sdk/bin/
dart'
,
'--no-analytics'
,
'
pub'
,
'run'
,
'test'
]),
);
await
createTestCommandRunner
(
PackagesCommand
()).
run
(<
String
>[
'packages'
,
'test'
]);
...
...
@@ -476,7 +476,7 @@ void main() {
Cache
.
flutterRoot
=
''
;
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'/bin/cache/dart-sdk/bin/pub'
,
'--trace'
,
'run'
,
'test'
]),
const
FakeCommand
(
command:
<
String
>[
'/bin/cache/dart-sdk/bin/
dart'
,
'--no-analytics'
,
'
pub'
,
'--trace'
,
'run'
,
'test'
]),
);
await
createTestCommandRunner
(
PackagesCommand
()).
run
(<
String
>[
'packages'
,
'test'
]);
...
...
@@ -503,7 +503,7 @@ void main() {
final
IOSink
stdin
=
IOSink
(
StreamController
<
List
<
int
>>().
sink
);
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'/bin/cache/dart-sdk/bin/pub'
,
'run'
,
'--foo'
,
'bar'
],
'/bin/cache/dart-sdk/bin/
dart'
,
'--no-analytics'
,
'
pub'
,
'run'
,
'--foo'
,
'bar'
],
stdin:
stdin
,
),
);
...
...
@@ -529,7 +529,7 @@ void main() {
Cache
.
flutterRoot
=
''
;
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'/bin/cache/dart-sdk/bin/pub'
,
'upgrade'
,
'-h'
],
'/bin/cache/dart-sdk/bin/
dart'
,
'--no-analytics'
,
'
pub'
,
'upgrade'
,
'-h'
],
stdin:
IOSink
(
StreamController
<
List
<
int
>>().
sink
),
),
);
...
...
packages/flutter_tools/test/general.shard/dart/pub_get_test.dart
View file @
7c24ff2c
...
...
@@ -26,7 +26,7 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
empty
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
processManager
.
excludedExecutables
.
add
(
'bin/cache/dart-sdk/bin/
pub
'
);
processManager
.
excludedExecutables
.
add
(
'bin/cache/dart-sdk/bin/
dart
'
);
fileSystem
.
file
(
'pubspec.yaml'
).
createSync
();
...
...
@@ -51,8 +51,9 @@ void main() {
testWithoutContext
(
'does not skip pub get the parameter is false'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -99,8 +100,9 @@ void main() {
testWithoutContext
(
'does not skip pub get if package_config.json has "generator": "pub"'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -147,8 +149,9 @@ void main() {
testWithoutContext
(
'does not skip pub get if package_config.json has "generator": "pub"'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -262,8 +265,9 @@ void main() {
'but the current framework version is not the same as the last version'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -301,8 +305,9 @@ void main() {
'but the current framework version does not exist yet'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -339,8 +344,9 @@ void main() {
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
onRun:
()
{
...
...
@@ -377,8 +383,9 @@ void main() {
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
]),
...
...
@@ -413,8 +420,9 @@ void main() {
testWithoutContext
(
'checkUpToDate does not skip pub get if the package config is older that the pubspec'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -452,8 +460,9 @@ void main() {
testWithoutContext
(
'checkUpToDate does not skip pub get if the pubspec.lock is older that the pubspec'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
])
...
...
@@ -495,8 +504,9 @@ void main() {
const
FakeCommand
pubGetCommand
=
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -591,8 +601,9 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -636,8 +647,9 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -677,8 +689,9 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -799,8 +812,9 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -840,8 +854,9 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -882,8 +897,9 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -894,16 +910,18 @@ void main() {
),
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
),
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
@@ -914,8 +932,9 @@ void main() {
),
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/pub'
,
'--verbosity=warning'
,
'bin/cache/dart-sdk/bin/dart'
,
'--no-analytics'
,
'pub'
,
'get'
,
'--no-precompile'
,
],
...
...
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