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 {
...
@@ -152,7 +152,7 @@ class _ManifestAssetBundle implements AssetBundle {
}
}
final
String
assetBasePath
=
globals
.
fs
.
path
.
dirname
(
globals
.
fs
.
path
.
absolute
(
manifestPath
));
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
),
globals
.
fs
.
file
(
packagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
...
packages/flutter_tools/lib/src/build_runner/devfs_web.dart
View file @
7b1d2421
...
@@ -154,7 +154,7 @@ class WebAssetServer implements AssetReader {
...
@@ -154,7 +154,7 @@ class WebAssetServer implements AssetReader {
address
=
(
await
InternetAddress
.
lookup
(
hostname
)).
first
;
address
=
(
await
InternetAddress
.
lookup
(
hostname
)).
first
;
}
}
final
HttpServer
httpServer
=
await
HttpServer
.
bind
(
address
,
port
);
final
HttpServer
httpServer
=
await
HttpServer
.
bind
(
address
,
port
);
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
...
packages/flutter_tools/lib/src/build_system/targets/dart.dart
View file @
7b1d2421
...
@@ -231,7 +231,7 @@ class KernelSnapshot extends Target {
...
@@ -231,7 +231,7 @@ class KernelSnapshot extends Target {
forceLinkPlatform
=
false
;
forceLinkPlatform
=
false
;
}
}
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
environment
.
projectDir
.
childFile
(
'.packages'
),
environment
.
projectDir
.
childFile
(
'.packages'
),
logger:
environment
.
logger
,
logger:
environment
.
logger
,
);
);
...
...
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
7b1d2421
...
@@ -62,7 +62,7 @@ class WebEntrypointTarget extends Target {
...
@@ -62,7 +62,7 @@ class WebEntrypointTarget extends Target {
final
bool
shouldInitializePlatform
=
environment
.
defines
[
kInitializePlatform
]
==
'true'
;
final
bool
shouldInitializePlatform
=
environment
.
defines
[
kInitializePlatform
]
==
'true'
;
final
bool
hasPlugins
=
environment
.
defines
[
kHasWebPlugins
]
==
'true'
;
final
bool
hasPlugins
=
environment
.
defines
[
kHasWebPlugins
]
==
'true'
;
final
Uri
importUri
=
environment
.
fileSystem
.
file
(
targetFile
).
absolute
.
uri
;
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'
),
environment
.
projectDir
.
childFile
(
'.packages'
),
logger:
environment
.
logger
,
logger:
environment
.
logger
,
);
);
...
...
packages/flutter_tools/lib/src/dart/package_map.dart
View file @
7b1d2421
...
@@ -25,8 +25,12 @@ String _globalPackagesPath;
...
@@ -25,8 +25,12 @@ String _globalPackagesPath;
/// Load the package configuration from [file] or throws a [ToolExit]
/// Load the package configuration from [file] or throws a [ToolExit]
/// if the operation would fail.
/// 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
,
@required
Logger
logger
,
bool
throwOnError
=
true
,
})
{
})
{
final
FileSystem
fileSystem
=
file
.
fileSystem
;
final
FileSystem
fileSystem
=
file
.
fileSystem
;
return
loadPackageConfigUri
(
return
loadPackageConfigUri
(
...
@@ -39,6 +43,9 @@ Future<PackageConfig> loadPackageConfigOrFail(File file, {
...
@@ -39,6 +43,9 @@ Future<PackageConfig> loadPackageConfigOrFail(File file, {
return
Future
<
Uint8List
>.
value
(
configFile
.
readAsBytesSync
());
return
Future
<
Uint8List
>.
value
(
configFile
.
readAsBytesSync
());
},
},
onError:
(
dynamic
error
)
{
onError:
(
dynamic
error
)
{
if
(!
throwOnError
)
{
return
;
}
logger
.
printTrace
(
error
.
toString
());
logger
.
printTrace
(
error
.
toString
());
String
message
=
'
${file.path}
does not exist.'
;
String
message
=
'
${file.path}
does not exist.'
;
final
String
pubspecPath
=
fileSystem
.
path
.
absolute
(
fileSystem
.
path
.
dirname
(
file
.
path
),
'pubspec.yaml'
);
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 {
...
@@ -305,7 +305,7 @@ Future<List<Plugin>> findPlugins(FlutterProject project) async {
project
.
directory
.
path
,
project
.
directory
.
path
,
globalPackagesPath
,
globalPackagesPath
,
);
);
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
packagesFile
),
globals
.
fs
.
file
(
packagesFile
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
7b1d2421
...
@@ -157,7 +157,7 @@ class HotRunner extends ResidentRunner {
...
@@ -157,7 +157,7 @@ class HotRunner extends ResidentRunner {
final
Stopwatch
stopwatch
=
Stopwatch
()..
start
();
final
Stopwatch
stopwatch
=
Stopwatch
()..
start
();
final
UpdateFSReport
results
=
UpdateFSReport
(
success:
true
);
final
UpdateFSReport
results
=
UpdateFSReport
(
success:
true
);
final
List
<
Uri
>
invalidated
=
<
Uri
>[
Uri
.
parse
(
libraryId
)];
final
List
<
Uri
>
invalidated
=
<
Uri
>[
Uri
.
parse
(
libraryId
)];
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
@@ -355,7 +355,7 @@ class HotRunner extends ResidentRunner {
...
@@ -355,7 +355,7 @@ class HotRunner extends ResidentRunner {
firstBuildTime
=
DateTime
.
now
();
firstBuildTime
=
DateTime
.
now
();
final
List
<
Future
<
bool
>>
startupTasks
=
<
Future
<
bool
>>[];
final
List
<
Future
<
bool
>>
startupTasks
=
<
Future
<
bool
>>[];
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
@@ -1300,7 +1300,7 @@ class ProjectFileInvalidator {
...
@@ -1300,7 +1300,7 @@ class ProjectFileInvalidator {
}
}
Future
<
PackageConfig
>
_createPackageConfig
(
String
packagesPath
)
{
Future
<
PackageConfig
>
_createPackageConfig
(
String
packagesPath
)
{
return
loadPackageConfig
OrFail
(
return
loadPackageConfig
WithLogging
(
_fileSystem
.
file
(
globalPackagesPath
),
_fileSystem
.
file
(
globalPackagesPath
),
logger:
_logger
,
logger:
_logger
,
);
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
7b1d2421
...
@@ -354,9 +354,10 @@ class FlutterCommandRunner extends CommandRunner<void> {
...
@@ -354,9 +354,10 @@ class FlutterCommandRunner extends CommandRunner<void> {
if
(
engineSourcePath
==
null
&&
globalResults
[
'local-engine'
]
!=
null
)
{
if
(
engineSourcePath
==
null
&&
globalResults
[
'local-engine'
]
!=
null
)
{
try
{
try
{
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
throwOnError:
false
,
);
);
Uri
engineUri
=
packageConfig
[
kFlutterEnginePackageName
]?.
packageUriRoot
;
Uri
engineUri
=
packageConfig
[
kFlutterEnginePackageName
]?.
packageUriRoot
;
// Skip if sky_engine is the self-contained one.
// 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
...
@@ -249,7 +249,7 @@ Future<Directory> _templateImageDirectory(String name, FileSystem fileSystem) as
if
(!
fileSystem
.
file
(
packageFilePath
).
existsSync
())
{
if
(!
fileSystem
.
file
(
packageFilePath
).
existsSync
())
{
await
_ensurePackageDependencies
(
toolPackagePath
);
await
_ensurePackageDependencies
(
toolPackagePath
);
}
}
final
PackageConfig
packageConfig
=
await
loadPackageConfig
OrFail
(
final
PackageConfig
packageConfig
=
await
loadPackageConfig
WithLogging
(
fileSystem
.
file
(
packageFilePath
),
fileSystem
.
file
(
packageFilePath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
...
packages/flutter_tools/lib/src/test/flutter_web_platform.dart
View file @
7b1d2421
...
@@ -97,12 +97,12 @@ class FlutterWebPlatform extends PlatformPlugin {
...
@@ -97,12 +97,12 @@ class FlutterWebPlatform extends PlatformPlugin {
);
);
}
}
final
Future
<
PackageConfig
>
_packagesFuture
=
loadPackageConfig
OrFail
(
final
Future
<
PackageConfig
>
_packagesFuture
=
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
final
Future
<
PackageConfig
>
_flutterToolsPackageMap
=
loadPackageConfig
OrFail
(
final
Future
<
PackageConfig
>
_flutterToolsPackageMap
=
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
Cache
.
flutterRoot
,
Cache
.
flutterRoot
,
'packages'
,
'packages'
,
...
...
packages/flutter_tools/lib/src/test/test_compiler.dart
View file @
7b1d2421
...
@@ -129,7 +129,7 @@ class TestCompiler {
...
@@ -129,7 +129,7 @@ class TestCompiler {
if
(!
isEmpty
)
{
if
(!
isEmpty
)
{
return
;
return
;
}
}
_packageConfig
??=
await
loadPackageConfig
OrFail
(
_packageConfig
??=
await
loadPackageConfig
WithLogging
(
globals
.
fs
.
file
(
globalPackagesPath
),
globals
.
fs
.
file
(
globalPackagesPath
),
logger:
globals
.
logger
,
logger:
globals
.
logger
,
);
);
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart
View file @
7b1d2421
...
@@ -131,7 +131,7 @@ void main() {
...
@@ -131,7 +131,7 @@ void main() {
},
initializeFlutterRoot:
false
);
},
initializeFlutterRoot:
false
);
testUsingContext
(
'works if --local-engine is specified and --local-engine-src-path is specified'
,
()
async
{
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/ios_debug'
).
createSync
(
recursive:
true
);
fs
.
directory
(
'
$_kArbitraryEngineRoot
/src/out/host_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