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
89427d67
Unverified
Commit
89427d67
authored
Sep 24, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing trailing commas in flutter_tools (#40968)
parent
e9965f56
Changes
66
Hide whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
238 additions
and
211 deletions
+238
-211
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+3
-2
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+1
-1
build_runner.dart
...ages/flutter_tools/lib/src/build_runner/build_runner.dart
+2
-2
build_script.dart
...ages/flutter_tools/lib/src/build_runner/build_script.dart
+1
-1
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+1
-1
web_compilation_delegate.dart
..._tools/lib/src/build_runner/web_compilation_delegate.dart
+1
-1
web_fs.dart
packages/flutter_tools/lib/src/build_runner/web_fs.dart
+9
-6
build_system.dart
...ages/flutter_tools/lib/src/build_system/build_system.dart
+4
-4
macos.dart
...ges/flutter_tools/lib/src/build_system/targets/macos.dart
+1
-1
assemble.dart
packages/flutter_tools/lib/src/commands/assemble.dart
+2
-2
build_bundle.dart
packages/flutter_tools/lib/src/commands/build_bundle.dart
+1
-1
build_linux.dart
packages/flutter_tools/lib/src/commands/build_linux.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
+1
-1
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+1
-1
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+3
-3
fuchsia_dev_finder.dart
...ges/flutter_tools/lib/src/fuchsia/fuchsia_dev_finder.dart
+2
-2
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+2
-2
fuchsia_sdk.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
+1
-1
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+5
-5
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-1
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+2
-2
usage.dart
packages/flutter_tools/lib/src/reporting/usage.dart
+12
-6
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+3
-3
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+2
-2
flutter_web_platform.dart
...ages/flutter_tools/lib/src/test/flutter_web_platform.dart
+9
-5
runner.dart
packages/flutter_tools/lib/src/test/runner.dart
+1
-1
chrome.dart
packages/flutter_tools/lib/src/web/chrome.dart
+1
-1
compile.dart
packages/flutter_tools/lib/src/web/compile.dart
+1
-1
web_device.dart
packages/flutter_tools/lib/src/web/web_device.dart
+1
-1
web_runner.dart
packages/flutter_tools/lib/src/web/web_runner.dart
+1
-1
visual_studio_validator.dart
...lutter_tools/lib/src/windows/visual_studio_validator.dart
+2
-2
analytics_test.dart
...ages/flutter_tools/test/general.shard/analytics_test.dart
+2
-2
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+40
-45
multiroot_asset_reader_test.dart
...neral.shard/build_runner/multiroot_asset_reader_test.dart
+1
-1
build_system_test.dart
...ls/test/general.shard/build_system/build_system_test.dart
+1
-1
exceptions_test.dart
...ools/test/general.shard/build_system/exceptions_test.dart
+5
-5
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+4
-4
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+1
-1
cold_test.dart
packages/flutter_tools/test/general.shard/cold_test.dart
+3
-3
build_apk_test.dart
...ter_tools/test/general.shard/commands/build_apk_test.dart
+3
-3
build_appbundle_test.dart
...ols/test/general.shard/commands/build_appbundle_test.dart
+3
-3
build_bundle_test.dart
..._tools/test/general.shard/commands/build_bundle_test.dart
+6
-6
build_web_test.dart
...ter_tools/test/general.shard/commands/build_web_test.dart
+1
-1
config_test.dart
...lutter_tools/test/general.shard/commands/config_test.dart
+5
-5
create_test.dart
...lutter_tools/test/general.shard/commands/create_test.dart
+34
-27
test_test.dart
.../flutter_tools/test/general.shard/commands/test_test.dart
+1
-1
flutter_platform_test.dart
...utter_tools/test/general.shard/flutter_platform_test.dart
+2
-2
forbidden_imports_test.dart
...tter_tools/test/general.shard/forbidden_imports_test.dart
+1
-1
hot_test.dart
packages/flutter_tools/test/general.shard/hot_test.dart
+3
-3
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+6
-6
mac_test.dart
packages/flutter_tools/test/general.shard/ios/mac_test.dart
+1
-1
linux_doctor_test.dart
...ter_tools/test/general.shard/linux/linux_doctor_test.dart
+1
-1
xcode_test.dart
...es/flutter_tools/test/general.shard/macos/xcode_test.dart
+4
-4
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+3
-3
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+8
-2
flutter_command_test.dart
...tools/test/general.shard/runner/flutter_command_test.dart
+1
-1
runner_test.dart
.../flutter_tools/test/general.shard/runner/runner_test.dart
+9
-4
chrome_test.dart
...ges/flutter_tools/test/general.shard/web/chrome_test.dart
+1
-1
web_fs_test.dart
...ges/flutter_tools/test/general.shard/web/web_fs_test.dart
+1
-1
visual_studio_test.dart
..._tools/test/general.shard/windows/visual_studio_test.dart
+2
-2
visual_studio_validator_test.dart
...t/general.shard/windows/visual_studio_validator_test.dart
+1
-1
mocks.dart
packages/flutter_tools/test/src/mocks.dart
+1
-1
testbed.dart
packages/flutter_tools/test/src/testbed.dart
+2
-2
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
89427d67
...
...
@@ -513,8 +513,9 @@ class AndroidDevice extends Device {
await
androidBuilder
.
buildApk
(
project:
project
,
target:
mainPath
,
androidBuildInfo:
AndroidBuildInfo
(
debuggingOptions
.
buildInfo
,
targetArchs:
<
AndroidArch
>[
androidArch
]
androidBuildInfo:
AndroidBuildInfo
(
debuggingOptions
.
buildInfo
,
targetArchs:
<
AndroidArch
>[
androidArch
],
),
);
// Package has been built, so we can get the updated application ID and
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
89427d67
...
...
@@ -261,7 +261,7 @@ Future<GradleProject> _readGradleProject({bool isLibrary = false}) async {
project
=
GradleProject
(
<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[],
fs
.
path
.
join
(
flutterProject
.
android
.
hostAppGradleRoot
.
path
,
'app'
,
'build'
)
fs
.
path
.
join
(
flutterProject
.
android
.
hostAppGradleRoot
.
path
,
'app'
,
'build'
)
,
);
}
status
.
stop
();
...
...
packages/flutter_tools/lib/src/build_runner/build_runner.dart
View file @
89427d67
...
...
@@ -113,7 +113,7 @@ class BuildRunner extends CodeGenerator {
}
scriptIdFile
.
writeAsBytesSync
(
appliedBuilderDigest
);
final
ProcessResult
generateResult
=
await
processManager
.
run
(<
String
>[
sdkBinaryName
(
'pub'
),
'run'
,
'build_runner'
,
'generate-build-script'
sdkBinaryName
(
'pub'
),
'run'
,
'build_runner'
,
'generate-build-script'
,
],
workingDirectory:
syntheticPubspec
.
parent
.
path
);
if
(
generateResult
.
exitCode
!=
0
)
{
throwToolExit
(
'Error generating build_script snapshot:
${generateResult.stderr}
'
);
...
...
@@ -173,7 +173,7 @@ class BuildRunner extends CodeGenerator {
if
(
log
.
message
!=
null
)
{
printTrace
(
log
.
message
);
}
}
}
,
);
}
finally
{
status
.
stop
();
...
...
packages/flutter_tools/lib/src/build_runner/build_script.dart
View file @
89427d67
...
...
@@ -190,7 +190,7 @@ final List<core.BuilderApplication> builders = <core.BuilderApplication>[
),
),
core
.
applyPostProcess
(
'flutter_tools:module_cleanup'
,
moduleCleanup
,
defaultGenerateFor:
const
InputSet
())
defaultGenerateFor:
const
InputSet
())
,
];
/// The entrypoint to this build script.
...
...
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
89427d67
...
...
@@ -33,7 +33,7 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
String
target
,
@required
FlutterProject
flutterProject
,
@required
bool
ipv6
,
@required
DebuggingOptions
debuggingOptions
@required
DebuggingOptions
debuggingOptions
,
})
{
return
ResidentWebRunner
(
device
,
...
...
packages/flutter_tools/lib/src/build_runner/web_compilation_delegate.dart
View file @
89427d67
...
...
@@ -131,7 +131,7 @@ class MultirootFileBasedAssetReader extends core.FileBasedAssetReader {
}
}
final
String
generatedRoot
=
fs
.
path
.
join
(
generatedDirectory
.
path
,
packageGraph
.
root
.
name
generatedDirectory
.
path
,
packageGraph
.
root
.
name
,
);
if
(!
fs
.
isDirectorySync
(
generatedRoot
))
{
return
;
...
...
packages/flutter_tools/lib/src/build_runner/web_fs.dart
View file @
89427d67
...
...
@@ -254,7 +254,7 @@ class WebFs {
'lib'
,
'dev_compiler'
,
'web'
,
'dart_stack_trace_mapper.js'
'dart_stack_trace_mapper.js'
,
));
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
'Content-Type'
:
'text/javascript'
,
...
...
@@ -266,7 +266,7 @@ class WebFs {
'dev_compiler'
,
'kernel'
,
'amd'
,
'require.js'
'require.js'
,
));
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
'Content-Type'
:
'text/javascript'
,
...
...
@@ -394,9 +394,12 @@ class BuildDaemonCreator {
}
Future
<
BuildDaemonClient
>
_connectClient
(
String
workingDirectory
,
{
bool
release
,
bool
profile
,
bool
hasPlugins
,
bool
initializePlatform
}
)
{
String
workingDirectory
,
{
bool
release
,
bool
profile
,
bool
hasPlugins
,
bool
initializePlatform
,
})
{
final
String
flutterToolsPackages
=
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'.packages'
);
final
String
buildScript
=
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'lib'
,
'src'
,
'build_runner'
,
'build_script.dart'
);
final
String
flutterWebSdk
=
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
);
...
...
@@ -417,7 +420,7 @@ class BuildDaemonCreator {
'--define'
,
'flutter_tools:entrypoint=profile=
$profile
'
,
'--define'
,
'flutter_tools:shell=flutterWebSdk=
$flutterWebSdk
'
,
'--define'
,
'flutter_tools:shell=hasPlugins=
$hasPlugins
'
,
'--define'
,
'flutter_tools:shell=initializePlatform=
$initializePlatform
'
'--define'
,
'flutter_tools:shell=initializePlatform=
$initializePlatform
'
,
],
logHandler:
(
ServerLog
serverLog
)
{
switch
(
serverLog
.
level
)
{
...
...
packages/flutter_tools/lib/src/build_system/build_system.dart
View file @
89427d67
...
...
@@ -126,7 +126,7 @@ abstract class Target {
<
Node
>[
for
(
Target
target
in
dependencies
)
target
.
_toNode
(
environment
)
],
environment
environment
,
);
}
...
...
@@ -390,9 +390,9 @@ class BuildSystem {
/// Build `target` and all of its dependencies.
Future
<
BuildResult
>
build
(
Target
target
,
Environment
environment
,
{
BuildSystemConfig
buildSystemConfig
=
const
BuildSystemConfig
()
}
)
async
{
Environment
environment
,
{
BuildSystemConfig
buildSystemConfig
=
const
BuildSystemConfig
(),
}
)
async
{
environment
.
buildDir
.
createSync
(
recursive:
true
);
environment
.
outputDir
.
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/lib/src/build_system/targets/macos.dart
View file @
89427d67
...
...
@@ -288,7 +288,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
List
<
Source
>
get
inputs
=>
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/pubspec.yaml'
),
Source
.
pattern
(
'{BUILD_DIR}/App.framework/App'
),
Source
.
behavior
(
MacOSAssetBehavior
())
Source
.
behavior
(
MacOSAssetBehavior
())
,
];
@override
...
...
packages/flutter_tools/lib/src/commands/assemble.dart
View file @
89427d67
...
...
@@ -44,7 +44,7 @@ class AssembleCommand extends FlutterCommand {
argParser
.
addMultiOption
(
'define'
,
abbr:
'd'
,
help:
'Allows passing configuration to a target with --define=target=key=value.'
help:
'Allows passing configuration to a target with --define=target=key=value.'
,
);
argParser
.
addOption
(
'build-inputs'
,
help:
'A file path where a newline '
'separated file containing all inputs used will be written after a build.'
...
...
@@ -60,7 +60,7 @@ class AssembleCommand extends FlutterCommand {
);
argParser
.
addOption
(
'resource-pool-size'
,
help:
'The maximum number of concurrent tasks the build system will run.'
help:
'The maximum number of concurrent tasks the build system will run.'
,
);
}
...
...
packages/flutter_tools/lib/src/commands/build_bundle.dart
View file @
89427d67
...
...
@@ -82,7 +82,7 @@ class BuildBundleCommand extends BuildSubCommand {
}
return
<
CustomDimensions
,
String
>{
CustomDimensions
.
commandBuildBundleTargetPlatform
:
argResults
[
'target-platform'
],
CustomDimensions
.
commandBuildBundleIsModule
:
'
${futterProject.isModule}
'
CustomDimensions
.
commandBuildBundleIsModule
:
'
${futterProject.isModule}
'
,
};
}
...
...
packages/flutter_tools/lib/src/commands/build_linux.dart
View file @
89427d67
...
...
@@ -24,7 +24,7 @@ class BuildLinuxCommand extends BuildSubCommand {
);
argParser
.
addFlag
(
'profile'
,
negatable:
false
,
help:
'Build a version of your app specialized for performance profiling.'
help:
'Build a version of your app specialized for performance profiling.'
,
);
argParser
.
addFlag
(
'release'
,
negatable:
false
,
...
...
packages/flutter_tools/lib/src/commands/build_windows.dart
View file @
89427d67
...
...
@@ -24,7 +24,7 @@ class BuildWindowsCommand extends BuildSubCommand {
);
argParser
.
addFlag
(
'profile'
,
negatable:
false
,
help:
'Build a version of your app specialized for performance profiling.'
help:
'Build a version of your app specialized for performance profiling.'
,
);
argParser
.
addFlag
(
'release'
,
negatable:
false
,
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
89427d67
...
...
@@ -274,7 +274,7 @@ Future<LaunchResult> _startApp(DriveCommand command) async {
command
.
getBuildInfo
(),
startPaused:
true
,
observatoryPort:
command
.
observatoryPort
,
verboseSystemLogs:
command
.
verboseSystemLogs
verboseSystemLogs:
command
.
verboseSystemLogs
,
),
platformArgs:
platformArgs
,
prebuiltApplication:
!
command
.
shouldBuild
,
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
89427d67
...
...
@@ -173,7 +173,7 @@ class RunCommand extends RunCommandBase {
negatable:
true
,
defaultsTo:
true
,
hide:
true
,
help:
'Whether to automatically invoke webOnlyInitializePlatform.'
help:
'Whether to automatically invoke webOnlyInitializePlatform.'
,
)
..
addOption
(
FlutterOptions
.
kExtraFrontEndOptions
,
hide:
true
)
..
addOption
(
FlutterOptions
.
kExtraGenSnapshotOptions
,
hide:
true
)
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
89427d67
...
...
@@ -50,7 +50,7 @@ class TestCommand extends FastFlutterCommand {
defaultsTo:
false
,
negatable:
false
,
help:
'No longer require an authentication code to connect to the VM '
'service (not recommended).'
'service (not recommended).'
,
)
..
addFlag
(
'coverage'
,
defaultsTo:
false
,
...
...
@@ -87,7 +87,7 @@ class TestCommand extends FastFlutterCommand {
abbr:
'j'
,
defaultsTo:
math
.
max
<
int
>(
1
,
platform
.
numberOfProcessors
-
2
).
toString
(),
help:
'The number of concurrent test processes to run.'
,
valueHelp:
'jobs'
valueHelp:
'jobs'
,
)
..
addFlag
(
'test-assets'
,
defaultsTo:
true
,
...
...
@@ -98,7 +98,7 @@ class TestCommand extends FastFlutterCommand {
..
addOption
(
'platform'
,
allowed:
const
<
String
>[
'tester'
,
'chrome'
],
defaultsTo:
'tester'
,
help:
'The platform to run the unit tests on. Defaults to "tester".'
help:
'The platform to run the unit tests on. Defaults to "tester".'
,
);
usesTrackWidgetCreation
(
verboseHelp:
verboseHelp
);
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_dev_finder.dart
View file @
89427d67
...
...
@@ -30,7 +30,7 @@ class FuchsiaDevFinder {
final
List
<
String
>
command
=
<
String
>[
fuchsiaArtifacts
.
devFinder
.
path
,
'list'
,
'-full'
'-full'
,
];
final
RunResult
result
=
await
processUtils
.
run
(
command
);
if
(
result
.
exitCode
!=
0
)
{
...
...
@@ -55,7 +55,7 @@ class FuchsiaDevFinder {
'resolve'
,
'-local'
,
'-device-limit'
,
'1'
,
deviceName
deviceName
,
];
final
RunResult
result
=
await
processUtils
.
run
(
command
);
if
(
result
.
exitCode
!=
0
)
{
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
89427d67
...
...
@@ -459,7 +459,7 @@ class FuchsiaDevice extends Device {
'-F'
,
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
id
,
command
command
,
]);
}
...
...
@@ -652,7 +652,7 @@ class _FuchsiaPortForwarder extends DevicePortForwarder {
'-vvv'
,
'-L'
,
'
${forwardedPort.hostPort}
:
$_ipv4Loopback
:
${forwardedPort.devicePort}
'
,
device
.
id
device
.
id
,
];
final
ProcessResult
result
=
await
processManager
.
run
(
command
);
if
(
result
.
exitCode
!=
0
)
{
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
View file @
89427d67
...
...
@@ -77,7 +77,7 @@ class FuchsiaSdk {
'-F'
,
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
id
,
remoteCommand
remoteCommand
,
];
processManager
.
start
(
cmd
).
then
((
Process
newProcess
)
{
if
(
controller
.
isClosed
)
{
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
89427d67
...
...
@@ -133,7 +133,7 @@ class IOSDevice extends Device {
);
_iproxyPath
=
artifacts
.
getArtifactPath
(
Artifact
.
iproxy
,
platform:
TargetPlatform
.
ios
platform:
TargetPlatform
.
ios
,
);
}
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
89427d67
...
...
@@ -111,7 +111,7 @@ class IMobileDevice {
_isInstalled
??=
processUtils
.
exitsHappySync
(
<
String
>[
_ideviceIdPath
,
'-h'
'-h'
,
],
environment:
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
...
...
@@ -141,7 +141,7 @@ class IMobileDevice {
<
String
>[
_ideviceinfoPath
,
'-u'
,
fakeIphoneId
fakeIphoneId
,
],
environment:
executionEnv
,
)).
processResult
;
...
...
@@ -176,7 +176,7 @@ class IMobileDevice {
final
ProcessResult
result
=
await
processManager
.
run
(
<
String
>[
_ideviceIdPath
,
'-l'
'-l'
,
],
environment:
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
...
...
@@ -199,7 +199,7 @@ class IMobileDevice {
'-u'
,
deviceID
,
'-k'
,
key
key
,
],
environment:
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
...
...
@@ -250,7 +250,7 @@ class IMobileDevice {
return
processUtils
.
run
(
<
String
>[
_idevicescreenshotPath
,
outputFile
.
path
outputFile
.
path
,
],
throwOnError:
true
,
environment:
Map
<
String
,
String
>.
fromEntries
(
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
89427d67
...
...
@@ -373,7 +373,7 @@ class IOSSimulator extends Device {
if
(
debuggingOptions
.
skiaDeterministicRendering
)
'--skia-deterministic-rendering'
,
if
(
debuggingOptions
.
useTestFonts
)
'--use-test-fonts'
,
'--observatory-port=
${debuggingOptions.observatoryPort ?? 0}
'
,
]
]
,
];
ProtocolDiscovery
observatoryDiscovery
;
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
89427d67
...
...
@@ -59,7 +59,7 @@ Future<void> updateGeneratedXcodeProperties({
targetOverride:
targetOverride
,
useMacOSConfig:
useMacOSConfig
,
setSymroot:
setSymroot
,
buildDirOverride:
buildDirOverride
buildDirOverride:
buildDirOverride
,
);
_updateGeneratedXcodePropertiesFile
(
...
...
@@ -327,7 +327,7 @@ class XcodeProjectInterpreter {
'-scheme'
,
scheme
,
'-quiet'
,
'clean'
'clean'
,
],
workingDirectory:
fs
.
currentDirectory
.
path
);
}
...
...
packages/flutter_tools/lib/src/reporting/usage.dart
View file @
89427d67
...
...
@@ -108,8 +108,9 @@ abstract class Usage {
///
/// Note that using [command] above is preferred to ensure that the parameter
/// keys are well-defined in [CustomDimensions] above.
void
sendCommand
(
String
command
,
{
Map
<
String
,
String
>
parameters
void
sendCommand
(
String
command
,
{
Map
<
String
,
String
>
parameters
,
});
/// Sends an 'event' to the underlying analytics implementation.
...
...
@@ -118,13 +119,18 @@ abstract class Usage {
/// event types defined in this directory in events.dart.
@visibleForOverriding
@visibleForTesting
void
sendEvent
(
String
category
,
String
parameter
,
{
Map
<
String
,
String
>
parameters
void
sendEvent
(
String
category
,
String
parameter
,
{
Map
<
String
,
String
>
parameters
,
});
/// Sends timing information to the underlying analytics implementation.
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
,
{
String
label
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
,
{
String
label
,
});
/// Sends an exception to the underlying analytics implementation.
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
89427d67
...
...
@@ -384,7 +384,7 @@ class HotRunner extends ResidentRunner {
Future
<
OperationResult
>
_restartFromSources
({
String
reason
,
bool
benchmarkMode
=
false
bool
benchmarkMode
=
false
,
})
async
{
if
(!
_isPaused
())
{
printTrace
(
'Refreshing active FlutterViews before restarting.'
);
...
...
@@ -520,7 +520,7 @@ class HotRunner extends ResidentRunner {
bool
fullRestart
=
false
,
bool
pauseAfterRestart
=
false
,
String
reason
,
bool
benchmarkMode
=
false
bool
benchmarkMode
=
false
,
})
async
{
String
targetPlatform
;
String
sdkName
;
...
...
@@ -663,7 +663,7 @@ class HotRunner extends ResidentRunner {
bool
emulator
,
bool
pause
=
false
,
String
reason
,
void
Function
(
String
message
)
onSlow
void
Function
(
String
message
)
onSlow
,
})
async
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterView
view
in
device
.
views
)
{
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
89427d67
...
...
@@ -293,7 +293,7 @@ abstract class FlutterCommand extends Command<void> {
'which shortens the names of your app’s classes and members, '
'and optimization, which applies more aggressive strategies to '
'further reduce the size of your app.'
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
,
);
}
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
89427d67
...
...
@@ -94,7 +94,7 @@ FlutterPlatform installHook({
Uri
projectRootDirectory
,
FlutterProject
flutterProject
,
String
icudtlPath
,
PlatformPluginRegistration
platformPluginRegistration
PlatformPluginRegistration
platformPluginRegistration
,
})
{
assert
(
enableObservatory
||
(!
startPaused
&&
observatoryPort
==
null
));
...
...
@@ -104,7 +104,7 @@ FlutterPlatform installHook({
<
Runtime
>[
Runtime
.
vm
],
()
{
return
platform
;
}
}
,
);
};
final
FlutterPlatform
platform
=
FlutterPlatform
(
...
...
packages/flutter_tools/lib/src/test/flutter_web_platform.dart
View file @
89427d67
...
...
@@ -248,7 +248,7 @@ class FlutterWebPlatform extends PlatformPlugin {
.
resolve
(
'static/index.html'
)
.
replace
(
queryParameters:
<
String
,
String
>{
'managerUrl'
:
webSocketUrl
.
toString
(),
'debug'
:
_config
.
pauseAfterLoad
.
toString
()
'debug'
:
_config
.
pauseAfterLoad
.
toString
()
,
});
printTrace
(
'Serving tests at
$hostUrl
'
);
...
...
@@ -551,12 +551,16 @@ class BrowserManager {
/// If [mapper] is passed, it's used to map stack traces for errors coming
/// from this test suite.
Future
<
RunnerSuite
>
load
(
String
path
,
Uri
url
,
SuiteConfiguration
suiteConfig
,
Object
message
,
{
StackTraceMapper
mapper
})
async
{
String
path
,
Uri
url
,
SuiteConfiguration
suiteConfig
,
Object
message
,
{
StackTraceMapper
mapper
,
})
async
{
url
=
url
.
replace
(
fragment:
Uri
.
encodeFull
(
jsonEncode
(<
String
,
Object
>{
'metadata'
:
suiteConfig
.
metadata
.
serialize
(),
'browser'
:
_runtime
.
identifier
'browser'
:
_runtime
.
identifier
,
})));
final
int
suiteID
=
_suiteID
++;
...
...
@@ -585,7 +589,7 @@ class BrowserManager {
'command'
:
'loadSuite'
,
'url'
:
url
.
toString
(),
'id'
:
suiteID
,
'channel'
:
suiteChannelID
'channel'
:
suiteChannelID
,
});
try
{
...
...
packages/flutter_tools/lib/src/test/runner.dart
View file @
89427d67
...
...
@@ -84,7 +84,7 @@ Future<int> runTests(
<
Runtime
>[
Runtime
.
chrome
],
()
{
return
FlutterWebPlatform
.
start
(
flutterProject
.
directory
.
path
);
}
}
,
);
await
test
.
main
(
testArgs
);
return
exitCode
;
...
...
packages/flutter_tools/lib/src/web/chrome.dart
View file @
89427d67
...
...
@@ -35,7 +35,7 @@ const String kWindowsExecutable = r'Google\Chrome\Application\chrome.exe';
final
List
<
String
>
kWindowsPrefixes
=
<
String
>[
platform
.
environment
[
'LOCALAPPDATA'
],
platform
.
environment
[
'PROGRAMFILES'
],
platform
.
environment
[
'PROGRAMFILES(X86)'
]
platform
.
environment
[
'PROGRAMFILES(X86)'
]
,
];
/// Find the chrome executable on the current platform.
...
...
packages/flutter_tools/lib/src/web/compile.dart
View file @
89427d67
...
...
@@ -46,7 +46,7 @@ Future<void> buildWeb(FlutterProject flutterProject, String target, BuildInfo bu
'build'
,
'flutter_web'
,
flutterProject
.
manifest
.
appName
,
'
${fs.path.withoutExtension(target)}
_web_entrypoint.dart.js'
'
${fs.path.withoutExtension(target)}
_web_entrypoint.dart.js'
,
);
fs
.
file
(
outputPath
).
copySync
(
fs
.
path
.
join
(
outputDir
.
path
,
'main.dart.js'
));
fs
.
file
(
'
$outputPath
.map'
).
copySync
(
fs
.
path
.
join
(
outputDir
.
path
,
'main.dart.js.map'
));
...
...
packages/flutter_tools/lib/src/web/web_device.dart
View file @
89427d67
...
...
@@ -98,7 +98,7 @@ class ChromeDevice extends Device {
String
version
=
'unknown'
;
if
(
platform
.
isWindows
)
{
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
r'reg'
,
'query'
,
'HKEY_CURRENT_USER
\\
Software
\\
Google
\\
Chrome
\\
BLBeacon'
,
'/v'
,
'version'
r'reg'
,
'query'
,
'HKEY_CURRENT_USER
\\
Software
\\
Google
\\
Chrome
\\
BLBeacon'
,
'/v'
,
'version'
,
]);
if
(
result
.
exitCode
==
0
)
{
final
List
<
String
>
parts
=
result
.
stdout
.
split
(
RegExp
(
r'\s+'
));
...
...
packages/flutter_tools/lib/src/web/web_runner.dart
View file @
89427d67
...
...
@@ -21,6 +21,6 @@ abstract class WebRunnerFactory {
String
target
,
@required
FlutterProject
flutterProject
,
@required
bool
ipv6
,
@required
DebuggingOptions
debuggingOptions
@required
DebuggingOptions
debuggingOptions
,
});
}
packages/flutter_tools/lib/src/windows/visual_studio_validator.dart
View file @
89427d67
...
...
@@ -51,7 +51,7 @@ class VisualStudioValidator extends DoctorValidator {
messages
.
add
(
ValidationMessage
.
error
(
userMessages
.
visualStudioMissingComponents
(
visualStudio
.
workloadDescription
,
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
,
)
));
}
...
...
@@ -61,7 +61,7 @@ class VisualStudioValidator extends DoctorValidator {
messages
.
add
(
ValidationMessage
.
error
(
userMessages
.
visualStudioMissing
(
visualStudio
.
workloadDescription
,
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
,
)
));
}
...
...
packages/flutter_tools/test/general.shard/analytics_test.dart
View file @
89427d67
...
...
@@ -67,7 +67,7 @@ void main() {
FlutterVersion:
()
=>
FlutterVersion
(
const
SystemClock
()),
Usage:
()
=>
Usage
(
configDirOverride:
tempDir
.
path
,
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
,
),
});
...
...
@@ -89,7 +89,7 @@ void main() {
FlutterVersion:
()
=>
FlutterVersion
(
const
SystemClock
()),
Usage:
()
=>
Usage
(
configDirOverride:
tempDir
.
path
,
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
,
),
});
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
89427d67
...
...
@@ -328,13 +328,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
BuildInfo
.
debug
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
]
)
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
],
)),
<
String
>[
'app-armeabi-v7a-debug.apk'
,
'app-arm64-v8a-debug.apk'
,
...
...
@@ -343,13 +342,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
BuildInfo
.
release
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
]
)
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
],
)),
<
String
>[
'app-armeabi-v7a-release.apk'
,
'app-arm64-v8a-release.apk'
,
...
...
@@ -358,26 +356,24 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
'unknown'
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
]
)
).
isEmpty
,
isTrue
);
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
],
)).
isEmpty
,
isTrue
);
});
test
(
'should provide apks for each ABI and flavored build types'
,
()
{
final
GradleProject
project
=
GradleProject
(<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[
'free'
,
'paid'
],
'/some/dir'
);
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
debug
,
'free'
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
]
)
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
],
)),
<
String
>[
'app-free-armeabi-v7a-debug.apk'
,
'app-free-arm64-v8a-debug.apk'
,
...
...
@@ -386,13 +382,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
'paid'
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
]
)
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
],
)),
<
String
>[
'app-paid-armeabi-v7a-release.apk'
,
'app-paid-arm64-v8a-release.apk'
,
...
...
@@ -401,13 +396,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
'unknown'
),
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
]
)
).
isEmpty
,
isTrue
);
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
],
)).
isEmpty
,
isTrue
);
});
test
(
'should provide assemble task name for default build types'
,
()
{
final
GradleProject
project
=
GradleProject
(<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[],
'/some/dir'
);
...
...
@@ -1144,11 +1138,12 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
migrateToR8
(
sampleAppAndroid
);
expect
(
testLogger
.
traceText
,
contains
(
'set `android.enableR8=true` in gradle.properties'
));
expect
(
sampleAppAndroid
.
childFile
(
'gradle.properties'
).
readAsStringSync
(),
expect
(
sampleAppAndroid
.
childFile
(
'gradle.properties'
).
readAsStringSync
(),
equals
(
'org.gradle.jvmargs=-Xmx1536M
\n
'
'android.enableR8=true
\n
'
)
)
,
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
memoryFileSystem
,
...
...
@@ -1246,7 +1241,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
androidBuildInfo:
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
null
)),
project:
FlutterProject
.
current
(),
outputDir:
'build/'
,
target:
''
target:
''
,
);
final
List
<
String
>
actualGradlewCall
=
verify
(
mockProcessManager
.
start
(
...
...
packages/flutter_tools/test/general.shard/build_runner/multiroot_asset_reader_test.dart
View file @
89427d67
...
...
@@ -36,7 +36,7 @@ void main() {
test
(
'Can find assets from the generated directory'
,
()
=>
testbed
.
run
(()
async
{
final
MultirootFileBasedAssetReader
reader
=
MultirootFileBasedAssetReader
(
packageGraph
,
fs
.
directory
(
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'generated'
))
fs
.
directory
(
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'generated'
))
,
);
// Note: we can't read from the regular directory because the default
...
...
packages/flutter_tools/test/general.shard/build_system/build_system_test.dart
View file @
89427d67
...
...
@@ -102,7 +102,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
mockPlatform
,
}
}
,
);
});
...
...
packages/flutter_tools/test/general.shard/build_system/exceptions_test.dart
View file @
89427d67
...
...
@@ -21,7 +21,7 @@ void main() {
);
final
MissingOutputException
missingOutputException
=
MissingOutputException
(
<
File
>[
fs
.
file
(
'foo'
),
fs
.
file
(
'bar'
)
],
'example'
'example'
,
);
final
MisplacedOutputException
misplacedOutputException
=
MisplacedOutputException
(
'foo'
,
...
...
@@ -38,16 +38,16 @@ void main() {
'but did not exist. Check the definition of target:example for errors'
);
expect
(
cycleException
.
toString
(),
'Dependency cycle detected in build: foo -> bar'
'Dependency cycle detected in build: foo -> bar'
,
);
expect
(
invalidPatternException
.
toString
(),
'The pattern "ABC" is not valid'
'The pattern "ABC" is not valid'
,
);
expect
(
missingOutputException
.
toString
(),
'foo, bar were declared as outputs, but were not generated by the '
'action. Check the definition of target:example for errors'
'action. Check the definition of target:example for errors'
,
);
expect
(
misplacedOutputException
.
toString
(),
...
...
@@ -56,7 +56,7 @@ void main() {
);
expect
(
missingDefineException
.
toString
(),
'Target example required define foobar but it was not provided'
'Target example required define foobar but it was not provided'
,
);
});
}
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
89427d67
...
...
@@ -44,7 +44,7 @@ void main() {
defines:
<
String
,
String
>{
kBuildMode:
getNameForBuildMode
(
BuildMode
.
profile
),
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
),
}
}
,
);
iosEnvironment
=
Environment
(
outputDir:
fs
.
currentDirectory
,
...
...
@@ -52,7 +52,7 @@ void main() {
defines:
<
String
,
String
>{
kBuildMode:
getNameForBuildMode
(
BuildMode
.
profile
),
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
ios
),
}
}
,
);
HostPlatform
hostPlatform
;
if
(
platform
.
isWindows
)
{
...
...
@@ -130,7 +130,7 @@ flutter_tools:lib/''');
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
)
mainPath:
anyNamed
(
'mainPath'
)
,
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
...
...
@@ -154,7 +154,7 @@ flutter_tools:lib/''');
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
)
mainPath:
anyNamed
(
'mainPath'
)
,
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
...
...
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
89427d67
...
...
@@ -73,7 +73,7 @@ void main() {
defines:
<
String
,
String
>{
kBuildMode:
'debug'
,
kTargetPlatform:
'darwin-x64'
,
}
}
,
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
MockProcessManager
(),
...
...
packages/flutter_tools/test/general.shard/cold_test.dart
View file @
89427d67
...
...
@@ -41,7 +41,7 @@ void main() {
device:
mockDevice
,
generator:
residentCompiler
,
exception:
const
HttpException
(
'Connection closed before full header was received, '
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
];
...
...
@@ -68,7 +68,7 @@ void main() {
TestFlutterDevice
(
device:
mockDevice
,
generator:
residentCompiler
,
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
];
...
...
@@ -96,7 +96,7 @@ class TestFlutterDevice extends FlutterDevice {
TestFlutterDevice
({
@required
Device
device
,
@required
this
.
exception
,
@required
ResidentCompiler
generator
@required
ResidentCompiler
generator
,
})
:
assert
(
exception
!=
null
),
super
(
device
,
buildMode:
BuildMode
.
debug
,
generator:
generator
,
trackWidgetCreation:
false
);
...
...
packages/flutter_tools/test/general.shard/commands/build_apk_test.dart
View file @
89427d67
...
...
@@ -258,9 +258,9 @@ void main() {
}
Future
<
BuildApkCommand
>
runBuildApkCommand
(
String
target
,
{
List
<
String
>
arguments
}
)
async
{
String
target
,
{
List
<
String
>
arguments
,
}
)
async
{
final
BuildApkCommand
command
=
BuildApkCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
...
...
packages/flutter_tools/test/general.shard/commands/build_appbundle_test.dart
View file @
89427d67
...
...
@@ -247,9 +247,9 @@ void main() {
}
Future
<
BuildAppBundleCommand
>
runBuildAppBundleCommand
(
String
target
,
{
List
<
String
>
arguments
}
)
async
{
String
target
,
{
List
<
String
>
arguments
,
}
)
async
{
final
BuildAppBundleCommand
command
=
BuildAppBundleCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
...
...
packages/flutter_tools/test/general.shard/commands/build_bundle_test.dart
View file @
89427d67
...
...
@@ -103,7 +103,7 @@ void main() {
expect
(()
=>
runner
.
run
(<
String
>[
'bundle'
,
'--no-pub'
,
'--target-platform=windows-x64'
'--target-platform=windows-x64'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
@@ -120,7 +120,7 @@ void main() {
expect
(()
=>
runner
.
run
(<
String
>[
'bundle'
,
'--no-pub'
,
'--target-platform=linux-x64'
'--target-platform=linux-x64'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
@@ -137,7 +137,7 @@ void main() {
expect
(()
=>
runner
.
run
(<
String
>[
'bundle'
,
'--no-pub'
,
'--target-platform=darwin-x64'
'--target-platform=darwin-x64'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
@@ -154,7 +154,7 @@ void main() {
await
runner
.
run
(<
String
>[
'bundle'
,
'--no-pub'
,
'--target-platform=windows-x64'
'--target-platform=windows-x64'
,
]);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
@@ -171,7 +171,7 @@ void main() {
await
runner
.
run
(<
String
>[
'bundle'
,
'--no-pub'
,
'--target-platform=linux-x64'
'--target-platform=linux-x64'
,
]);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
@@ -188,7 +188,7 @@ void main() {
await
runner
.
run
(<
String
>[
'bundle'
,
'--no-pub'
,
'--target-platform=darwin-x64'
'--target-platform=darwin-x64'
,
]);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
packages/flutter_tools/test/general.shard/commands/build_web_test.dart
View file @
89427d67
...
...
@@ -44,7 +44,7 @@ void main() {
projectName:
anyNamed
(
'projectName'
),
projectDirectory:
anyNamed
(
'projectDirectory'
),
mode:
anyNamed
(
'mode'
),
initializePlatform:
anyNamed
(
'initializePlatform'
)
initializePlatform:
anyNamed
(
'initializePlatform'
)
,
)).
thenAnswer
((
Invocation
invocation
)
{
final
String
path
=
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'flutter_web'
,
'foo'
,
'lib'
,
'main_web_entrypoint.dart.js'
);
fs
.
file
(
path
).
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/general.shard/commands/config_test.dart
View file @
89427d67
...
...
@@ -61,7 +61,7 @@ void main() {
await
commandRunner
.
run
(<
String
>[
'config'
,
'--build-dir=foo'
'--build-dir=foo'
,
]);
expect
(
getBuildDirectory
(),
'foo'
);
...
...
@@ -73,7 +73,7 @@ void main() {
expect
(()
=>
commandRunner
.
run
(<
String
>[
'config'
,
'--build-dir=/foo'
'--build-dir=/foo'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
});
...
...
@@ -86,7 +86,7 @@ void main() {
'--enable-web'
,
'--enable-linux-desktop'
,
'--enable-windows-desktop'
,
'--enable-macos-desktop'
'--enable-macos-desktop'
,
]);
expect
(
Config
.
instance
.
getValue
(
'enable-web'
),
true
);
...
...
@@ -108,7 +108,7 @@ void main() {
'--no-enable-web'
,
'--no-enable-linux-desktop'
,
'--no-enable-windows-desktop'
,
'--no-enable-macos-desktop'
'--no-enable-macos-desktop'
,
]);
expect
(
Config
.
instance
.
getValue
(
'enable-web'
),
false
);
...
...
@@ -131,7 +131,7 @@ void main() {
'--enable-web'
,
'--enable-linux-desktop'
,
'--enable-windows-desktop'
,
'--enable-macos-desktop'
'--enable-macos-desktop'
,
]);
await
commandRunner
.
run
(<
String
>[
...
...
packages/flutter_tools/test/general.shard/commands/create_test.dart
View file @
89427d67
...
...
@@ -140,18 +140,21 @@ void main() {
await
_createAndAnalyzeProject
(
projectDir
,
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
],
<
String
>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'flutter_project.iml'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'ios/Runner/AppDelegate.m'
,
'ios/Runner/GeneratedPluginRegistrant.h'
,
],
unexpectedPaths:
<
String
>[
'.android/'
,
'.ios/'
,
]);
'-i'
,
'objc'
,
'-a'
,
'java'
,
],
<
String
>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'flutter_project.iml'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'ios/Runner/AppDelegate.m'
,
'ios/Runner/GeneratedPluginRegistrant.h'
,
],
unexpectedPaths:
<
String
>[
'.android/'
,
'.ios/'
,
],
);
},
timeout:
allowForRemotePubInvocation
);
testUsingContext
(
'detects and recreates an app project correctly'
,
()
async
{
...
...
@@ -160,18 +163,21 @@ void main() {
await
_createAndAnalyzeProject
(
projectDir
,
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
],
<
String
>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'flutter_project.iml'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'ios/Runner/AppDelegate.m'
,
'ios/Runner/GeneratedPluginRegistrant.h'
,
],
unexpectedPaths:
<
String
>[
'.android/'
,
'.ios/'
,
]);
'-i'
,
'objc'
,
'-a'
,
'java'
,
],
<
String
>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'flutter_project.iml'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'ios/Runner/AppDelegate.m'
,
'ios/Runner/GeneratedPluginRegistrant.h'
,
],
unexpectedPaths:
<
String
>[
'.android/'
,
'.ios/'
,
],
);
},
timeout:
allowForRemotePubInvocation
);
testUsingContext
(
'detects and recreates a plugin project correctly'
,
()
async
{
...
...
@@ -180,8 +186,9 @@ void main() {
return
_createAndAnalyzeProject
(
projectDir
,
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
],
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
,
],
<
String
>[
'android/src/main/java/com/example/flutter_project/FlutterProjectPlugin.java'
,
'example/android/app/src/main/java/com/example/flutter_project_example/MainActivity.java'
,
'example/ios/Runner/AppDelegate.h'
,
...
...
@@ -921,7 +928,7 @@ void main() {
'--template=app'
,
'--org'
,
'com.bar.foo'
,
'-i'
,
'objc'
,
'-a'
,
'java'
'-a'
,
'java'
,
],
<
String
>[],
);
...
...
packages/flutter_tools/test/general.shard/commands/test_test.dart
View file @
89427d67
...
...
@@ -243,7 +243,7 @@ Future<ProcessResult> _runFlutterTest(
'test'
,
'--no-color'
,
...
extraArguments
,
testPath
testPath
,
];
while
(
_testExclusionLock
!=
null
)
{
...
...
packages/flutter_tools/test/general.shard/flutter_platform_test.dart
View file @
89427d67
...
...
@@ -88,14 +88,14 @@ void main() {
expect
(()
=>
installHook
(
shellPath:
'abc'
,
enableObservatory:
false
,
startPaused:
true
startPaused:
true
,
),
throwsA
(
isA
<
AssertionError
>()));
expect
(()
=>
installHook
(
shellPath:
'abc'
,
enableObservatory:
false
,
startPaused:
false
,
observatoryPort:
123
observatoryPort:
123
,
),
throwsA
(
isA
<
AssertionError
>()));
FlutterPlatform
capturedPlatform
;
...
...
packages/flutter_tools/test/general.shard/forbidden_imports_test.dart
View file @
89427d67
...
...
@@ -12,7 +12,7 @@ void main() {
test
(
'no imports of commands/* or test/* in lib/src/*'
,
()
{
final
List
<
String
>
skippedPaths
=
<
String
>
[
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'commands'
),
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
)
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
)
,
];
bool
_isNotSkipped
(
FileSystemEntity
entity
)
=>
skippedPaths
.
every
((
String
path
)
=>
!
entity
.
path
.
startsWith
(
path
));
...
...
packages/flutter_tools/test/general.shard/hot_test.dart
View file @
89427d67
...
...
@@ -290,7 +290,7 @@ void main() {
device:
mockDevice
,
generator:
residentCompiler
,
exception:
const
HttpException
(
'Connection closed before full header was received, '
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
];
...
...
@@ -319,7 +319,7 @@ void main() {
TestFlutterDevice
(
device:
mockDevice
,
generator:
residentCompiler
,
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
];
...
...
@@ -353,7 +353,7 @@ class TestFlutterDevice extends FlutterDevice {
TestFlutterDevice
({
@required
Device
device
,
@required
this
.
exception
,
@required
ResidentCompiler
generator
@required
ResidentCompiler
generator
,
})
:
assert
(
exception
!=
null
),
super
(
device
,
buildMode:
BuildMode
.
debug
,
generator:
generator
,
trackWidgetCreation:
false
);
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
89427d67
...
...
@@ -65,8 +65,8 @@ void main() {
for
(
Platform
platform
in
unsupportedPlatforms
)
{
testUsingContext
(
'throws UnsupportedError exception if instantiated on
${platform.operatingSystem}
'
,
()
{
expect
(
()
{
IOSDevice
(
'device-123'
);
},
throwsA
(
isInstanceOf
<
AssertionError
>())
()
{
IOSDevice
(
'device-123'
);
},
throwsA
(
isInstanceOf
<
AssertionError
>()),
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
platform
,
...
...
@@ -95,7 +95,7 @@ void main() {
// const String appId = '789';
const
MapEntry
<
String
,
String
>
libraryEntry
=
MapEntry
<
String
,
String
>(
'DYLD_LIBRARY_PATH'
,
'/path/to/libraries'
'/path/to/libraries'
,
);
final
Map
<
String
,
String
>
env
=
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
libraryEntry
]
...
...
@@ -149,7 +149,7 @@ void main() {
when
(
mockProcessManager
.
run
(
installArgs
,
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
env
environment:
env
,
)).
thenAnswer
(
(
_
)
=>
Future
<
ProcessResult
>.
value
(
ProcessResult
(
1
,
0
,
''
,
''
))
);
...
...
@@ -381,8 +381,8 @@ void main() {
const
String
installerPath
=
'/path/to/ideviceinstaller'
;
const
String
appId
=
'789'
;
const
MapEntry
<
String
,
String
>
libraryEntry
=
MapEntry
<
String
,
String
>(
'DYLD_LIBRARY_PATH'
,
'/path/to/libraries'
'DYLD_LIBRARY_PATH'
,
'/path/to/libraries'
,
);
final
Map
<
String
,
String
>
env
=
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
libraryEntry
]
...
...
packages/flutter_tools/test/general.shard/ios/mac_test.dart
View file @
89427d67
...
...
@@ -56,7 +56,7 @@ void main() {
testUsingContext
(
'isWorking returns false if libimobiledevice is not installed'
,
()
async
{
when
(
mockProcessManager
.
runSync
(
<
String
>[
ideviceIdPath
,
'-h'
],
environment:
anyNamed
(
'environment'
)
<
String
>[
ideviceIdPath
,
'-h'
],
environment:
anyNamed
(
'environment'
)
,
)).
thenReturn
(
ProcessResult
(
123
,
1
,
''
,
''
));
expect
(
await
iMobileDevice
.
isWorking
,
false
);
},
overrides:
<
Type
,
Generator
>{
...
...
packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart
View file @
89427d67
...
...
@@ -96,7 +96,7 @@ void main() {
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
ValidationMessage
(
'clang++ 4.0.1'
),
ValidationMessage
.
error
(
'make is not installed'
)
ValidationMessage
.
error
(
'make is not installed'
)
,
]);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
processManager
,
...
...
packages/flutter_tools/test/general.shard/macos/xcode_test.dart
View file @
89427d67
...
...
@@ -113,7 +113,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'isInstalledAndMeetsVersionCheck is false when no xcode-select'
,
()
{
...
...
@@ -130,7 +130,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'isInstalledAndMeetsVersionCheck is false when version not satisfied'
,
()
{
...
...
@@ -147,7 +147,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied'
,
()
{
...
...
@@ -164,7 +164,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'eulaSigned is false when clang is not installed'
,
()
{
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
89427d67
...
...
@@ -93,7 +93,7 @@ void main() {
when
(
mockFlutterDevice
.
connect
(
reloadSources:
anyNamed
(
'reloadSources'
),
restart:
anyNamed
(
'restart'
),
compileExpression:
anyNamed
(
'compileExpression'
)
compileExpression:
anyNamed
(
'compileExpression'
)
,
)).
thenAnswer
((
Invocation
invocation
)
async
{
});
when
(
mockFlutterDevice
.
setupDevFS
(
any
,
any
,
packagesFilePath:
anyNamed
(
'packagesFilePath'
)))
.
thenAnswer
((
Invocation
invocation
)
async
{
...
...
@@ -223,7 +223,7 @@ void main() {
expect
(
verify
(
flutterUsage
.
sendEvent
(
'hot'
,
'reload'
,
parameters:
captureAnyNamed
(
'parameters'
))).
captured
[
0
],
containsPair
(
cdKey
(
CustomDimensions
.
hotEventTargetPlatform
),
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
,
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockUsage
(),
...
...
@@ -253,7 +253,7 @@ void main() {
expect
(
verify
(
flutterUsage
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
captureAnyNamed
(
'parameters'
))).
captured
[
0
],
containsPair
(
cdKey
(
CustomDimensions
.
hotEventTargetPlatform
),
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
,
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockUsage
(),
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
89427d67
...
...
@@ -155,7 +155,10 @@ void main() {
expect
(
result
.
code
,
0
);
// ensure that analytics are sent.
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
,
})).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockFlutterUsage
(),
...
...
@@ -179,7 +182,10 @@ void main() {
expect
(
result
.
code
,
0
);
// ensure that analytics are sent.
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
,
})).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockFlutterUsage
(),
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart
View file @
89427d67
...
...
@@ -149,7 +149,7 @@ void main() {
'flutter'
,
'dummy'
,
const
Duration
(
milliseconds:
1000
),
null
null
,
],
);
},
...
...
packages/flutter_tools/test/general.shard/runner/runner_test.dart
View file @
89427d67
...
...
@@ -134,13 +134,18 @@ class CrashingUsage implements Usage {
_impl
.
sendCommand
(
command
,
parameters:
parameters
);
@override
void
sendEvent
(
String
category
,
String
parameter
,
{
Map
<
String
,
String
>
parameters
void
sendEvent
(
String
category
,
String
parameter
,
{
Map
<
String
,
String
>
parameters
,
})
=>
_impl
.
sendEvent
(
category
,
parameter
,
parameters:
parameters
);
@override
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
,
{
String
label
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
,
{
String
label
,
})
=>
_impl
.
sendTiming
(
category
,
variableName
,
duration
,
label:
label
);
@override
...
...
packages/flutter_tools/test/general.shard/web/chrome_test.dart
View file @
89427d67
...
...
@@ -55,7 +55,7 @@ void main() {
'--no-default-browser-check'
,
'--disable-default-apps'
,
'--disable-translate'
,
'example_url'
'example_url'
,
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
FakeProcess
(
exitCode:
Completer
<
int
>().
future
,
...
...
packages/flutter_tools/test/general.shard/web/web_fs_test.dart
View file @
89427d67
...
...
@@ -81,7 +81,7 @@ void main() {
bool
enableDebugExtension
})
async
{
return
mockDwds
;
},
}
}
,
);
});
...
...
packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart
View file @
89427d67
...
...
@@ -43,7 +43,7 @@ void main() {
'isPrerelease'
:
false
,
'catalog'
:
<
String
,
dynamic
>{
'productDisplayVersion'
:
'15.9.12'
,
}
}
,
};
// A version of a response that doesn't include certain installation status
...
...
@@ -54,7 +54,7 @@ void main() {
'installationVersion'
:
'15.9.28307.665'
,
'catalog'
:
<
String
,
dynamic
>{
'productDisplayVersion'
:
'15.9.12'
,
}
}
,
};
// Arguments for a vswhere query to search for an installation with the required components.
...
...
packages/flutter_tools/test/general.shard/windows/visual_studio_validator_test.dart
View file @
89427d67
...
...
@@ -112,7 +112,7 @@ void main() {
final
ValidationMessage
expectedMessage
=
ValidationMessage
.
error
(
userMessages
.
visualStudioMissing
(
visualStudio
.
workloadDescription
,
visualStudio
.
necessaryComponentDescriptions
(
validator
.
majorVersion
)
visualStudio
.
necessaryComponentDescriptions
(
validator
.
majorVersion
)
,
)
);
expect
(
result
.
messages
.
contains
(
expectedMessage
),
true
);
...
...
packages/flutter_tools/test/src/mocks.dart
View file @
89427d67
...
...
@@ -40,7 +40,7 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
versionCode:
1
,
launchActivity:
'io.flutter.android.mock.MockActivity'
,
),
iOS:
BuildableIOSApp
(
MockIosProject
(),
MockIosProject
.
bundleId
)
iOS:
BuildableIOSApp
(
MockIosProject
(),
MockIosProject
.
bundleId
)
,
);
}
...
...
packages/flutter_tools/test/src/testbed.dart
View file @
89427d67
...
...
@@ -34,7 +34,7 @@ final Map<Type, Generator> _testbedDefaults = <Type, Generator>{
OperatingSystemUtils:
()
=>
FakeOperatingSystemUtils
(),
OutputPreferences:
()
=>
OutputPreferences
(
showColor:
false
),
// configures BufferLogger to avoid color codes.
Usage:
()
=>
NoOpUsage
(),
// prevent addition of analytics from burdening test mocks
FlutterVersion:
()
=>
FakeFlutterVersion
()
// prevent requirement to mock git for test runner.
FlutterVersion:
()
=>
FakeFlutterVersion
()
,
// prevent requirement to mock git for test runner.
};
/// Manages interaction with the tool injection and runner system.
...
...
@@ -110,7 +110,7 @@ class Testbed {
final
Timer
result
=
parent
.
createPeriodicTimer
(
zone
,
period
,
timer
);
timers
[
result
]
=
StackTrace
.
current
;
return
result
;
}
}
,
),
body:
()
async
{
Cache
.
flutterRoot
=
''
;
...
...
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