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
7a280785
Unverified
Commit
7a280785
authored
Mar 06, 2023
by
Sigurd Meldgaard
Committed by
GitHub
Mar 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `dart pub` instead of `dart __deprecated pub` (#121605)
parent
d940ec1f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
42 deletions
+62
-42
.cirrus.yml
.cirrus.yml
+6
-6
shared.bat
bin/internal/shared.bat
+2
-3
shared.sh
bin/internal/shared.sh
+3
-3
pub.dart
packages/flutter_tools/lib/src/dart/pub.dart
+1
-1
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
+5
-5
pub_get_test.dart
...s/flutter_tools/test/general.shard/dart/pub_get_test.dart
+43
-22
No files found.
.cirrus.yml
View file @
7a280785
...
...
@@ -115,10 +115,10 @@ task:
MEMORY
:
10G
SHOULD_UPDATE_PACKAGES
:
"
FALSE"
script
:
-
(cd packages/flutter_tools; dart
__deprecated_
pub get)
-
(cd packages/flutter_tools/test/data/asset_test/main; dart
__deprecated_
pub get)
-
(cd packages/flutter_tools/test/data/asset_test/font; dart
__deprecated_
pub get)
-
(cd dev/bots; dart
__deprecated_
pub get)
-
(cd packages/flutter_tools; dart pub get)
-
(cd packages/flutter_tools/test/data/asset_test/main; dart pub get)
-
(cd packages/flutter_tools/test/data/asset_test/font; dart pub get)
-
(cd dev/bots; dart pub get)
-
dart --enable-asserts ./dev/bots/test.dart
-
name
:
tool_tests-commands-linux
...
...
@@ -131,8 +131,8 @@ task:
MEMORY
:
10G
SHOULD_UPDATE_PACKAGES
:
"
FALSE"
script
:
-
(cd packages/flutter_tools; dart
__deprecated_
pub get)
-
(cd dev/bots; dart
__deprecated_
pub get)
-
(cd packages/flutter_tools; dart pub get)
-
(cd dev/bots; dart pub get)
-
dart --enable-asserts ./dev/bots/test.dart
-
name
:
docs-linux
# linux-only
...
...
bin/internal/shared.bat
View file @
7a280785
...
...
@@ -136,7 +136,6 @@ GOTO :after_subroutine
REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL
SETLOCAL
SET VERBOSITY=--verbosity=error
IF "%CI%" == "true" GOTO on_bot
IF "%BOT%" == "true" GOTO on_bot
IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot
...
...
@@ -144,8 +143,8 @@ GOTO :after_subroutine
GOTO not_on_bot
:on_bot
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot
SET VERBOSITY=--verbosity=normal
:not_on_bot
SET PUB_SUMMARY_ONLY=1
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_install
IF "%PUB_CACHE%" == "" (
IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path%
...
...
@@ -155,7 +154,7 @@ GOTO :after_subroutine
SET /A remaining_tries=%total_tries%-1
:retry_pub_upgrade
ECHO Running pub upgrade... 1>&2
"%dart%"
__deprecated_pub upgrade "%VERBOSITY%" --no-precompil
e
"%dart%"
--no-analytics pub upgrad
e
IF "%ERRORLEVEL%" EQU "0" goto :upgrade_succeeded
ECHO Error (%ERRORLEVEL%): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (%remaining_tries% tries left) 1>&2
timeout /t 5 /nobreak 2>NUL
...
...
bin/internal/shared.sh
View file @
7a280785
...
...
@@ -21,7 +21,7 @@ function pub_upgrade_with_retry {
local
total_tries
=
"10"
local
remaining_tries
=
$((
total_tries
-
1
))
while
[[
"
$remaining_tries
"
-gt
0
]]
;
do
(
cd
"
$FLUTTER_TOOLS_DIR
"
&&
"
$DART
"
__deprecated_pub upgrade
"
$VERBOSITY
"
--no-precompil
e
)
&&
break
(
cd
"
$FLUTTER_TOOLS_DIR
"
&&
"
$DART
"
--no-analytics
pub upgrad
e
)
&&
break
>
&2
echo
"Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (
$remaining_tries
tries left)"
remaining_tries
=
$((
remaining_tries
-
1
))
sleep
5
...
...
@@ -143,10 +143,10 @@ function upgrade_flutter () (
>
&2
echo
Building flutter tool...
# Prepare packages...
VERBOSITY
=
"--verbosity=error"
if
[[
"
$CI
"
==
"true"
||
"
$BOT
"
==
"true"
||
"
$CONTINUOUS_INTEGRATION
"
==
"true"
||
"
$CHROME_HEADLESS
"
==
"1"
]]
;
then
PUB_ENVIRONMENT
=
"
$PUB_ENVIRONMENT
:flutter_bot"
VERBOSITY
=
"--verbosity=normal"
else
export
PUB_SUMMARY_ONLY
=
1
fi
export
PUB_ENVIRONMENT
=
"
$PUB_ENVIRONMENT
:flutter_install"
if
[[
-d
"
$FLUTTER_ROOT
/.pub-cache"
]]
;
then
...
...
packages/flutter_tools/lib/src/dart/pub.dart
View file @
7a280785
...
...
@@ -607,7 +607,7 @@ class _DefaultPub implements Pub {
'permissions for the current user.'
);
}
return
<
String
>[
sdkPath
,
'
__deprecated_
pub'
,
...
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 @
7a280785
...
...
@@ -1950,14 +1950,14 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--pub'
,
projectDir
.
path
]);
final
RegExp
dartCommand
=
RegExp
(
r'dart-sdk[\\/]bin[\\/]dart'
);
expect
(
loggingProcessManager
.
commands
,
contains
(
predicate
(
(
List
<
String
>
c
)
=>
dartCommand
.
hasMatch
(
c
[
0
])
&&
c
[
1
].
contains
(
'pub'
)
&&
!
c
.
contains
(
'--offline'
)
(
List
<
String
>
c
)
=>
dartCommand
.
hasMatch
(
c
[
0
])
&&
c
[
2
].
contains
(
'pub'
)
&&
!
c
.
contains
(
'--offline'
)
)));
// Run pub offline.
loggingProcessManager
.
clear
();
await
runner
.
run
(<
String
>[
'create'
,
'--pub'
,
'--offline'
,
projectDir
.
path
]);
expect
(
loggingProcessManager
.
commands
,
contains
(
predicate
(
(
List
<
String
>
c
)
=>
dartCommand
.
hasMatch
(
c
[
0
])
&&
c
[
1
].
contains
(
'pub'
)
&&
c
.
contains
(
'--offline'
)
(
List
<
String
>
c
)
=>
dartCommand
.
hasMatch
(
c
[
0
])
&&
c
[
2
].
contains
(
'pub'
)
&&
c
.
contains
(
'--offline'
)
)));
},
overrides:
<
Type
,
Generator
>{
...
...
packages/flutter_tools/test/commands.shard/permeable/packages_test.dart
View file @
7a280785
...
...
@@ -488,7 +488,7 @@ void main() {
globals
.
fs
.
directory
(
'/packages/flutter_tools'
).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'/bin/cache/dart-sdk/bin/dart'
,
'
__deprecated_
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'
]);
...
...
@@ -514,7 +514,7 @@ void main() {
Cache
.
flutterRoot
=
''
;
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
processManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'/bin/cache/dart-sdk/bin/dart'
,
'
__deprecated_
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'
]);
...
...
@@ -543,7 +543,7 @@ void main() {
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'/bin/cache/dart-sdk/bin/dart'
,
'
__deprecated_
pub'
,
'run'
,
'--foo'
,
'bar'
,
'/bin/cache/dart-sdk/bin/dart'
,
'
--no-analytics'
,
'
pub'
,
'run'
,
'--foo'
,
'bar'
,
],
stdin:
stdin
,
),
...
...
@@ -574,7 +574,7 @@ void main() {
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'/bin/cache/dart-sdk/bin/dart'
,
'
__deprecated_
pub'
,
'token'
,
'list'
,
'/bin/cache/dart-sdk/bin/dart'
,
'
--no-analytics'
,
'
pub'
,
'token'
,
'list'
,
],
stdin:
stdin
,
),
...
...
@@ -603,7 +603,7 @@ void main() {
processManager
.
addCommand
(
FakeCommand
(
command:
const
<
String
>[
'/bin/cache/dart-sdk/bin/dart'
,
'
__deprecated_
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 @
7a280785
...
...
@@ -55,7 +55,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -105,7 +106,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -155,7 +157,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -272,7 +275,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -313,7 +317,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -353,7 +358,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -393,7 +399,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -431,7 +438,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -472,7 +480,8 @@ void main() {
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -519,7 +528,8 @@ void main() {
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -543,7 +553,7 @@ void main() {
);
const
String
toolExitMessage
=
'''
pub get failed
command: "bin/cache/dart-sdk/bin/dart
__deprecated_
pub --directory . get --example"
command: "bin/cache/dart-sdk/bin/dart
--no-analytics
pub --directory . get --example"
pub env: {
"FLUTTER_ROOT": "",
"PUB_ENVIRONMENT": "flutter_cli:flutter_tests",
...
...
@@ -582,7 +592,8 @@ exit code: 66
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -592,7 +603,8 @@ exit code: 66
throw
const
ProcessException
(
'bin/cache/dart-sdk/bin/dart'
,
<
String
>[
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -649,7 +661,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -699,7 +712,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -769,7 +783,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -822,7 +837,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -957,7 +973,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -1002,7 +1019,8 @@ exit code: 66
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -1016,7 +1034,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -1026,7 +1045,8 @@ exit code: 66
FakeCommand
(
command:
const
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
@@ -1040,7 +1060,8 @@ exit code: 66
const
FakeCommand
(
command:
<
String
>[
'bin/cache/dart-sdk/bin/dart'
,
'__deprecated_pub'
,
'--no-analytics'
,
'pub'
,
'--directory'
,
'.'
,
'get'
,
...
...
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