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
22ec357b
Unverified
Commit
22ec357b
authored
Nov 11, 2020
by
Jonah Williams
Committed by
GitHub
Nov 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] make getBuildInfo async (#70320)
parent
0f80116a
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
45 additions
and
46 deletions
+45
-46
attach.dart
packages/flutter_tools/lib/src/commands/attach.dart
+5
-3
build_aar.dart
packages/flutter_tools/lib/src/commands/build_aar.dart
+1
-1
build_aot.dart
packages/flutter_tools/lib/src/commands/build_aot.dart
+1
-1
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+1
-1
build_appbundle.dart
packages/flutter_tools/lib/src/commands/build_appbundle.dart
+1
-1
build_bundle.dart
packages/flutter_tools/lib/src/commands/build_bundle.dart
+1
-1
build_fuchsia.dart
packages/flutter_tools/lib/src/commands/build_fuchsia.dart
+1
-1
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+5
-10
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+6
-6
build_linux.dart
packages/flutter_tools/lib/src/commands/build_linux.dart
+1
-1
build_macos.dart
packages/flutter_tools/lib/src/commands/build_macos.dart
+1
-1
build_web.dart
packages/flutter_tools/lib/src/commands/build_web.dart
+1
-1
build_windows.dart
packages/flutter_tools/lib/src/commands/build_windows.dart
+1
-1
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+2
-2
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+13
-11
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+2
-2
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
build_test.dart
...lutter_tools/test/commands.shard/hermetic/build_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/commands/attach.dart
View file @
22ec357b
...
@@ -12,6 +12,7 @@ import '../base/common.dart';
...
@@ -12,6 +12,7 @@ import '../base/common.dart';
import
'../base/context.dart'
;
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/io.dart'
;
import
'../build_info.dart'
;
import
'../commands/daemon.dart'
;
import
'../commands/daemon.dart'
;
import
'../compile.dart'
;
import
'../compile.dart'
;
import
'../device.dart'
;
import
'../device.dart'
;
...
@@ -381,6 +382,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
...
@@ -381,6 +382,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
assert
(
device
!=
null
);
assert
(
device
!=
null
);
assert
(
flutterProject
!=
null
);
assert
(
flutterProject
!=
null
);
assert
(
usesIpv6
!=
null
);
assert
(
usesIpv6
!=
null
);
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
FlutterDevice
flutterDevice
=
await
FlutterDevice
.
create
(
final
FlutterDevice
flutterDevice
=
await
FlutterDevice
.
create
(
device
,
device
,
...
@@ -388,15 +390,15 @@ known, it can be explicitly provided to attach via the command-line, e.g.
...
@@ -388,15 +390,15 @@ known, it can be explicitly provided to attach via the command-line, e.g.
fileSystemScheme:
stringArg
(
'filesystem-scheme'
),
fileSystemScheme:
stringArg
(
'filesystem-scheme'
),
target:
stringArg
(
'target'
),
target:
stringArg
(
'target'
),
targetModel:
TargetModel
(
stringArg
(
'target-model'
)),
targetModel:
TargetModel
(
stringArg
(
'target-model'
)),
buildInfo:
getBuildInfo
()
,
buildInfo:
buildInfo
,
userIdentifier:
userIdentifier
,
userIdentifier:
userIdentifier
,
platform:
globals
.
platform
,
platform:
globals
.
platform
,
);
);
flutterDevice
.
observatoryUris
=
observatoryUris
;
flutterDevice
.
observatoryUris
=
observatoryUris
;
final
List
<
FlutterDevice
>
flutterDevices
=
<
FlutterDevice
>[
flutterDevice
];
final
List
<
FlutterDevice
>
flutterDevices
=
<
FlutterDevice
>[
flutterDevice
];
final
DebuggingOptions
debuggingOptions
=
DebuggingOptions
.
enabled
(
getBuildInfo
()
,
disableDds:
boolArg
(
'disable-dds'
));
final
DebuggingOptions
debuggingOptions
=
DebuggingOptions
.
enabled
(
buildInfo
,
disableDds:
boolArg
(
'disable-dds'
));
return
getBuildInfo
()
.
isDebug
return
buildInfo
.
isDebug
?
hotRunnerFactory
.
build
(
?
hotRunnerFactory
.
build
(
flutterDevices
,
flutterDevices
,
target:
targetFile
,
target:
targetFile
,
...
...
packages/flutter_tools/lib/src/commands/build_aar.dart
View file @
22ec357b
...
@@ -112,7 +112,7 @@ class BuildAarCommand extends BuildSubCommand {
...
@@ -112,7 +112,7 @@ class BuildAarCommand extends BuildSubCommand {
if
(
boolArg
(
buildMode
))
{
if
(
boolArg
(
buildMode
))
{
androidBuildInfo
.
add
(
androidBuildInfo
.
add
(
AndroidBuildInfo
(
AndroidBuildInfo
(
getBuildInfo
(
forcedBuildMode:
BuildMode
.
fromName
(
buildMode
)),
await
getBuildInfo
(
forcedBuildMode:
BuildMode
.
fromName
(
buildMode
)),
targetArchs:
targetArchitectures
,
targetArchs:
targetArchitectures
,
)
)
);
);
...
...
packages/flutter_tools/lib/src/commands/build_aot.dart
View file @
22ec357b
...
@@ -57,7 +57,7 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
...
@@ -57,7 +57,7 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
final
String
targetPlatform
=
stringArg
(
'target-platform'
);
final
String
targetPlatform
=
stringArg
(
'target-platform'
);
final
TargetPlatform
platform
=
getTargetPlatformForName
(
targetPlatform
);
final
TargetPlatform
platform
=
getTargetPlatformForName
(
targetPlatform
);
final
String
outputPath
=
stringArg
(
'output-dir'
)
??
getAotBuildDirectory
();
final
String
outputPath
=
stringArg
(
'output-dir'
)
??
getAotBuildDirectory
();
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
if
(
platform
==
null
)
{
if
(
platform
==
null
)
{
throwToolExit
(
'Unknown platform:
$targetPlatform
'
);
throwToolExit
(
'Unknown platform:
$targetPlatform
'
);
}
}
...
...
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
22ec357b
...
@@ -90,7 +90,7 @@ class BuildApkCommand extends BuildSubCommand {
...
@@ -90,7 +90,7 @@ class BuildApkCommand extends BuildSubCommand {
if
(
globals
.
androidSdk
==
null
)
{
if
(
globals
.
androidSdk
==
null
)
{
exitWithNoSdkMessage
();
exitWithNoSdkMessage
();
}
}
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
AndroidBuildInfo
androidBuildInfo
=
AndroidBuildInfo
(
final
AndroidBuildInfo
androidBuildInfo
=
AndroidBuildInfo
(
buildInfo
,
buildInfo
,
splitPerAbi:
boolArg
(
'split-per-abi'
),
splitPerAbi:
boolArg
(
'split-per-abi'
),
...
...
packages/flutter_tools/lib/src/commands/build_appbundle.dart
View file @
22ec357b
...
@@ -82,7 +82,7 @@ class BuildAppBundleCommand extends BuildSubCommand {
...
@@ -82,7 +82,7 @@ class BuildAppBundleCommand extends BuildSubCommand {
if
(
globals
.
androidSdk
==
null
)
{
if
(
globals
.
androidSdk
==
null
)
{
exitWithNoSdkMessage
();
exitWithNoSdkMessage
();
}
}
final
AndroidBuildInfo
androidBuildInfo
=
AndroidBuildInfo
(
getBuildInfo
(),
final
AndroidBuildInfo
androidBuildInfo
=
AndroidBuildInfo
(
await
getBuildInfo
(),
targetArchs:
stringsArg
(
'target-platform'
).
map
<
AndroidArch
>(
getAndroidArchForName
),
targetArchs:
stringsArg
(
'target-platform'
).
map
<
AndroidArch
>(
getAndroidArchForName
),
shrink:
boolArg
(
'shrink'
),
shrink:
boolArg
(
'shrink'
),
);
);
...
...
packages/flutter_tools/lib/src/commands/build_bundle.dart
View file @
22ec357b
...
@@ -113,7 +113,7 @@ class BuildBundleCommand extends BuildSubCommand {
...
@@ -113,7 +113,7 @@ class BuildBundleCommand extends BuildSubCommand {
break
;
break
;
}
}
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
await
bundleBuilder
.
build
(
await
bundleBuilder
.
build
(
platform:
platform
,
platform:
platform
,
...
...
packages/flutter_tools/lib/src/commands/build_fuchsia.dart
View file @
22ec357b
...
@@ -64,7 +64,7 @@ class BuildFuchsiaCommand extends BuildSubCommand {
...
@@ -64,7 +64,7 @@ class BuildFuchsiaCommand extends BuildSubCommand {
'information.'
'information.'
);
);
}
}
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
if
(!
globals
.
platform
.
isLinux
&&
!
globals
.
platform
.
isMacOS
)
{
if
(!
globals
.
platform
.
isLinux
&&
!
globals
.
platform
.
isMacOS
)
{
throwToolExit
(
'"build fuchsia" is only supported on Linux and MacOS hosts.'
);
throwToolExit
(
'"build fuchsia" is only supported on Linux and MacOS hosts.'
);
...
...
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
22ec357b
...
@@ -109,6 +109,7 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
...
@@ -109,6 +109,7 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
}
}
}
}
final
FlutterCommandResult
xcarchiveResult
=
await
super
.
runCommand
();
final
FlutterCommandResult
xcarchiveResult
=
await
super
.
runCommand
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
if
(
exportOptionsPlist
==
null
)
{
if
(
exportOptionsPlist
==
null
)
{
return
xcarchiveResult
;
return
xcarchiveResult
;
...
@@ -121,7 +122,7 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
...
@@ -121,7 +122,7 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
}
}
// Build IPA from generated xcarchive.
// Build IPA from generated xcarchive.
final
BuildableIOSApp
app
=
await
buildableIOSApp
;
final
BuildableIOSApp
app
=
await
buildableIOSApp
(
buildInfo
)
;
Status
status
;
Status
status
;
RunResult
result
;
RunResult
result
;
final
String
outputPath
=
globals
.
fs
.
path
.
absolute
(
app
.
ipaOutputPath
);
final
String
outputPath
=
globals
.
fs
.
path
.
absolute
(
app
.
ipaOutputPath
);
...
@@ -195,14 +196,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
...
@@ -195,14 +196,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
bool
get
configOnly
;
bool
get
configOnly
;
bool
get
shouldCodesign
;
bool
get
shouldCodesign
;
BuildInfo
get
buildInfo
{
Future
<
BuildableIOSApp
>
buildableIOSApp
(
BuildInfo
buildInfo
)
async
{
_buildInfo
??=
getBuildInfo
();
return
_buildInfo
;
}
BuildInfo
_buildInfo
;
Future
<
BuildableIOSApp
>
get
buildableIOSApp
async
{
_buildableIOSApp
??=
await
applicationPackages
.
getPackageForPlatform
(
_buildableIOSApp
??=
await
applicationPackages
.
getPackageForPlatform
(
TargetPlatform
.
ios
,
TargetPlatform
.
ios
,
buildInfo:
buildInfo
,
buildInfo:
buildInfo
,
...
@@ -215,6 +209,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
...
@@ -215,6 +209,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
defaultBuildMode
=
forSimulator
?
BuildMode
.
debug
:
BuildMode
.
release
;
defaultBuildMode
=
forSimulator
?
BuildMode
.
debug
:
BuildMode
.
release
;
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
if
(!
globals
.
platform
.
isMacOS
)
{
if
(!
globals
.
platform
.
isMacOS
)
{
throwToolExit
(
'Building for iOS is only supported on macOS.'
);
throwToolExit
(
'Building for iOS is only supported on macOS.'
);
...
@@ -232,7 +227,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
...
@@ -232,7 +227,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
);
);
}
}
final
BuildableIOSApp
app
=
await
buildableIOSApp
;
final
BuildableIOSApp
app
=
await
buildableIOSApp
(
buildInfo
)
;
if
(
app
==
null
)
{
if
(
app
==
null
)
{
throwToolExit
(
'Application not configured for iOS'
);
throwToolExit
(
'Application not configured for iOS'
);
...
...
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
22ec357b
...
@@ -124,17 +124,17 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
...
@@ -124,17 +124,17 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
FlutterProject
_project
;
FlutterProject
_project
;
List
<
BuildInfo
>
get
buildInfos
{
Future
<
List
<
BuildInfo
>>
get
buildInfos
async
{
final
List
<
BuildInfo
>
buildInfos
=
<
BuildInfo
>[];
final
List
<
BuildInfo
>
buildInfos
=
<
BuildInfo
>[];
if
(
boolArg
(
'debug'
))
{
if
(
boolArg
(
'debug'
))
{
buildInfos
.
add
(
getBuildInfo
(
forcedBuildMode:
BuildMode
.
debug
));
buildInfos
.
add
(
await
getBuildInfo
(
forcedBuildMode:
BuildMode
.
debug
));
}
}
if
(
boolArg
(
'profile'
))
{
if
(
boolArg
(
'profile'
))
{
buildInfos
.
add
(
getBuildInfo
(
forcedBuildMode:
BuildMode
.
profile
));
buildInfos
.
add
(
await
getBuildInfo
(
forcedBuildMode:
BuildMode
.
profile
));
}
}
if
(
boolArg
(
'release'
))
{
if
(
boolArg
(
'release'
))
{
buildInfos
.
add
(
getBuildInfo
(
forcedBuildMode:
BuildMode
.
release
));
buildInfos
.
add
(
await
getBuildInfo
(
forcedBuildMode:
BuildMode
.
release
));
}
}
return
buildInfos
;
return
buildInfos
;
...
@@ -163,7 +163,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
...
@@ -163,7 +163,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
'Silicon ARM simulators and will be removed in a future version of '
'Silicon ARM simulators and will be removed in a future version of '
'Flutter. Use --xcframework instead.'
);
'Flutter. Use --xcframework instead.'
);
}
}
if
(
buildInfos
.
isEmpty
)
{
if
(
(
await
buildInfos
)
.
isEmpty
)
{
throwToolExit
(
'At least one of "--debug" or "--profile", or "--release" is required.'
);
throwToolExit
(
'At least one of "--debug" or "--profile", or "--release" is required.'
);
}
}
}
}
...
@@ -183,7 +183,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
...
@@ -183,7 +183,7 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
final
Directory
outputDirectory
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
absolute
(
globals
.
fs
.
path
.
normalize
(
outputArgument
)));
final
Directory
outputDirectory
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
absolute
(
globals
.
fs
.
path
.
normalize
(
outputArgument
)));
for
(
final
BuildInfo
buildInfo
in
buildInfos
)
{
for
(
final
BuildInfo
buildInfo
in
await
buildInfos
)
{
final
String
productBundleIdentifier
=
await
_project
.
ios
.
productBundleIdentifier
(
buildInfo
);
final
String
productBundleIdentifier
=
await
_project
.
ios
.
productBundleIdentifier
(
buildInfo
);
globals
.
printStatus
(
'Building frameworks for
$productBundleIdentifier
in
${getNameForBuildMode(buildInfo.mode)}
mode...'
);
globals
.
printStatus
(
'Building frameworks for
$productBundleIdentifier
in
${getNameForBuildMode(buildInfo.mode)}
mode...'
);
final
String
xcodeBuildConfiguration
=
toTitleCase
(
getNameForBuildMode
(
buildInfo
.
mode
));
final
String
xcodeBuildConfiguration
=
toTitleCase
(
getNameForBuildMode
(
buildInfo
.
mode
));
...
...
packages/flutter_tools/lib/src/commands/build_linux.dart
View file @
22ec357b
...
@@ -35,7 +35,7 @@ class BuildLinuxCommand extends BuildSubCommand {
...
@@ -35,7 +35,7 @@ class BuildLinuxCommand extends BuildSubCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
if
(!
featureFlags
.
isLinuxEnabled
)
{
if
(!
featureFlags
.
isLinuxEnabled
)
{
throwToolExit
(
'"build linux" is not currently supported.'
);
throwToolExit
(
'"build linux" is not currently supported.'
);
...
...
packages/flutter_tools/lib/src/commands/build_macos.dart
View file @
22ec357b
...
@@ -39,7 +39,7 @@ class BuildMacosCommand extends BuildSubCommand {
...
@@ -39,7 +39,7 @@ class BuildMacosCommand extends BuildSubCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
if
(!
featureFlags
.
isMacOSEnabled
)
{
if
(!
featureFlags
.
isMacOSEnabled
)
{
throwToolExit
(
'"build macos" is not currently supported.'
);
throwToolExit
(
'"build macos" is not currently supported.'
);
...
...
packages/flutter_tools/lib/src/commands/build_web.dart
View file @
22ec357b
...
@@ -79,7 +79,7 @@ class BuildWebCommand extends BuildSubCommand {
...
@@ -79,7 +79,7 @@ class BuildWebCommand extends BuildSubCommand {
}
}
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
String
target
=
stringArg
(
'target'
);
final
String
target
=
stringArg
(
'target'
);
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
if
(
buildInfo
.
isDebug
)
{
if
(
buildInfo
.
isDebug
)
{
throwToolExit
(
'debug builds cannot be built directly for the web. Try using "flutter run"'
);
throwToolExit
(
'debug builds cannot be built directly for the web. Try using "flutter run"'
);
}
}
...
...
packages/flutter_tools/lib/src/commands/build_windows.dart
View file @
22ec357b
...
@@ -42,7 +42,7 @@ class BuildWindowsCommand extends BuildSubCommand {
...
@@ -42,7 +42,7 @@ class BuildWindowsCommand extends BuildSubCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
if
(!
featureFlags
.
isWindowsEnabled
)
{
if
(!
featureFlags
.
isWindowsEnabled
)
{
throwToolExit
(
'"build windows" is not currently supported.'
);
throwToolExit
(
'"build windows" is not currently supported.'
);
}
}
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
22ec357b
...
@@ -195,8 +195,8 @@ class DriveCommand extends RunCommandBase {
...
@@ -195,8 +195,8 @@ class DriveCommand extends RunCommandBase {
throwOnError:
false
,
throwOnError:
false
,
)
??
PackageConfig
.
empty
;
)
??
PackageConfig
.
empty
;
final
DriverService
driverService
=
_flutterDriverFactory
.
createDriverService
(
web
);
final
DriverService
driverService
=
_flutterDriverFactory
.
createDriverService
(
web
);
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
DebuggingOptions
debuggingOptions
=
createDebuggingOptions
();
final
DebuggingOptions
debuggingOptions
=
await
createDebuggingOptions
();
final
File
applicationBinary
=
stringArg
(
'use-application-binary'
)
==
null
final
File
applicationBinary
=
stringArg
(
'use-application-binary'
)
==
null
?
null
?
null
:
_fileSystem
.
file
(
stringArg
(
'use-application-binary'
));
:
_fileSystem
.
file
(
stringArg
(
'use-application-binary'
));
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
22ec357b
...
@@ -152,8 +152,8 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
...
@@ -152,8 +152,8 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
String
get
traceAllowlist
=>
stringArg
(
'trace-allowlist'
);
String
get
traceAllowlist
=>
stringArg
(
'trace-allowlist'
);
/// Create a debugging options instance for the current `run` or `drive` invocation.
/// Create a debugging options instance for the current `run` or `drive` invocation.
DebuggingOptions
createDebuggingOptions
()
{
Future
<
DebuggingOptions
>
createDebuggingOptions
()
async
{
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
int
browserDebugPort
=
featureFlags
.
isWebEnabled
&&
argResults
.
wasParsed
(
'web-browser-debug-port'
)
final
int
browserDebugPort
=
featureFlags
.
isWebEnabled
&&
argResults
.
wasParsed
(
'web-browser-debug-port'
)
?
int
.
parse
(
stringArg
(
'web-browser-debug-port'
))
?
int
.
parse
(
stringArg
(
'web-browser-debug-port'
))
:
null
;
:
null
;
...
@@ -384,7 +384,8 @@ class RunCommand extends RunCommandBase {
...
@@ -384,7 +384,8 @@ class RunCommand extends RunCommandBase {
}
}
}
}
final
String
modeName
=
getBuildInfo
().
modeName
;
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
String
modeName
=
buildInfo
.
modeName
;
return
<
CustomDimensions
,
String
>{
return
<
CustomDimensions
,
String
>{
CustomDimensions
.
commandRunIsEmulator
:
'
$isEmulator
'
,
CustomDimensions
.
commandRunIsEmulator
:
'
$isEmulator
'
,
CustomDimensions
.
commandRunTargetName
:
deviceType
,
CustomDimensions
.
commandRunTargetName
:
deviceType
,
...
@@ -407,10 +408,10 @@ class RunCommand extends RunCommandBase {
...
@@ -407,10 +408,10 @@ class RunCommand extends RunCommandBase {
return
super
.
shouldRunPub
;
return
super
.
shouldRunPub
;
}
}
bool
shouldUseHotMode
()
{
bool
shouldUseHotMode
(
BuildInfo
buildInfo
)
{
final
bool
hotArg
=
boolArg
(
'hot'
)
??
false
;
final
bool
hotArg
=
boolArg
(
'hot'
)
??
false
;
final
bool
shouldUseHotMode
=
hotArg
&&
!
traceStartup
;
final
bool
shouldUseHotMode
=
hotArg
&&
!
traceStartup
;
return
getBuildInfo
()
.
isDebug
&&
shouldUseHotMode
;
return
buildInfo
.
isDebug
&&
shouldUseHotMode
;
}
}
bool
get
stayResident
=>
boolArg
(
'resident'
);
bool
get
stayResident
=>
boolArg
(
'resident'
);
...
@@ -444,7 +445,8 @@ class RunCommand extends RunCommandBase {
...
@@ -444,7 +445,8 @@ class RunCommand extends RunCommandBase {
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
// Enable hot mode by default if `--no-hot` was not passed and we are in
// Enable hot mode by default if `--no-hot` was not passed and we are in
// debug mode.
// debug mode.
final
bool
hotMode
=
shouldUseHotMode
();
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
bool
hotMode
=
shouldUseHotMode
(
buildInfo
);
writePidFile
(
stringArg
(
'pid-file'
));
writePidFile
(
stringArg
(
'pid-file'
));
...
@@ -465,7 +467,7 @@ class RunCommand extends RunCommandBase {
...
@@ -465,7 +467,7 @@ class RunCommand extends RunCommandBase {
final
String
applicationBinaryPath
=
stringArg
(
'use-application-binary'
);
final
String
applicationBinaryPath
=
stringArg
(
'use-application-binary'
);
app
=
await
daemon
.
appDomain
.
startApp
(
app
=
await
daemon
.
appDomain
.
startApp
(
devices
.
first
,
globals
.
fs
.
currentDirectory
.
path
,
targetFile
,
route
,
devices
.
first
,
globals
.
fs
.
currentDirectory
.
path
,
targetFile
,
route
,
createDebuggingOptions
(),
hotMode
,
await
createDebuggingOptions
(),
hotMode
,
applicationBinary:
applicationBinaryPath
==
null
applicationBinary:
applicationBinaryPath
==
null
?
null
?
null
:
globals
.
fs
.
file
(
applicationBinaryPath
),
:
globals
.
fs
.
file
(
applicationBinaryPath
),
...
@@ -534,7 +536,7 @@ class RunCommand extends RunCommandBase {
...
@@ -534,7 +536,7 @@ class RunCommand extends RunCommandBase {
fileSystemScheme:
stringArg
(
'filesystem-scheme'
),
fileSystemScheme:
stringArg
(
'filesystem-scheme'
),
experimentalFlags:
expFlags
,
experimentalFlags:
expFlags
,
target:
stringArg
(
'target'
),
target:
stringArg
(
'target'
),
buildInfo:
getBuildInfo
()
,
buildInfo:
buildInfo
,
userIdentifier:
userIdentifier
,
userIdentifier:
userIdentifier
,
platform:
globals
.
platform
,
platform:
globals
.
platform
,
),
),
...
@@ -551,7 +553,7 @@ class RunCommand extends RunCommandBase {
...
@@ -551,7 +553,7 @@ class RunCommand extends RunCommandBase {
runner
=
HotRunner
(
runner
=
HotRunner
(
flutterDevices
,
flutterDevices
,
target:
targetFile
,
target:
targetFile
,
debuggingOptions:
createDebuggingOptions
(),
debuggingOptions:
await
createDebuggingOptions
(),
benchmarkMode:
boolArg
(
'benchmark'
),
benchmarkMode:
boolArg
(
'benchmark'
),
applicationBinary:
applicationBinaryPath
==
null
applicationBinary:
applicationBinaryPath
==
null
?
null
?
null
...
@@ -567,7 +569,7 @@ class RunCommand extends RunCommandBase {
...
@@ -567,7 +569,7 @@ class RunCommand extends RunCommandBase {
target:
targetFile
,
target:
targetFile
,
flutterProject:
flutterProject
,
flutterProject:
flutterProject
,
ipv6:
ipv6
,
ipv6:
ipv6
,
debuggingOptions:
createDebuggingOptions
(),
debuggingOptions:
await
createDebuggingOptions
(),
stayResident:
stayResident
,
stayResident:
stayResident
,
urlTunneller:
null
,
urlTunneller:
null
,
);
);
...
@@ -575,7 +577,7 @@ class RunCommand extends RunCommandBase {
...
@@ -575,7 +577,7 @@ class RunCommand extends RunCommandBase {
runner
=
ColdRunner
(
runner
=
ColdRunner
(
flutterDevices
,
flutterDevices
,
target:
targetFile
,
target:
targetFile
,
debuggingOptions:
createDebuggingOptions
(),
debuggingOptions:
await
createDebuggingOptions
(),
traceStartup:
traceStartup
,
traceStartup:
traceStartup
,
awaitFirstFrameWhenTracing:
awaitFirstFrameWhenTracing
,
awaitFirstFrameWhenTracing:
awaitFirstFrameWhenTracing
,
applicationBinary:
applicationBinaryPath
==
null
applicationBinary:
applicationBinaryPath
==
null
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
22ec357b
...
@@ -171,7 +171,7 @@ class TestCommand extends FlutterCommand {
...
@@ -171,7 +171,7 @@ class TestCommand extends FlutterCommand {
final
List
<
String
>
plainNames
=
stringsArg
(
'plain-name'
);
final
List
<
String
>
plainNames
=
stringsArg
(
'plain-name'
);
final
String
tags
=
stringArg
(
'tags'
);
final
String
tags
=
stringArg
(
'tags'
);
final
String
excludeTags
=
stringArg
(
'exclude-tags'
);
final
String
excludeTags
=
stringArg
(
'exclude-tags'
);
final
BuildInfo
buildInfo
=
getBuildInfo
(
forcedBuildMode:
BuildMode
.
debug
);
final
BuildInfo
buildInfo
=
await
getBuildInfo
(
forcedBuildMode:
BuildMode
.
debug
);
if
(
buildTestAssets
&&
flutterProject
.
manifest
.
assets
.
isNotEmpty
)
{
if
(
buildTestAssets
&&
flutterProject
.
manifest
.
assets
.
isNotEmpty
)
{
await
_buildTestAsset
();
await
_buildTestAsset
();
...
@@ -226,7 +226,7 @@ class TestCommand extends FlutterCommand {
...
@@ -226,7 +226,7 @@ class TestCommand extends FlutterCommand {
collector
=
CoverageCollector
(
collector
=
CoverageCollector
(
verbose:
!
machine
,
verbose:
!
machine
,
libraryPredicate:
(
String
libraryName
)
=>
libraryName
.
contains
(
projectName
),
libraryPredicate:
(
String
libraryName
)
=>
libraryName
.
contains
(
projectName
),
// TODO(jonahwilliams): file bug for incorrect URI handling on windws
// TODO(jonahwilliams): file bug for incorrect URI handling on wind
o
ws
packagesPath:
globals
.
fs
.
path
.
absolute
(
'.packages'
),
packagesPath:
globals
.
fs
.
path
.
absolute
(
'.packages'
),
);
);
}
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
22ec357b
...
@@ -750,7 +750,7 @@ abstract class FlutterCommand extends Command<void> {
...
@@ -750,7 +750,7 @@ abstract class FlutterCommand extends Command<void> {
///
///
/// Throws a [ToolExit] if the current set of options is not compatible with
/// Throws a [ToolExit] if the current set of options is not compatible with
/// each other.
/// each other.
BuildInfo
getBuildInfo
({
BuildMode
forcedBuildMode
})
{
Future
<
BuildInfo
>
getBuildInfo
({
BuildMode
forcedBuildMode
})
async
{
final
bool
trackWidgetCreation
=
argParser
.
options
.
containsKey
(
'track-widget-creation'
)
&&
final
bool
trackWidgetCreation
=
argParser
.
options
.
containsKey
(
'track-widget-creation'
)
&&
boolArg
(
'track-widget-creation'
);
boolArg
(
'track-widget-creation'
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_test.dart
View file @
22ec357b
...
@@ -35,7 +35,7 @@ class FakeBuildCommand extends FlutterCommand {
...
@@ -35,7 +35,7 @@ class FakeBuildCommand extends FlutterCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
getBuildInfo
();
await
getBuildInfo
();
return
FlutterCommandResult
.
success
();
return
FlutterCommandResult
.
success
();
}
}
}
}
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