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
7b1d2421
Unverified
Commit
7b1d2421
authored
Apr 28, 2020
by
Jonah Williams
Committed by
GitHub
Apr 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Make packages not required for local engine (#55882)
parent
1ac09088
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
23 additions
and
15 deletions
+23
-15
asset.dart
packages/flutter_tools/lib/src/asset.dart
+1
-1
devfs_web.dart
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
+1
-1
dart.dart
...ages/flutter_tools/lib/src/build_system/targets/dart.dart
+1
-1
web.dart
packages/flutter_tools/lib/src/build_system/targets/web.dart
+1
-1
package_map.dart
packages/flutter_tools/lib/src/dart/package_map.dart
+8
-1
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+1
-1
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+3
-3
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+2
-1
template.dart
packages/flutter_tools/lib/src/template.dart
+1
-1
flutter_web_platform.dart
...ages/flutter_tools/lib/src/test/flutter_web_platform.dart
+2
-2
test_compiler.dart
packages/flutter_tools/lib/src/test/test_compiler.dart
+1
-1
flutter_command_runner_test.dart
...est/general.shard/runner/flutter_command_runner_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/asset.dart
View file @
7b1d2421
...
...
@@ -152,7 +152,7 @@ class _ManifestAssetBundle implements AssetBundle {
}
final
String
assetBasePath
=
globals
.
fs
.
path
.
dirname
(
globals
.
fs
.
path
.
absolute
(
manifestPath
));
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
packagesPath
),
logger:
globals
.
logger
,
);
...
...
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
View file @
7b1d2421
...
...
@@ -154,7 +154,7 @@ class WebAssetServer implements AssetReader {
address
=
(
await
InternetAddress
.
lookup
(
hostname
)).
first
;
}
final
HttpServer
httpServer
=
await
HttpServer
.
bind
(
address
,
port
);
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
);
...
...
packages/flutter_tools/lib/src/build_system/targets/dart.dart
View file @
7b1d2421
...
...
@@ -231,7 +231,7 @@ class KernelSnapshot extends Target {
forceLinkPlatform
=
false
;
}
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
environment
.
projectDir
.
childFile
(
'.packages'
),
logger:
environment
.
logger
,
);
...
...
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
7b1d2421
...
...
@@ -62,7 +62,7 @@ class WebEntrypointTarget extends Target {
final
bool
shouldInitializePlatform
=
environment
.
defines
[
kInitializePlatform
]
==
'true'
;
final
bool
hasPlugins
=
environment
.
defines
[
kHasWebPlugins
]
==
'true'
;
final
Uri
importUri
=
environment
.
fileSystem
.
file
(
targetFile
).
absolute
.
uri
;
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
environment
.
projectDir
.
childFile
(
'.packages'
),
logger:
environment
.
logger
,
);
...
...
packages/flutter_tools/lib/src/dart/package_map.dart
View file @
7b1d2421
...
...
@@ -25,8 +25,12 @@ String _globalPackagesPath;
/// Load the package configuration from [file] or throws a [ToolExit]
/// if the operation would fail.
Future
<
PackageConfig
>
loadPackageConfigOrFail
(
File
file
,
{
///
/// If [nonFatal] is true, in the event of an error an empty package
/// config is returned.
Future
<
PackageConfig
>
loadPackageConfigWithLogging
(
File
file
,
{
@required
Logger
logger
,
bool
throwOnError
=
true
,
})
{
final
FileSystem
fileSystem
=
file
.
fileSystem
;
return
loadPackageConfigUri
(
...
...
@@ -39,6 +43,9 @@ Future<PackageConfig> loadPackageConfigOrFail(File file, {
return
Future
<
Uint8List
>.
value
(
configFile
.
readAsBytesSync
());
},
onError:
(
dynamic
error
)
{
if
(!
throwOnError
)
{
return
;
}
logger
.
printTrace
(
error
.
toString
());
String
message
=
'
${file.path}
does not exist.'
;
final
String
pubspecPath
=
fileSystem
.
path
.
absolute
(
fileSystem
.
path
.
dirname
(
file
.
path
),
'pubspec.yaml'
);
...
...
packages/flutter_tools/lib/src/plugins.dart
View file @
7b1d2421
...
...
@@ -305,7 +305,7 @@ Future<List<Plugin>> findPlugins(FlutterProject project) async {
project
.
directory
.
path
,
globalPackagesPath
,
);
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
packagesFile
),
logger:
globals
.
logger
,
);
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
7b1d2421
...
...
@@ -157,7 +157,7 @@ class HotRunner extends ResidentRunner {
final
Stopwatch
stopwatch
=
Stopwatch
()..
start
();
final
UpdateFSReport
results
=
UpdateFSReport
(
success:
true
);
final
List
<
Uri
>
invalidated
=
<
Uri
>[
Uri
.
parse
(
libraryId
)];
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
);
...
...
@@ -355,7 +355,7 @@ class HotRunner extends ResidentRunner {
firstBuildTime
=
DateTime
.
now
();
final
List
<
Future
<
bool
>>
startupTasks
=
<
Future
<
bool
>>[];
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
);
...
...
@@ -1300,7 +1300,7 @@ class ProjectFileInvalidator {
}
Future
<
PackageConfig
>
_createPackageConfig
(
String
packagesPath
)
{
return
loadPackageConfig
OrFail
(
return
loadPackageConfig
WithLogging
(
_fileSystem
.
file
(
globalPackagesPath
),
logger:
_logger
,
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
7b1d2421
...
...
@@ -354,9 +354,10 @@ class FlutterCommandRunner extends CommandRunner<void> {
if
(
engineSourcePath
==
null
&&
globalResults
[
'local-engine'
]
!=
null
)
{
try
{
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
throwOnError:
false
,
);
Uri
engineUri
=
packageConfig
[
kFlutterEnginePackageName
]?.
packageUriRoot
;
// Skip if sky_engine is the self-contained one.
...
...
packages/flutter_tools/lib/src/template.dart
View file @
7b1d2421
...
...
@@ -249,7 +249,7 @@ Future<Directory> _templateImageDirectory(String name, FileSystem fileSystem) as
if
(!
fileSystem
.
file
(
packageFilePath
).
existsSync
())
{
await
_ensurePackageDependencies
(
toolPackagePath
);
}
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
fileSystem
.
file
(
packageFilePath
),
logger:
globals
.
logger
,
);
...
...
packages/flutter_tools/lib/src/test/flutter_web_platform.dart
View file @
7b1d2421
...
...
@@ -97,12 +97,12 @@ class FlutterWebPlatform extends PlatformPlugin {
);
}
final
Future
<
PackageConfig
>
_packagesFuture
=
loadPackageConfig
OrFail
(
final
Future
<
PackageConfig
>
_packagesFuture
=
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
);
final
Future
<
PackageConfig
>
_flutterToolsPackageMap
=
loadPackageConfig
OrFail
(
final
Future
<
PackageConfig
>
_flutterToolsPackageMap
=
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
...
...
packages/flutter_tools/lib/src/test/test_compiler.dart
View file @
7b1d2421
...
...
@@ -129,7 +129,7 @@ class TestCompiler {
if
(!
isEmpty
)
{
return
;
}
_packageConfig
??=
await
loadPackageConfig
OrFail
(
_packageConfig
??=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
);
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart
View file @
7b1d2421
...
...
@@ -131,7 +131,7 @@ void main() {
},
initializeFlutterRoot:
false
);
testUsingContext
(
'works if --local-engine is specified and --local-engine-src-path is specified'
,
()
async
{
fs
.
file
(
_kDotPackages
).
writeAsStringSync
(
'
\n
'
);
// Intentionally do not create a package_config to verify that it is not required.
fs
.
directory
(
'
$_kArbitraryEngineRoot
/src/out/ios_debug'
).
createSync
(
recursive:
true
);
fs
.
directory
(
'
$_kArbitraryEngineRoot
/src/out/host_debug'
).
createSync
(
recursive:
true
);
...
...
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