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
83986acb
Unverified
Commit
83986acb
authored
Jun 04, 2019
by
Jonah Williams
Committed by
GitHub
Jun 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a real-er web restart, doctor, workflow (#33786)
parent
6d554827
Changes
57
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
841 additions
and
170 deletions
+841
-170
pubspec.yaml
dev/automated_tests/pubspec.yaml
+2
-2
pubspec.yaml
dev/benchmarks/complex_layout/pubspec.yaml
+2
-2
pubspec.yaml
dev/benchmarks/macrobenchmarks/pubspec.yaml
+2
-2
pubspec.yaml
dev/benchmarks/microbenchmarks/pubspec.yaml
+2
-2
pubspec.yaml
dev/bots/pubspec.yaml
+3
-3
linux_chrome_dev_mode.dart
dev/devicelab/bin/tasks/linux_chrome_dev_mode.dart
+10
-0
macos_chrome_dev_mode.dart
dev/devicelab/bin/tasks/macos_chrome_dev_mode.dart
+10
-0
windows_chrome_dev_mode.dart
dev/devicelab/bin/tasks/windows_chrome_dev_mode.dart
+10
-0
web_dev_mode_tests.dart
dev/devicelab/lib/tasks/web_dev_mode_tests.dart
+142
-0
manifest.yaml
dev/devicelab/manifest.yaml
+21
-0
pubspec.yaml
dev/devicelab/pubspec.yaml
+3
-3
pubspec.yaml
dev/integration_tests/android_semantics_testing/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/android_views/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/channels/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/codegen/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/external_ui/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/flavors/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/image_loading/pubspec.yaml
+3
-3
pubspec.yaml
dev/integration_tests/platform_interaction/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/simple_codegen/pubspec.yaml
+2
-2
pubspec.yaml
dev/integration_tests/ui/pubspec.yaml
+3
-3
pubspec.yaml
dev/manual_tests/pubspec.yaml
+2
-2
pubspec.yaml
dev/snippets/pubspec.yaml
+2
-2
pubspec.yaml
dev/tools/gen_keycodes/pubspec.yaml
+2
-2
pubspec.yaml
dev/tools/pubspec.yaml
+3
-3
pubspec.yaml
dev/tools/vitool/pubspec.yaml
+2
-2
pubspec.yaml
examples/catalog/pubspec.yaml
+2
-2
pubspec.yaml
examples/flutter_gallery/pubspec.yaml
+4
-4
pubspec.yaml
examples/platform_channel/pubspec.yaml
+2
-2
pubspec.yaml
examples/stocks/pubspec.yaml
+2
-2
pubspec.yaml
packages/flutter/pubspec.yaml
+2
-2
pubspec.yaml
packages/flutter_driver/pubspec.yaml
+2
-2
pubspec.yaml
packages/flutter_goldens/pubspec.yaml
+2
-2
pubspec.yaml
packages/flutter_localizations/pubspec.yaml
+2
-2
BUILD.gn
packages/flutter_tools/BUILD.gn
+6
-0
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+2
-2
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+2
-2
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+5
-5
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+1
-1
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+13
-1
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+3
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+1
-0
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+7
-0
project.dart
packages/flutter_tools/lib/src/project.dart
+2
-2
resident_web_runner.dart
packages/flutter_tools/lib/src/resident_web_runner.dart
+53
-21
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
asset_server.dart
packages/flutter_tools/lib/src/web/asset_server.dart
+0
-1
chrome.dart
packages/flutter_tools/lib/src/web/chrome.dart
+182
-0
web_device.dart
packages/flutter_tools/lib/src/web/web_device.dart
+14
-59
web_validator.dart
packages/flutter_tools/lib/src/web/web_validator.dart
+37
-0
workflow.dart
packages/flutter_tools/lib/src/web/workflow.dart
+51
-0
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+7
-6
run_test.dart
packages/flutter_tools/test/commands/run_test.dart
+1
-1
devices_test.dart
packages/flutter_tools/test/web/devices_test.dart
+1
-0
web_validator_test.dart
packages/flutter_tools/test/web/web_validator_test.dart
+52
-0
workflow_test.dart
packages/flutter_tools/test/web/workflow_test.dart
+140
-0
pubspec.yaml
packages/fuchsia_remote_debug_protocol/pubspec.yaml
+2
-2
No files found.
dev/automated_tests/pubspec.yaml
View file @
83986acb
...
...
@@ -12,7 +12,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -65,4 +65,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
5cc4
# PUBSPEC CHECKSUM:
f3c5
dev/benchmarks/complex_layout/pubspec.yaml
View file @
83986acb
...
...
@@ -43,7 +43,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.16.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end
:
0.1.18
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -82,4 +82,4 @@ flutter:
-
packages/flutter_gallery_assets/people/square/ali.png
-
packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png
# PUBSPEC CHECKSUM: f69
9
# PUBSPEC CHECKSUM: f69
a
dev/benchmarks/macrobenchmarks/pubspec.yaml
View file @
83986acb
...
...
@@ -43,7 +43,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.16.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end
:
0.1.18
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -79,4 +79,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM: f69
9
# PUBSPEC CHECKSUM: f69
a
dev/benchmarks/microbenchmarks/pubspec.yaml
View file @
83986acb
...
...
@@ -16,7 +16,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -73,4 +73,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
ce27
# PUBSPEC CHECKSUM:
1128
dev/bots/pubspec.yaml
View file @
83986acb
...
...
@@ -7,7 +7,7 @@ environment:
dependencies
:
path
:
1.6.2
args
:
1.5.
1
args
:
1.5.
2
meta
:
1.1.6
process
:
3.0.9
platform
:
2.2.0
...
...
@@ -64,7 +64,7 @@ dependencies:
yaml
:
2.1.15
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
mockito
:
4.
0
.0
mockito
:
4.
1
.0
test_api
:
0.2.5
# PUBSPEC CHECKSUM:
7f9d
# PUBSPEC CHECKSUM:
ee9f
dev/devicelab/bin/tasks/linux_chrome_dev_mode.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/web_dev_mode_tests.dart'
;
Future
<
void
>
main
()
async
{
await
task
(
createWebDevModeTest
());
}
dev/devicelab/bin/tasks/macos_chrome_dev_mode.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/web_dev_mode_tests.dart'
;
Future
<
void
>
main
()
async
{
await
task
(
createWebDevModeTest
());
}
dev/devicelab/bin/tasks/windows_chrome_dev_mode.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/web_dev_mode_tests.dart'
;
Future
<
void
>
main
()
async
{
await
task
(
createWebDevModeTest
());
}
dev/devicelab/lib/tasks/web_dev_mode_tests.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
import
'../framework/framework.dart'
;
import
'../framework/utils.dart'
;
final
Directory
_editedFlutterGalleryDir
=
dir
(
path
.
join
(
Directory
.
systemTemp
.
path
,
'edited_flutter_gallery'
));
final
Directory
flutterGalleryDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'examples/flutter_gallery'
));
TaskFunction
createWebDevModeTest
(
)
{
return
()
async
{
final
List
<
String
>
options
=
<
String
>[
'--hot'
,
'-d'
,
'web'
,
'--verbose'
,
'--resident'
,
'--target=lib/main_web.dart'
,
];
setLocalEngineOptionIfNecessary
(
options
);
int
hotRestartCount
=
0
;
await
inDirectory
<
void
>(
flutterDirectory
,
()
async
{
rmTree
(
_editedFlutterGalleryDir
);
mkdirs
(
_editedFlutterGalleryDir
);
recursiveCopy
(
flutterGalleryDir
,
_editedFlutterGalleryDir
);
await
inDirectory
<
void
>(
_editedFlutterGalleryDir
,
()
async
{
{
final
Process
packagesGet
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'packages'
,
'get'
],
environment:
<
String
,
String
>{
'FLUTTER_WEB'
:
'true'
,
},
);
await
packagesGet
.
exitCode
;
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
]..
addAll
(
options
),
environment:
<
String
,
String
>{
'FLUTTER_WEB'
:
'true'
,
},
);
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
.
listen
((
String
line
)
{
if
(
line
.
contains
(
'To hot restart'
))
{
process
.
stdin
.
write
(
'R'
);
}
if
(
line
.
contains
(
'Restarted'
))
{
if
(
hotRestartCount
==
0
)
{
// Update the file and reload again.
final
File
appDartSource
=
file
(
path
.
join
(
_editedFlutterGalleryDir
.
path
,
'lib/gallery/app.dart'
,
));
appDartSource
.
writeAsStringSync
(
appDartSource
.
readAsStringSync
().
replaceFirst
(
"'Flutter Gallery'"
,
"'Updated Flutter Gallery'"
,
)
);
process
.
stdin
.
writeln
(
'R'
);
++
hotRestartCount
;
}
else
{
// Quit after second hot restart.
process
.
stdin
.
writeln
(
'q'
);
}
}
print
(
'stdout:
$line
'
);
},
onDone:
()
{
stdoutDone
.
complete
();
});
process
.
stderr
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
.
listen
((
String
line
)
{
print
(
'stderr:
$line
'
);
},
onDone:
()
{
stderrDone
.
complete
();
});
await
Future
.
wait
<
void
>(<
Future
<
void
>>[
stdoutDone
.
future
,
stderrDone
.
future
,
]);
await
process
.
exitCode
;
}
// Start `flutter run` again to make sure it loads from the previous
// state. dev compilers loads up from previously compiled JavaScript.
{
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
]..
addAll
(
options
),
environment:
<
String
,
String
>{
'FLUTTER_WEB'
:
'true'
,
},
);
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
.
listen
((
String
line
)
{
if
(
line
.
contains
(
'To hot restart'
))
{
process
.
stdin
.
write
(
'R'
);
}
if
(
line
.
contains
(
'Restarted'
))
{
process
.
stdin
.
writeln
(
'q'
);
}
print
(
'stdout:
$line
'
);
},
onDone:
()
{
stdoutDone
.
complete
();
});
process
.
stderr
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
.
listen
((
String
line
)
{
print
(
'stderr:
$line
'
);
},
onDone:
()
{
stderrDone
.
complete
();
});
await
Future
.
wait
<
void
>(<
Future
<
void
>>[
stdoutDone
.
future
,
stderrDone
.
future
,
]);
await
process
.
exitCode
;
}
});
});
if
(
hotRestartCount
!=
1
)
{
return
TaskResult
.
failure
(
null
);
}
return
TaskResult
.
success
(
null
);
};
}
dev/devicelab/manifest.yaml
View file @
83986acb
...
...
@@ -125,6 +125,13 @@ tasks:
stage
:
devicelab_win
required_agent_capabilities
:
[
"
windows/android"
]
windows_chrome_dev_mode
:
description
:
>
Run flutter web on the devicelab and hot restart.
stage
:
devicelab_win
required_agent_capabilities
:
[
"
windows/android"
]
flaky
:
true
# Android on-device tests
complex_layout_scroll_perf__timeline_summary
:
...
...
@@ -324,6 +331,13 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
linux_chrome_dev_mode
:
description
:
>
Run flutter web on the devicelab and hot restart.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
# iOS on-device tests
flavors_test_ios
:
...
...
@@ -421,6 +435,13 @@ tasks:
stage
:
devicelab_ios
required_agent_capabilities
:
[
"
mac/ios"
]
macos_chrome_dev_mode
:
description
:
>
Run flutter web on the devicelab and hot restart.
stage
:
devicelab_ios
required_agent_capabilities
:
[
"
mac/ios"
]
flaky
:
true
# Tests running on Windows host
flavors_test_win
:
...
...
dev/devicelab/pubspec.yaml
View file @
83986acb
...
...
@@ -8,9 +8,9 @@ environment:
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
dependencies
:
args
:
1.5.
1
args
:
1.5.
2
file
:
5.0.8
image
:
2.1.
3
image
:
2.1.
4
meta
:
1.1.6
path
:
1.6.2
platform
:
2.2.0
...
...
@@ -73,4 +73,4 @@ dev_dependencies:
watcher
:
0.9.7+10
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml
:
2.1.15
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
b018
# PUBSPEC CHECKSUM:
491a
dev/integration_tests/android_semantics_testing/pubspec.yaml
View file @
83986acb
...
...
@@ -9,7 +9,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -63,4 +63,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
d60e
# PUBSPEC CHECKSUM:
820f
dev/integration_tests/android_views/pubspec.yaml
View file @
83986acb
...
...
@@ -40,7 +40,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.16.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end
:
0.1.18
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -76,4 +76,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
10be
# PUBSPEC CHECKSUM:
fdbf
dev/integration_tests/channels/pubspec.yaml
View file @
83986acb
...
...
@@ -13,7 +13,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -67,4 +67,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
d60e
# PUBSPEC CHECKSUM:
820f
dev/integration_tests/codegen/pubspec.yaml
View file @
83986acb
...
...
@@ -35,7 +35,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.16.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end
:
0.1.18
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -74,4 +74,4 @@ builders:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
d60e
# PUBSPEC CHECKSUM:
820f
dev/integration_tests/external_ui/pubspec.yaml
View file @
83986acb
...
...
@@ -13,7 +13,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -67,4 +67,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
d60e
# PUBSPEC CHECKSUM:
820f
dev/integration_tests/flavors/pubspec.yaml
View file @
83986acb
...
...
@@ -13,7 +13,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -67,4 +67,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
d60e
# PUBSPEC CHECKSUM:
820f
dev/integration_tests/image_loading/pubspec.yaml
View file @
83986acb
...
...
@@ -5,10 +5,10 @@ dependencies:
flutter
:
sdk
:
flutter
test
:
1.6.3
mockito
:
4.
0
.0
mockito
:
4.
1
.0
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -60,4 +60,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
bf1e
# PUBSPEC CHECKSUM:
8420
dev/integration_tests/platform_interaction/pubspec.yaml
View file @
83986acb
...
...
@@ -13,7 +13,7 @@ dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -67,4 +67,4 @@ dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
d60e
# PUBSPEC CHECKSUM:
820f
dev/integration_tests/simple_codegen/pubspec.yaml
View file @
83986acb
...
...
@@ -5,7 +5,7 @@ dependencies:
build
:
1.1.4
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection
:
1.14.11
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -32,4 +32,4 @@ environment:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
# PUBSPEC CHECKSUM:
669a
# PUBSPEC CHECKSUM:
069b
dev/integration_tests/ui/pubspec.yaml
View file @
83986acb
...
...
@@ -6,7 +6,7 @@ environment:
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
dependencies
:
image
:
2.1.
3
image
:
2.1.
4
flutter
:
sdk
:
flutter
flutter_driver
:
...
...
@@ -15,7 +15,7 @@ dependencies:
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
archive
:
2.0.9
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -77,4 +77,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
1b28
# PUBSPEC CHECKSUM:
772a
dev/manual_tests/pubspec.yaml
View file @
83986acb
...
...
@@ -17,7 +17,7 @@ dev_dependencies:
flutter_test
:
sdk
:
flutter
mockito
:
4.
0
.0
mockito
:
4.
1
.0
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -36,4 +36,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
949f
# PUBSPEC CHECKSUM:
0ba0
dev/snippets/pubspec.yaml
View file @
83986acb
...
...
@@ -13,7 +13,7 @@ dartdoc:
nodoc
:
true
dependencies
:
args
:
1.5.
1
args
:
1.5.
2
dart_style
:
1.2.7
meta
:
1.1.6
platform
:
2.2.0
...
...
@@ -98,4 +98,4 @@ executables:
vm_service_client
:
0.2.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
web_socket_channel
:
1.0.9
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
6b2c
# PUBSPEC CHECKSUM:
052d
dev/tools/gen_keycodes/pubspec.yaml
View file @
83986acb
...
...
@@ -6,7 +6,7 @@ environment:
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
dependencies
:
args
:
1.5.
1
args
:
1.5.
2
http
:
0.12.0+2
path
:
1.6.2
platform
:
2.2.0
...
...
@@ -22,4 +22,4 @@ dependencies:
term_glyph
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
typed_data
:
1.1.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
8bd3
# PUBSPEC CHECKSUM:
24d4
dev/tools/pubspec.yaml
View file @
83986acb
...
...
@@ -7,7 +7,7 @@ environment:
dependencies
:
archive
:
2.0.9
args
:
1.5.
1
args
:
1.5.
2
http
:
0.12.0+2
intl
:
0.15.8
meta
:
1.1.6
...
...
@@ -30,11 +30,11 @@ dependencies:
dev_dependencies
:
test_api
:
0.2.5
mockito
:
4.
0
.0
mockito
:
4.
1
.0
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
matcher
:
0.12.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
stack_trace
:
1.9.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
stream_channel
:
2.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
470f
# PUBSPEC CHECKSUM:
a711
dev/tools/vitool/pubspec.yaml
View file @
83986acb
...
...
@@ -9,7 +9,7 @@ environment:
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
dependencies
:
args
:
1.5.
1
args
:
1.5.
2
vector_math
:
2.0.8
xml
:
3.5.0
...
...
@@ -37,4 +37,4 @@ dev_dependencies:
term_glyph
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
test_api
:
0.2.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
b74d
# PUBSPEC CHECKSUM:
3d4e
examples/catalog/pubspec.yaml
View file @
83986acb
...
...
@@ -23,7 +23,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -73,4 +73,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
5ff8
# PUBSPEC CHECKSUM:
25f9
examples/flutter_gallery/pubspec.yaml
View file @
83986acb
...
...
@@ -12,9 +12,9 @@ dependencies:
intl
:
0.15.8
connectivity
:
0.4.3+2
string_scanner
:
1.0.4
url_launcher
:
5.0.
2
url_launcher
:
5.0.
3
cupertino_icons
:
0.1.2
video_player
:
0.10.1+
2
video_player
:
0.10.1+
3
scoped_model
:
1.0.1
shrine_images
:
1.1.2
...
...
@@ -39,7 +39,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
convert
:
2.1.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -253,4 +253,4 @@ flutter:
-
asset
:
packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf
-
asset
:
packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf
# PUBSPEC CHECKSUM:
8760
# PUBSPEC CHECKSUM:
7863
examples/platform_channel/pubspec.yaml
View file @
83986acb
...
...
@@ -21,7 +21,7 @@ dev_dependencies:
test
:
1.6.3
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -72,4 +72,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM:
5ff8
# PUBSPEC CHECKSUM:
25f9
examples/stocks/pubspec.yaml
View file @
83986acb
...
...
@@ -15,7 +15,7 @@ dependencies:
isolate
:
2.0.2
analyzer
:
0.36.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.
2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection
:
1.14.11
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -62,4 +62,4 @@ dev_dependencies:
flutter
:
uses-material-design
:
true
# PUBSPEC CHECKSUM: 6
3b7
# PUBSPEC CHECKSUM: 6
9b8
packages/flutter/pubspec.yaml
View file @
83986acb
...
...
@@ -22,7 +22,7 @@ dev_dependencies:
sdk
:
flutter
flutter_goldens
:
sdk
:
flutter
mockito
:
4.
0
.0
mockito
:
4.
1
.0
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -42,4 +42,4 @@ dev_dependencies:
term_glyph
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
test_api
:
0.2.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
94dc
# PUBSPEC CHECKSUM:
45dd
packages/flutter_driver/pubspec.yaml
View file @
83986acb
...
...
@@ -43,7 +43,7 @@ dependencies:
vector_math
:
2.0.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
mockito
:
4.
0
.0
mockito
:
4.
1
.0
quiver
:
2.0.3
# PUBSPEC CHECKSUM:
b48d
# PUBSPEC CHECKSUM:
ef8e
packages/flutter_goldens/pubspec.yaml
View file @
83986acb
...
...
@@ -33,6 +33,6 @@ dependencies:
vector_math
:
2.0.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
mockito
:
4.
0
.0
mockito
:
4.
1
.0
# PUBSPEC CHECKSUM:
046a
# PUBSPEC CHECKSUM:
926b
packages/flutter_localizations/pubspec.yaml
View file @
83986acb
...
...
@@ -20,7 +20,7 @@ dependencies:
dev_dependencies
:
flutter_test
:
sdk
:
flutter
mockito
:
4.
0
.0
mockito
:
4.
1
.0
async
:
2.2.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -35,4 +35,4 @@ dev_dependencies:
term_glyph
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
test_api
:
0.2.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM:
4ddd
# PUBSPEC CHECKSUM:
c3de
packages/flutter_tools/BUILD.gn
View file @
83986acb
...
...
@@ -31,6 +31,8 @@ dart_library("flutter_tools") {
"//third_party/dart-pkg/pub/json_schema",
"//third_party/dart-pkg/pub/linter",
"//third_party/dart-pkg/pub/meta",
"//third_party/dart-pkg/pub/mime",
"//third_party/dart-pkg/pub/multi_server_socket",
"//third_party/dart-pkg/pub/multicast_dns",
"//third_party/dart-pkg/pub/mustache",
"//third_party/dart-pkg/pub/package_config",
...
...
@@ -38,12 +40,16 @@ dart_library("flutter_tools") {
"//third_party/dart-pkg/pub/platform",
"//third_party/dart-pkg/pub/process",
"//third_party/dart-pkg/pub/quiver",
"//third_party/dart-pkg/pub/shelf_packages_handler",
"//third_party/dart-pkg/pub/shelf_static",
"//third_party/dart-pkg/pub/stack_trace",
"//third_party/dart-pkg/pub/test",
"//third_party/dart-pkg/pub/usage",
"//third_party/dart-pkg/pub/web_socket_channel",
"//third_party/dart-pkg/pub/webkit_inspection_protocol",
"//third_party/dart-pkg/pub/xml",
"//third_party/dart-pkg/pub/yaml",
"//third_party/dart-pkg/pub/node_preamble",
]
}
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
83986acb
...
...
@@ -56,7 +56,7 @@ class ApplicationPackageFactory {
return
applicationBinary
==
null
?
MacOSApp
.
fromMacOSProject
(
FlutterProject
.
current
().
macos
)
:
MacOSApp
.
fromPrebuiltApp
(
applicationBinary
);
case
TargetPlatform
.
web
:
case
TargetPlatform
.
web
_javascript
:
return
WebApplicationPackage
(
FlutterProject
.
current
());
case
TargetPlatform
.
linux_x64
:
return
applicationBinary
==
null
...
...
@@ -411,7 +411,7 @@ class ApplicationPackageStore {
case
TargetPlatform
.
linux_x64
:
case
TargetPlatform
.
windows_x64
:
case
TargetPlatform
.
tester
:
case
TargetPlatform
.
web
:
case
TargetPlatform
.
web
_javascript
:
return
null
;
}
return
null
;
...
...
packages/flutter_tools/lib/src/artifacts.dart
View file @
83986acb
...
...
@@ -136,7 +136,7 @@ class CachedArtifacts extends Artifacts {
case
TargetPlatform
.
windows_x64
:
case
TargetPlatform
.
fuchsia
:
case
TargetPlatform
.
tester
:
case
TargetPlatform
.
web
:
case
TargetPlatform
.
web
_javascript
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
assert
(
false
,
'Invalid platform
$platform
.'
);
...
...
@@ -238,7 +238,7 @@ class CachedArtifacts extends Artifacts {
case
TargetPlatform
.
windows_x64
:
case
TargetPlatform
.
fuchsia
:
case
TargetPlatform
.
tester
:
case
TargetPlatform
.
web
:
case
TargetPlatform
.
web
_javascript
:
assert
(
mode
==
null
,
'Platform
$platform
does not support different build modes.'
);
return
fs
.
path
.
join
(
engineDir
,
platformName
);
case
TargetPlatform
.
ios
:
...
...
packages/flutter_tools/lib/src/build_info.dart
View file @
83986acb
...
...
@@ -243,7 +243,7 @@ enum TargetPlatform {
windows_x64
,
fuchsia
,
tester
,
web
,
web
_javascript
,
}
/// iOS target device architecture.
...
...
@@ -303,8 +303,8 @@ String getNameForTargetPlatform(TargetPlatform platform) {
return
'fuchsia'
;
case
TargetPlatform
.
tester
:
return
'flutter-tester'
;
case
TargetPlatform
.
web
:
return
'web'
;
case
TargetPlatform
.
web
_javascript
:
return
'web
-javascript
'
;
}
assert
(
false
);
return
null
;
...
...
@@ -328,8 +328,8 @@ TargetPlatform getTargetPlatformForName(String platform) {
return
TargetPlatform
.
linux_x64
;
case
'windows-x64'
:
return
TargetPlatform
.
windows_x64
;
case
'web'
:
return
TargetPlatform
.
web
;
case
'web
-javascript
'
:
return
TargetPlatform
.
web
_javascript
;
}
assert
(
platform
!=
null
);
return
null
;
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
83986acb
...
...
@@ -403,7 +403,7 @@ class RunCommand extends RunCommandBase {
// in a "hot mode".
final
bool
webMode
=
!
FlutterVersion
.
instance
.
isStable
&&
devices
.
length
==
1
&&
await
devices
.
single
.
targetPlatform
==
TargetPlatform
.
web
&&
await
devices
.
single
.
targetPlatform
==
TargetPlatform
.
web
_javascript
&&
hotMode
;
ResidentRunner
runner
;
...
...
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
83986acb
...
...
@@ -22,7 +22,10 @@ import '../runner/flutter_command.dart';
const
Map
<
String
,
String
>
_kManuallyPinnedDependencies
=
<
String
,
String
>{
// Add pinned packages here.
'flutter_gallery_assets'
:
'0.1.8'
,
// See //examples/flutter_gallery/pubspec.yaml
'build_daemon'
:
'0.6.1'
,
'build_daemon'
:
'0.6.1'
,
// Crashes at 1.0
'test'
:
'1.6.3'
,
// | Tests are timing out at 1.6.4 https://github.com/flutter/flutter/issues/33823
'test_api'
:
'0.2.5'
,
// |
'test_core'
:
'0.2.5'
// |
};
class
UpdatePackagesCommand
extends
FlutterCommand
{
...
...
@@ -1106,7 +1109,16 @@ String _generateFakePubspec(Iterable<PubspecDependency> dependencies) {
overrides
.
writeln
(
'dependency_overrides:'
);
if
(
_kManuallyPinnedDependencies
.
isNotEmpty
)
{
printStatus
(
'WARNING: the following packages use hard-coded version constraints:'
);
final
Set
<
String
>
allTransitive
=
<
String
>{
for
(
PubspecDependency
dependency
in
dependencies
)
dependency
.
name
};
for
(
String
package
in
_kManuallyPinnedDependencies
.
keys
)
{
// Don't add pinned dependency if it is not in the set of all transitive dependencies.
if
(!
allTransitive
.
contains
(
package
))
{
printStatus
(
'Skipping
$package
because it was not transitive'
);
continue
;
}
final
String
version
=
_kManuallyPinnedDependencies
[
package
];
result
.
writeln
(
'
$package
:
$version
'
);
printStatus
(
' -
$package
:
$version
'
);
...
...
packages/flutter_tools/lib/src/context_runner.dart
View file @
83986acb
...
...
@@ -43,8 +43,9 @@ import 'macos/xcode_validator.dart';
import
'run_hot.dart'
;
import
'usage.dart'
;
import
'version.dart'
;
import
'web/chrome.dart'
;
import
'web/compile.dart'
;
import
'web/w
eb_device
.dart'
;
import
'web/w
orkflow
.dart'
;
import
'windows/windows_workflow.dart'
;
Future
<
T
>
runInContext
<
T
>(
...
...
@@ -100,6 +101,7 @@ Future<T> runInContext<T>(
Usage:
()
=>
Usage
(),
UserMessages:
()
=>
UserMessages
(),
WebCompiler:
()
=>
const
WebCompiler
(),
WebWorkflow:
()
=>
const
WebWorkflow
(),
WindowsWorkflow:
()
=>
const
WindowsWorkflow
(),
Xcode:
()
=>
Xcode
(),
XcodeValidator:
()
=>
const
XcodeValidator
(),
...
...
packages/flutter_tools/lib/src/device.dart
View file @
83986acb
...
...
@@ -23,6 +23,7 @@ import 'macos/macos_device.dart';
import
'project.dart'
;
import
'tester/flutter_tester.dart'
;
import
'web/web_device.dart'
;
import
'web/workflow.dart'
;
import
'windows/windows_device.dart'
;
DeviceManager
get
deviceManager
=>
context
.
get
<
DeviceManager
>();
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
83986acb
...
...
@@ -33,6 +33,8 @@ import 'proxy_validator.dart';
import
'tester/flutter_tester.dart'
;
import
'version.dart'
;
import
'vscode/vscode_validator.dart'
;
import
'web/web_validator.dart'
;
import
'web/workflow.dart'
;
import
'windows/windows_workflow.dart'
;
Doctor
get
doctor
=>
context
.
get
<
Doctor
>();
...
...
@@ -66,6 +68,9 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
if
(
iosWorkflow
.
appliesToHostPlatform
)
_validators
.
add
(
iosValidator
);
if
(
webWorkflow
.
appliesToHostPlatform
)
_validators
.
add
(
const
WebValidator
());
final
List
<
DoctorValidator
>
ideValidators
=
<
DoctorValidator
>[];
ideValidators
.
addAll
(
AndroidStudioValidator
.
allValidators
);
ideValidators
.
addAll
(
IntelliJValidator
.
installedValidators
);
...
...
@@ -278,6 +283,8 @@ class Doctor {
/// A series of tools and required install steps for a target platform (iOS or Android).
abstract
class
Workflow
{
const
Workflow
();
/// Whether the workflow applies to this platform (as in, should we ever try and use it).
bool
get
appliesToHostPlatform
;
...
...
packages/flutter_tools/lib/src/project.dart
View file @
83986acb
...
...
@@ -20,7 +20,7 @@ import 'ios/plist_utils.dart' as plist;
import
'ios/xcodeproj.dart'
as
xcode
;
import
'plugins.dart'
;
import
'template.dart'
;
import
'web/w
eb_device
.dart'
;
import
'web/w
orkflow
.dart'
;
/// Represents the contents of a Flutter project at the specified [directory].
///
...
...
@@ -188,7 +188,7 @@ class FlutterProject {
if
(
flutterDesktopEnabled
&&
macos
.
existsSync
())
{
await
macos
.
ensureReadyForPlatformSpecificTooling
();
}
if
(
flutterWebEnabled
)
{
if
(
flutterWebEnabled
&&
web
.
existsSync
()
)
{
await
web
.
ensureReadyForPlatformSpecificTooling
();
}
await
injectPlugins
(
this
,
checkProjects:
checkProjects
);
...
...
packages/flutter_tools/lib/src/resident_web_runner.dart
View file @
83986acb
...
...
@@ -5,11 +5,14 @@
import
'dart:async'
;
import
'package:meta/meta.dart'
;
import
'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
;
import
'asset.dart'
;
import
'base/common.dart'
;
import
'base/file_system.dart'
;
import
'base/logger.dart'
;
import
'base/terminal.dart'
;
import
'base/utils.dart'
;
import
'build_info.dart'
;
import
'bundle.dart'
;
import
'dart/package_map.dart'
;
...
...
@@ -19,8 +22,8 @@ import 'project.dart';
import
'resident_runner.dart'
;
import
'run_hot.dart'
;
import
'web/asset_server.dart'
;
import
'web/chrome.dart'
;
import
'web/compile.dart'
;
import
'web/web_device.dart'
;
/// A hot-runner which handles browser specific delegation.
class
ResidentWebRunner
extends
ResidentRunner
{
...
...
@@ -44,6 +47,7 @@ class ResidentWebRunner extends ResidentRunner {
WebAssetServer
_server
;
ProjectFileInvalidator
projectFileInvalidator
;
DateTime
_lastCompiled
;
WipConnection
_connection
;
final
FlutterProject
flutterProject
;
@override
...
...
@@ -58,12 +62,16 @@ class ResidentWebRunner extends ResidentRunner {
}
@override
Future
<
void
>
cleanupAfterSignal
()
{
Future
<
void
>
cleanupAfterSignal
()
async
{
await
_connection
.
sendCommand
(
'Browser.close'
);
_connection
=
null
;
return
_server
?.
dispose
();
}
@override
Future
<
void
>
cleanupAtFinish
()
{
Future
<
void
>
cleanupAtFinish
()
async
{
await
_connection
?.
sendCommand
(
'Browser.close'
);
_connection
=
null
;
return
_server
?.
dispose
();
}
...
...
@@ -128,7 +136,15 @@ class ResidentWebRunner extends ResidentRunner {
await
_server
.
initialize
();
// Step 3: Spawn an instance of Chrome and direct it to the created server.
await
chromeLauncher
.
launch
(
'http:localhost:
${_server.port}
'
);
final
String
url
=
'http://localhost:
${_server.port}
'
;
final
Chrome
chrome
=
await
chromeLauncher
.
launch
(
url
);
final
ChromeTab
chromeTab
=
await
chrome
.
chromeConnection
.
getTab
((
ChromeTab
chromeTab
)
{
return
chromeTab
.
url
.
contains
(
url
);
// we don't care about trailing slashes or #
});
_connection
=
await
chromeTab
.
connect
();
_connection
.
onClose
.
listen
((
WipConnection
connection
)
{
appFinished
();
});
// We don't support the debugging proxy yet.
appStartedCompleter
?.
complete
();
...
...
@@ -139,23 +155,39 @@ class ResidentWebRunner extends ResidentRunner {
}
@override
Future
<
OperationResult
>
restart
(
{
bool
fullRestart
=
false
,
bool
pauseAfterRestart
=
false
,
String
reason
,
bool
benchmarkMode
=
false
})
async
{
final
List
<
Uri
>
invalidatedSources
=
ProjectFileInvalidator
.
findInvalidated
(
lastCompiled:
_lastCompiled
,
urisToMonitor:
<
Uri
>[
for
(
FileSystemEntity
entity
in
flutterProject
.
directory
.
childDirectory
(
'lib'
)
.
listSync
(
recursive:
true
))
if
(
entity
is
File
&&
entity
.
path
.
endsWith
(
'.dart'
))
entity
.
uri
],
// Add new class to track this for web.
packagesPath:
PackageMap
.
globalPackagesPath
,
Future
<
OperationResult
>
restart
({
bool
fullRestart
=
false
,
bool
pauseAfterRestart
=
false
,
String
reason
,
bool
benchmarkMode
=
false
,
})
async
{
final
Stopwatch
timer
=
Stopwatch
()..
start
();
final
Status
status
=
logger
.
startProgress
(
'Performing hot restart...'
,
timeout:
timeoutConfiguration
.
fastOperation
,
progressId:
'hot.restart'
,
);
await
webCompilationProxy
.
invalidate
(
inputs:
invalidatedSources
);
printStatus
(
'Sources updated, refresh browser'
);
return
OperationResult
.
ok
;
OperationResult
result
=
OperationResult
.
ok
;
try
{
final
List
<
Uri
>
invalidatedSources
=
ProjectFileInvalidator
.
findInvalidated
(
lastCompiled:
_lastCompiled
,
urisToMonitor:
<
Uri
>[
for
(
FileSystemEntity
entity
in
flutterProject
.
directory
.
childDirectory
(
'lib'
)
.
listSync
(
recursive:
true
))
if
(
entity
is
File
&&
entity
.
path
.
endsWith
(
'.dart'
))
entity
.
uri
],
// Add new class to track this for web.
packagesPath:
PackageMap
.
globalPackagesPath
,
);
await
webCompilationProxy
.
invalidate
(
inputs:
invalidatedSources
);
await
_connection
.
sendCommand
(
'Page.reload'
);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
150
));
}
catch
(
err
)
{
result
=
OperationResult
(
1
,
err
.
toString
());
}
finally
{
printStatus
(
'Restarted application in
${getElapsedAsMilliseconds(timer.elapsed)}
.'
);
status
.
cancel
();
}
return
result
;
}
}
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
83986acb
...
...
@@ -670,7 +670,7 @@ DevelopmentArtifact _artifactFromTargetPlatform(TargetPlatform targetPlatform) {
case
TargetPlatform
.
android_x64
:
case
TargetPlatform
.
android_x86
:
return
DevelopmentArtifact
.
android
;
case
TargetPlatform
.
web
:
case
TargetPlatform
.
web
_javascript
:
return
DevelopmentArtifact
.
web
;
case
TargetPlatform
.
ios
:
return
DevelopmentArtifact
.
iOS
;
...
...
packages/flutter_tools/lib/src/web/asset_server.dart
View file @
83986acb
...
...
@@ -170,7 +170,6 @@ class WebAssetServer {
Future
<
void
>
_completeRequest
(
HttpRequest
request
,
File
file
,
[
String
contentType
=
'text'
])
async
{
printTrace
(
'looking for
${request.uri}
at
${file.path}
'
);
if
(!
file
.
existsSync
())
{
request
.
response
.
statusCode
=
HttpStatus
.
notFound
;
await
request
.
response
.
close
();
...
...
packages/flutter_tools/lib/src/web/chrome.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
;
import
'../base/common.dart'
;
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/os.dart'
;
import
'../base/platform.dart'
;
import
'../base/process_manager.dart'
;
import
'../convert.dart'
;
import
'../globals.dart'
;
/// The [ChromeLauncher] instance.
ChromeLauncher
get
chromeLauncher
=>
context
.
get
<
ChromeLauncher
>();
/// An environment variable used to override the location of chrome.
const
String
kChromeEnvironment
=
'CHROME_EXECUTABLE'
;
/// The expected executable name on linux.
const
String
kLinuxExecutable
=
'google-chrome'
;
/// The expected executable name on macOS.
const
String
kMacOSExecutable
=
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
;
/// The expected executable name on Windows.
const
String
kWindowsExecutable
=
r'Google\Chrome\Application\chrome.exe'
;
/// The possible locations where the chrome executable can be located on windows.
final
List
<
String
>
kWindowsPrefixes
=
<
String
>[
platform
.
environment
[
'LOCALAPPDATA'
],
platform
.
environment
[
'PROGRAMFILES'
],
platform
.
environment
[
'PROGRAMFILES(X86)'
]
];
/// Find the chrome executable on the current platform.
///
/// Does not verify whether the executable exists.
String
findChromeExecutable
(
)
{
if
(
platform
.
environment
.
containsKey
(
kChromeEnvironment
))
{
return
platform
.
environment
[
kChromeEnvironment
];
}
if
(
platform
.
isLinux
)
{
return
kLinuxExecutable
;
}
if
(
platform
.
isMacOS
)
{
return
kMacOSExecutable
;
}
if
(
platform
.
isWindows
)
{
final
String
windowsPrefix
=
kWindowsPrefixes
.
firstWhere
((
String
prefix
)
{
if
(
prefix
==
null
)
{
return
false
;
}
final
String
path
=
fs
.
path
.
join
(
prefix
,
kWindowsExecutable
);
return
fs
.
file
(
path
).
existsSync
();
},
orElse:
()
=>
'.'
);
return
fs
.
path
.
join
(
windowsPrefix
,
kWindowsExecutable
);
}
throwToolExit
(
'Platform
${platform.operatingSystem}
is not supported.'
);
return
null
;
}
/// Responsible for launching chrome with devtools configured.
class
ChromeLauncher
{
const
ChromeLauncher
();
static
final
Completer
<
Chrome
>
_currentCompleter
=
Completer
<
Chrome
>();
/// Launch the chrome browser to a particular `host` page.
Future
<
Chrome
>
launch
(
String
url
)
async
{
final
String
chromeExecutable
=
findChromeExecutable
();
final
Directory
dataDir
=
fs
.
systemTempDirectory
.
createTempSync
();
final
int
port
=
await
os
.
findFreePort
();
final
List
<
String
>
args
=
<
String
>[
chromeExecutable
,
// Using a tmp directory ensures that a new instance of chrome launches
// allowing for the remote debug port to be enabled.
'--user-data-dir=
${dataDir.path}
'
,
'--remote-debugging-port=
$port
'
,
// When the DevTools has focus we don't want to slow down the application.
'--disable-background-timer-throttling'
,
// Since we are using a temp profile, disable features that slow the
// Chrome launch.
'--disable-extensions'
,
'--disable-popup-blocking'
,
'--bwsi'
,
'--no-first-run'
,
'--no-default-browser-check'
,
'--disable-default-apps'
,
'--disable-translate'
,
url
,
];
final
Process
process
=
await
processManager
.
start
(
args
);
// Wait until the DevTools are listening before trying to connect.
await
process
.
stderr
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
firstWhere
((
String
line
)
=>
line
.
startsWith
(
'DevTools listening'
))
.
timeout
(
const
Duration
(
seconds:
60
),
onTimeout:
()
{
throwToolExit
(
'Unable to connect to Chrome DevTools.'
);
return
null
;
});
return
_connect
(
Chrome
.
_
(
port
,
ChromeConnection
(
'localhost'
,
port
),
process:
process
,
dataDir:
dataDir
,
));
}
static
Future
<
Chrome
>
_connect
(
Chrome
chrome
)
async
{
if
(
_currentCompleter
.
isCompleted
)
{
throwToolExit
(
'Only one instance of chrome can be started.'
);
}
// The connection is lazy. Try a simple call to make sure the provided
// connection is valid.
try
{
await
chrome
.
chromeConnection
.
getTabs
();
}
catch
(
e
)
{
await
chrome
.
close
();
throwToolExit
(
'Unable to connect to Chrome debug port:
${chrome.debugPort}
\n
$e
'
);
}
_currentCompleter
.
complete
(
chrome
);
return
chrome
;
}
/// Connects to an instance of Chrome with an open debug port.
static
Future
<
Chrome
>
fromExisting
(
int
port
)
async
=>
_connect
(
Chrome
.
_
(
port
,
ChromeConnection
(
'localhost'
,
port
)));
static
Future
<
Chrome
>
get
connectedInstance
=>
_currentCompleter
.
future
;
}
/// A class for managing an instance of Chrome.
class
Chrome
{
const
Chrome
.
_
(
this
.
debugPort
,
this
.
chromeConnection
,
{
Process
process
,
Directory
dataDir
,
})
:
_process
=
process
,
_dataDir
=
dataDir
;
final
int
debugPort
;
final
Process
_process
;
final
Directory
_dataDir
;
final
ChromeConnection
chromeConnection
;
static
Completer
<
Chrome
>
_currentCompleter
=
Completer
<
Chrome
>();
Future
<
void
>
close
()
async
{
if
(
_currentCompleter
.
isCompleted
)
{
_currentCompleter
=
Completer
<
Chrome
>();
}
chromeConnection
.
close
();
_process
?.
kill
(
ProcessSignal
.
SIGKILL
);
await
_process
?.
exitCode
;
try
{
// Chrome starts another process as soon as it dies that modifies the
// profile information. Give it some time before attempting to delete
// the directory.
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
500
));
}
catch
(
_
)
{
// Silently fail if we can't clean up the profile information.
}
finally
{
try
{
await
_dataDir
?.
delete
(
recursive:
true
);
}
on
FileSystemException
{
printError
(
'failed to delete temporary profile at
${_dataDir.path}
'
);
}
}
}
}
packages/flutter_tools/lib/src/web/web_device.dart
View file @
83986acb
...
...
@@ -5,30 +5,18 @@
import
'../application_package.dart'
;
import
'../asset.dart'
;
import
'../base/common.dart'
;
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/platform.dart'
;
import
'../base/process_manager.dart'
;
import
'../build_info.dart'
;
import
'../bundle.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
;
import
'../project.dart'
;
import
'../version.dart'
;
import
'../web/compile.dart'
;
ChromeLauncher
get
chromeLauncher
=>
context
.
get
<
ChromeLauncher
>();
/// Only launch or display web devices if `FLUTTER_WEB`
/// environment variable is set to true.
bool
get
flutterWebEnabled
{
_flutterWebEnabled
=
platform
.
environment
[
'FLUTTER_WEB'
]?.
toLowerCase
()
==
'true'
;
return
_flutterWebEnabled
&&
!
FlutterVersion
.
instance
.
isStable
;
}
bool
_flutterWebEnabled
;
import
'../web/workflow.dart'
;
import
'chrome.dart'
;
class
WebApplicationPackage
extends
ApplicationPackage
{
WebApplicationPackage
(
this
.
_flutterProject
)
:
super
(
id:
_flutterProject
.
manifest
.
appName
);
...
...
@@ -42,7 +30,6 @@ class WebApplicationPackage extends ApplicationPackage {
Directory
get
webSourcePath
=>
_flutterProject
.
directory
.
childDirectory
(
'web'
);
}
class
WebDevice
extends
Device
{
WebDevice
()
:
super
(
'web'
);
...
...
@@ -94,7 +81,17 @@ class WebDevice extends Device {
DevicePortForwarder
get
portForwarder
=>
const
NoOpDevicePortForwarder
();
@override
Future
<
String
>
get
sdkNameAndVersion
async
=>
'web'
;
Future
<
String
>
get
sdkNameAndVersion
async
{
final
String
chrome
=
findChromeExecutable
();
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
chrome
,
'--version'
,
]);
if
(
result
.
exitCode
==
0
)
{
return
result
.
stdout
;
}
return
'unknown'
;
}
@override
Future
<
LaunchResult
>
startApp
(
...
...
@@ -140,7 +137,7 @@ class WebDevice extends Device {
}
@override
Future
<
TargetPlatform
>
get
targetPlatform
async
=>
TargetPlatform
.
web
;
Future
<
TargetPlatform
>
get
targetPlatform
async
=>
TargetPlatform
.
web
_javascript
;
@override
Future
<
bool
>
uninstallApp
(
ApplicationPackage
app
)
async
=>
true
;
...
...
@@ -202,45 +199,3 @@ class WebDevices extends PollingDeviceDiscovery {
@override
bool
get
supportsPlatform
=>
flutterWebEnabled
;
}
const
String
_klinuxExecutable
=
'google-chrome'
;
const
String
_kMacOSExecutable
=
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
;
const
String
_kWindowsExecutable
=
r'Google\Chrome\Application\chrome.exe'
;
final
List
<
String
>
_kWindowsPrefixes
=
<
String
>[
platform
.
environment
[
'LOCALAPPDATA'
],
platform
.
environment
[
'PROGRAMFILES'
],
platform
.
environment
[
'PROGRAMFILES(X86)'
],
];
// Responsible for launching chrome with devtools configured.
class
ChromeLauncher
{
const
ChromeLauncher
();
/// Launch the chrome browser to a particular `host` page.
Future
<
Process
>
launch
(
String
host
)
async
{
String
executable
;
if
(
platform
.
isMacOS
)
{
executable
=
_kMacOSExecutable
;
}
else
if
(
platform
.
isLinux
)
{
executable
=
_klinuxExecutable
;
}
else
if
(
platform
.
isWindows
)
{
final
String
filePath
=
_kWindowsPrefixes
.
firstWhere
((
String
prefix
)
{
if
(
prefix
==
null
)
{
return
false
;
}
final
String
path
=
fs
.
path
.
join
(
prefix
,
_kWindowsExecutable
);
return
fs
.
file
(
path
).
existsSync
();
},
orElse:
()
=>
'.'
);
executable
=
filePath
;
}
else
{
throwToolExit
(
'Platform
${platform.operatingSystem}
is not supported.'
);
}
if
(!
fs
.
file
(
executable
).
existsSync
())
{
throwToolExit
(
'Chrome executable not found at
$executable
'
);
}
return
processManager
.
start
(<
String
>[
executable
,
host
,
],
mode:
ProcessStartMode
.
detached
);
}
}
packages/flutter_tools/lib/src/web/web_validator.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'../base/platform.dart'
;
import
'../doctor.dart'
;
import
'chrome.dart'
;
import
'workflow.dart'
;
/// A validator that checks whether chrome is installed and can run.
class
WebValidator
extends
DoctorValidator
{
const
WebValidator
()
:
super
(
'Chrome - develop for the web'
);
@override
Future
<
ValidationResult
>
validate
()
async
{
final
String
chrome
=
findChromeExecutable
();
final
bool
canRunChrome
=
canFindChrome
();
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
if
(
platform
.
environment
.
containsKey
(
kChromeEnvironment
))
{
messages
.
add
(
ValidationMessage
(
'
$kChromeEnvironment
=
$chrome
'
));
}
else
{
messages
.
add
(
ValidationMessage
(
'Chrome at
$chrome
'
));
messages
.
add
(
ValidationMessage
.
hint
(
'
$kChromeEnvironment
not set'
));
}
if
(!
canRunChrome
)
{
return
ValidationResult
(
ValidationType
.
missing
,
messages
,
statusInfo:
'Cannot find chrome executable at
$chrome
'
,
);
}
return
ValidationResult
(
ValidationType
.
installed
,
messages
,
);
}
}
packages/flutter_tools/lib/src/web/workflow.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
import
'../base/platform.dart'
;
import
'../base/process_manager.dart'
;
import
'../doctor.dart'
;
import
'../version.dart'
;
import
'chrome.dart'
;
/// Only launch or display web devices if `FLUTTER_WEB`
/// environment variable is set to true.
bool
get
flutterWebEnabled
{
_flutterWebEnabled
=
platform
.
environment
[
'FLUTTER_WEB'
]?.
toLowerCase
()
==
'true'
;
return
_flutterWebEnabled
&&
!
FlutterVersion
.
instance
.
isStable
;
}
bool
_flutterWebEnabled
;
/// The web workflow instance.
WebWorkflow
get
webWorkflow
=>
context
.
get
<
WebWorkflow
>();
class
WebWorkflow
extends
Workflow
{
const
WebWorkflow
();
@override
bool
get
appliesToHostPlatform
=>
flutterWebEnabled
&&
(
platform
.
isWindows
||
platform
.
isMacOS
||
platform
.
isLinux
);
@override
bool
get
canLaunchDevices
=>
flutterWebEnabled
&&
canFindChrome
();
@override
bool
get
canListDevices
=>
flutterWebEnabled
&&
canFindChrome
();
@override
bool
get
canListEmulators
=>
false
;
}
/// Whether we can locate the chrome executable.
bool
canFindChrome
(
)
{
final
String
chrome
=
findChromeExecutable
();
if
(
platform
.
isLinux
)
{
return
processManager
.
canRun
(
chrome
);
}
else
if
(
platform
.
isMacOS
)
{
return
fs
.
file
(
chrome
).
existsSync
();
}
else
if
(
platform
.
isWindows
)
{
return
fs
.
file
(
chrome
).
existsSync
();
}
return
false
;
}
packages/flutter_tools/pubspec.yaml
View file @
83986acb
...
...
@@ -10,7 +10,7 @@ environment:
dependencies
:
# To update these, use "flutter update-packages --force-upgrade".
archive
:
2.0.9
args
:
1.5.
1
args
:
1.5.
2
bsdiff
:
0.1.0
completion
:
0.2.1+1
coverage
:
0.12.4
...
...
@@ -33,6 +33,7 @@ dependencies:
usage
:
3.4.1
vm_service_client
:
0.2.6+2
web_socket_channel
:
1.0.13
webkit_inspection_protocol
:
0.4.0
xml
:
3.5.0
yaml
:
2.1.15
flutter_goldens_client
:
...
...
@@ -60,7 +61,7 @@ dependencies:
build_config
:
0.4.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
build_resolvers
:
1.0.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
built_collection
:
4.2.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
built_value
:
6.
5
.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
built_value
:
6.
6
.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
convert
:
2.1.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.16.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -100,13 +101,13 @@ dependencies:
dev_dependencies
:
collection
:
1.14.11
mockito
:
4.
0
.0
mockito
:
4.
1
.0
file_testing
:
2.1.0
vm_service_lib
:
3.17.0
vm_service_lib
:
3.17.0
+1
test
:
1.6.3
build_runner
:
1.4.0
build_vm_compilers
:
1.0.0
build_test
:
0.10.
7+3
build_test
:
0.10.
8
mime
:
0.9.6+3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
multi_server_socket
:
1.0.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -118,4 +119,4 @@ dartdoc:
# Exclude this package from the hosted API docs.
nodoc
:
true
# PUBSPEC CHECKSUM:
b34a
# PUBSPEC CHECKSUM:
ef94
packages/flutter_tools/test/commands/run_test.dart
View file @
83986acb
...
...
@@ -66,7 +66,7 @@ void main() {
when
(
mockDeviceManager
.
getDevices
()).
thenAnswer
((
Invocation
invocation
)
{
return
Stream
<
Device
>.
fromIterable
(<
Device
>[
MockDevice
(
TargetPlatform
.
web
),
MockDevice
(
TargetPlatform
.
web
_javascript
),
]);
});
...
...
packages/flutter_tools/test/web/devices_test.dart
View file @
83986acb
...
...
@@ -5,6 +5,7 @@
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/compile.dart'
;
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:mockito/mockito.dart'
;
...
...
packages/flutter_tools/test/web/web_validator_test.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/web_validator.dart'
;
import
'package:mockito/mockito.dart'
;
import
'../src/common.dart'
;
import
'../src/testbed.dart'
;
void
main
(
)
{
group
(
'WebValidator'
,
()
{
Testbed
testbed
;
WebValidator
webValidator
;
MockPlatform
mockPlatform
;
setUp
(()
{
testbed
=
Testbed
(
setup:
()
{
fs
.
file
(
kMacOSExecutable
).
createSync
(
recursive:
true
);
fs
.
file
(
'chrome_foo'
).
createSync
();
return
null
;
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
mockPlatform
,
});
webValidator
=
const
WebValidator
();
mockPlatform
=
MockPlatform
();
when
(
mockPlatform
.
isMacOS
).
thenReturn
(
true
);
when
(
mockPlatform
.
isWindows
).
thenReturn
(
false
);
when
(
mockPlatform
.
isLinux
).
thenReturn
(
false
);
});
test
(
'Can find macOS executable '
,
()
=>
testbed
.
run
(()
async
{
final
ValidationResult
result
=
await
webValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
installed
);
}));
test
(
'Can notice missing macOS executable '
,
()
=>
testbed
.
run
(()
async
{
fs
.
file
(
kMacOSExecutable
).
deleteSync
();
final
ValidationResult
result
=
await
webValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
missing
);
}));
});
}
class
MockPlatform
extends
Mock
implements
Platform
{
@override
Map
<
String
,
String
>
get
environment
=>
const
<
String
,
String
>{};
}
packages/flutter_tools/test/web/workflow_test.dart
0 → 100644
View file @
83986acb
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/version.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/workflow.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:process/process.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'../src/testbed.dart'
;
void
main
(
)
{
group
(
'WebWorkflow'
,
()
{
Testbed
testbed
;
MockPlatform
noEnvironment
;
MockPlatform
notSupported
;
MockPlatform
windows
;
MockPlatform
linux
;
MockPlatform
macos
;
MockProcessManager
mockProcessManager
;
MockFlutterVersion
unstable
;
MockFlutterVersion
stable
;
WebWorkflow
workflow
;
setUpAll
(()
{
unstable
=
MockFlutterVersion
(
false
);
stable
=
MockFlutterVersion
(
true
);
noEnvironment
=
MockPlatform
(
environment:
const
<
String
,
String
>{});
notSupported
=
MockPlatform
(
linux:
false
,
windows:
false
,
macos:
false
);
windows
=
MockPlatform
(
windows:
true
);
linux
=
MockPlatform
(
linux:
true
);
macos
=
MockPlatform
(
macos:
true
);
workflow
=
const
WebWorkflow
();
mockProcessManager
=
MockProcessManager
();
testbed
=
Testbed
(
setup:
()
async
{
fs
.
file
(
'chrome'
).
createSync
();
when
(
mockProcessManager
.
canRun
(
'chrome'
)).
thenReturn
(
true
);
},
overrides:
<
Type
,
Generator
>{
FlutterVersion:
()
=>
unstable
,
ProcessManager:
()
=>
mockProcessManager
,
});
});
test
(
'does not apply if FLUTTER_WEB is not true'
,
()=>
testbed
.
run
(()
{
expect
(
workflow
.
appliesToHostPlatform
,
false
);
expect
(
workflow
.
canLaunchDevices
,
false
);
expect
(
workflow
.
canListDevices
,
false
);
expect
(
workflow
.
canListEmulators
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
noEnvironment
,
}));
test
(
'Applies on Linux'
,
()
=>
testbed
.
run
(()
{
expect
(
workflow
.
appliesToHostPlatform
,
true
);
expect
(
workflow
.
canLaunchDevices
,
true
);
expect
(
workflow
.
canListDevices
,
true
);
expect
(
workflow
.
canListEmulators
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
linux
,
}));
test
(
'Applies on macOS'
,
()
=>
testbed
.
run
(()
{
expect
(
workflow
.
appliesToHostPlatform
,
true
);
expect
(
workflow
.
canLaunchDevices
,
true
);
expect
(
workflow
.
canListDevices
,
true
);
expect
(
workflow
.
canListEmulators
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
macos
,
}));
test
(
'Applies on Windows'
,
()
=>
testbed
.
run
(()
{
expect
(
workflow
.
appliesToHostPlatform
,
true
);
expect
(
workflow
.
canLaunchDevices
,
true
);
expect
(
workflow
.
canListDevices
,
true
);
expect
(
workflow
.
canListEmulators
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
windows
,
}));
test
(
'does not apply on other platforms'
,
()
=>
testbed
.
run
(()
{
expect
(
workflow
.
appliesToHostPlatform
,
false
);
expect
(
workflow
.
canLaunchDevices
,
false
);
expect
(
workflow
.
canListDevices
,
false
);
expect
(
workflow
.
canListEmulators
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
notSupported
,
}));
test
(
'does not apply on stable brnach'
,
()
=>
testbed
.
run
(()
{
expect
(
workflow
.
appliesToHostPlatform
,
false
);
expect
(
workflow
.
canLaunchDevices
,
false
);
expect
(
workflow
.
canListDevices
,
false
);
expect
(
workflow
.
canListEmulators
,
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
macos
,
FlutterVersion:
()
=>
stable
,
}));
});
}
class
MockFlutterVersion
extends
Mock
implements
FlutterVersion
{
MockFlutterVersion
(
this
.
isStable
);
@override
final
bool
isStable
;
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockPlatform
extends
Mock
implements
Platform
{
MockPlatform
(
{
this
.
windows
=
false
,
this
.
macos
=
false
,
this
.
linux
=
false
,
this
.
environment
=
const
<
String
,
String
>{
'FLUTTER_WEB'
:
'true'
,
kChromeEnvironment:
'chrome'
,
}});
final
bool
windows
;
final
bool
macos
;
final
bool
linux
;
@override
final
Map
<
String
,
String
>
environment
;
@override
bool
get
isLinux
=>
linux
;
@override
bool
get
isMacOS
=>
macos
;
@override
bool
get
isWindows
=>
windows
;
}
packages/fuchsia_remote_debug_protocol/pubspec.yaml
View file @
83986acb
...
...
@@ -42,6 +42,6 @@ dependencies:
vm_service_client
:
0.2.6+2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
mockito
:
4.
0
.0
mockito
:
4.
1
.0
# PUBSPEC CHECKSUM:
b48d
# PUBSPEC CHECKSUM:
ef8e
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