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
e0ab6fc0
Unverified
Commit
e0ab6fc0
authored
Mar 18, 2020
by
Jenn Magder
Committed by
GitHub
Mar 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move outputPreferences to globals (#52846)
parent
0274f170
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
24 additions
and
30 deletions
+24
-30
runner.dart
packages/flutter_tools/lib/runner.dart
+1
-2
terminal.dart
packages/flutter_tools/lib/src/base/terminal.dart
+0
-6
utils.dart
packages/flutter_tools/lib/src/base/utils.dart
+3
-3
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+2
-3
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+2
-2
globals.dart
packages/flutter_tools/lib/src/globals.dart
+3
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-2
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-2
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+5
-5
flutter_command_runner_test.dart
...est/general.shard/runner/flutter_command_runner_test.dart
+1
-1
vmservice_test.dart
...ages/flutter_tools/test/general.shard/vmservice_test.dart
+4
-3
context.dart
packages/flutter_tools/test/src/context.dart
+1
-1
No files found.
packages/flutter_tools/lib/runner.dart
View file @
e0ab6fc0
...
...
@@ -15,7 +15,6 @@ import 'src/base/file_system.dart';
import
'src/base/io.dart'
;
import
'src/base/logger.dart'
;
import
'src/base/process.dart'
;
import
'src/base/terminal.dart'
;
import
'src/context_runner.dart'
;
import
'src/doctor.dart'
;
import
'src/globals.dart'
as
globals
;
...
...
@@ -234,7 +233,7 @@ Future<String> _doctorText() async {
try
{
final
BufferLogger
logger
=
BufferLogger
(
terminal:
globals
.
terminal
,
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
);
await
context
.
run
<
bool
>(
...
...
packages/flutter_tools/lib/src/base/terminal.dart
View file @
e0ab6fc0
...
...
@@ -9,7 +9,6 @@ import 'package:platform/platform.dart';
import
'../convert.dart'
;
import
'../globals.dart'
as
globals
;
import
'context.dart'
;
import
'io.dart'
as
io
;
import
'logger.dart'
;
...
...
@@ -33,11 +32,6 @@ String get successMark {
return
globals
.
terminal
.
bolden
(
globals
.
terminal
.
color
(
'✓'
,
TerminalColor
.
green
));
}
OutputPreferences
get
outputPreferences
{
return
context
?.
get
<
OutputPreferences
>()
??
_defaultOutputPreferences
;
}
final
OutputPreferences
_defaultOutputPreferences
=
OutputPreferences
();
/// A class that contains the context settings for command text output to the
/// console.
class
OutputPreferences
{
...
...
packages/flutter_tools/lib/src/base/utils.dart
View file @
e0ab6fc0
...
...
@@ -9,8 +9,8 @@ import 'package:intl/intl.dart';
import
'package:meta/meta.dart'
;
import
'../convert.dart'
;
import
'../globals.dart'
as
globals
;
import
'file_system.dart'
;
import
'terminal.dart'
;
/// Convert `foo_bar` to `fooBar`.
String
camelCase
(
String
str
)
{
...
...
@@ -239,7 +239,7 @@ String wrapText(String text, { int columnWidth, int hangingIndent, int indent, b
return
''
;
}
indent
??=
0
;
columnWidth
??=
outputPreferences
.
wrapColumn
;
columnWidth
??=
globals
.
outputPreferences
.
wrapColumn
;
columnWidth
-=
indent
;
assert
(
columnWidth
>=
0
);
...
...
@@ -322,7 +322,7 @@ List<String> _wrapTextAsLines(String text, { int start = 0, int columnWidth, @re
assert
(
columnWidth
!=
null
);
assert
(
columnWidth
>=
0
);
assert
(
start
>=
0
);
shouldWrap
??=
outputPreferences
.
wrapText
;
shouldWrap
??=
globals
.
outputPreferences
.
wrapText
;
/// Returns true if the code unit at [index] in [text] is a whitespace
/// character.
...
...
packages/flutter_tools/lib/src/context_runner.dart
View file @
e0ab6fc0
...
...
@@ -19,7 +19,6 @@ import 'base/logger.dart';
import
'base/os.dart'
;
import
'base/process.dart'
;
import
'base/signals.dart'
;
import
'base/terminal.dart'
;
import
'base/time.dart'
;
import
'base/user_messages.dart'
;
import
'build_system/build_system.dart'
;
...
...
@@ -147,13 +146,13 @@ Future<T> runInContext<T>(
?
WindowsStdoutLogger
(
terminal:
globals
.
terminal
,
stdio:
globals
.
stdio
,
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
timeoutConfiguration:
timeoutConfiguration
,
)
:
StdoutLogger
(
terminal:
globals
.
terminal
,
stdio:
globals
.
stdio
,
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
timeoutConfiguration:
timeoutConfiguration
,
),
MacOSWorkflow:
()
=>
const
MacOSWorkflow
(),
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
e0ab6fc0
...
...
@@ -229,8 +229,8 @@ class Doctor {
buffer
.
write
(
wrapText
(
lineBuffer
.
toString
(),
hangingIndent:
result
.
leadingBox
.
length
+
1
,
columnWidth:
outputPreferences
.
wrapColumn
,
shouldWrap:
outputPreferences
.
wrapText
,
columnWidth:
globals
.
outputPreferences
.
wrapColumn
,
shouldWrap:
globals
.
outputPreferences
.
wrapText
,
));
buffer
.
writeln
();
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
e0ab6fc0
...
...
@@ -81,6 +81,9 @@ Xcode get xcode => context.get<Xcode>();
XCDevice
get
xcdevice
=>
context
.
get
<
XCDevice
>();
final
OutputPreferences
_defaultOutputPreferences
=
OutputPreferences
();
OutputPreferences
get
outputPreferences
=>
context
.
get
<
OutputPreferences
>()
??
_defaultOutputPreferences
;
final
BotDetector
_defaultBotDetector
=
BotDetector
(
httpClientFactory:
context
.
get
<
HttpClientFactory
>()
??
()
=>
HttpClient
(),
platform:
platform
,
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
e0ab6fc0
...
...
@@ -15,7 +15,6 @@ import 'base/file_system.dart';
import
'base/io.dart'
as
io
;
import
'base/logger.dart'
;
import
'base/signals.dart'
;
import
'base/terminal.dart'
show
outputPreferences
;
import
'base/utils.dart'
;
import
'build_info.dart'
;
import
'codegen.dart'
;
...
...
@@ -628,7 +627,7 @@ abstract class ResidentRunner {
logger:
globals
.
logger
,
terminal:
globals
.
terminal
,
platform:
globals
.
platform
,
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
)
{
if
(!
artifactDirectory
.
existsSync
())
{
artifactDirectory
.
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
e0ab6fc0
...
...
@@ -15,7 +15,6 @@ import '../base/common.dart';
import
'../base/context.dart'
;
import
'../base/io.dart'
as
io
;
import
'../base/signals.dart'
;
import
'../base/terminal.dart'
;
import
'../base/time.dart'
;
import
'../base/user_messages.dart'
;
import
'../base/utils.dart'
;
...
...
@@ -128,7 +127,7 @@ abstract class FlutterCommand extends Command<void> {
ArgParser
get
argParser
=>
_argParser
;
final
ArgParser
_argParser
=
ArgParser
(
allowTrailingOptions:
false
,
usageLineLength:
outputPreferences
.
wrapText
?
outputPreferences
.
wrapColumn
:
null
,
usageLineLength:
globals
.
outputPreferences
.
wrapText
?
globals
.
outputPreferences
.
wrapColumn
:
null
,
);
@override
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
e0ab6fc0
...
...
@@ -139,14 +139,14 @@ class FlutterCommandRunner extends CommandRunner<void> {
ArgParser
get
argParser
=>
_argParser
;
final
ArgParser
_argParser
=
ArgParser
(
allowTrailingOptions:
false
,
usageLineLength:
outputPreferences
.
wrapText
?
outputPreferences
.
wrapColumn
:
null
,
usageLineLength:
globals
.
outputPreferences
.
wrapText
?
globals
.
outputPreferences
.
wrapColumn
:
null
,
);
@override
String
get
usageFooter
{
return
wrapText
(
'Run "flutter help -v" for verbose help output, including less commonly used options.'
,
columnWidth:
outputPreferences
.
wrapColumn
,
shouldWrap:
outputPreferences
.
wrapText
,
columnWidth:
globals
.
outputPreferences
.
wrapColumn
,
shouldWrap:
globals
.
outputPreferences
.
wrapText
,
);
}
...
...
@@ -154,8 +154,8 @@ class FlutterCommandRunner extends CommandRunner<void> {
String
get
usage
{
final
String
usageWithoutDescription
=
super
.
usage
.
substring
(
description
.
length
+
2
);
final
String
prefix
=
wrapText
(
description
,
shouldWrap:
outputPreferences
.
wrapText
,
columnWidth:
outputPreferences
.
wrapColumn
,
shouldWrap:
globals
.
outputPreferences
.
wrapText
,
columnWidth:
globals
.
outputPreferences
.
wrapColumn
,
);
return
'
$prefix
\n\n
$usageWithoutDescription
'
;
}
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart
View file @
e0ab6fc0
...
...
@@ -291,7 +291,7 @@ class FakeFlutterCommand extends FlutterCommand {
@override
Future
<
FlutterCommandResult
>
runCommand
()
{
preferences
=
outputPreferences
;
preferences
=
globals
.
outputPreferences
;
return
Future
<
FlutterCommandResult
>.
value
(
const
FlutterCommandResult
(
ExitStatus
.
success
));
}
...
...
packages/flutter_tools/test/general.shard/vmservice_test.dart
View file @
e0ab6fc0
...
...
@@ -9,6 +9,7 @@ import 'package:flutter_tools/src/base/io.dart';
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/version.dart'
;
import
'package:flutter_tools/src/vmservice.dart'
;
import
'package:json_rpc_2/json_rpc_2.dart'
as
rpc
;
...
...
@@ -291,7 +292,7 @@ void main() {
});
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
StdoutLogger
(
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
terminal:
AnsiTerminal
(
stdio:
mockStdio
,
platform:
const
LocalPlatform
(),
...
...
@@ -311,7 +312,7 @@ void main() {
});
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
StdoutLogger
(
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
terminal:
AnsiTerminal
(
stdio:
mockStdio
,
platform:
const
LocalPlatform
(),
...
...
@@ -332,7 +333,7 @@ void main() {
});
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
StdoutLogger
(
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
terminal:
AnsiTerminal
(
stdio:
mockStdio
,
platform:
const
LocalPlatform
(),
...
...
packages/flutter_tools/test/src/context.dart
View file @
e0ab6fc0
...
...
@@ -120,7 +120,7 @@ void testUsingContext(
OutputPreferences:
()
=>
OutputPreferences
.
test
(),
Logger:
()
=>
BufferLogger
(
terminal:
globals
.
terminal
,
outputPreferences:
outputPreferences
,
outputPreferences:
globals
.
outputPreferences
,
),
OperatingSystemUtils:
()
=>
FakeOperatingSystemUtils
(),
PersistentToolState:
()
=>
buildPersistentToolState
(
globals
.
fs
),
...
...
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