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
dc084b90
Commit
dc084b90
authored
Jan 27, 2020
by
Jonah Williams
Committed by
Flutter GitHub Bot
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] handle plugins for entrypoints outside of main (#49459)
parent
f9908f54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
web.dart
packages/flutter_tools/lib/src/build_system/targets/web.dart
+2
-1
web_test.dart
...ols/test/general.shard/build_system/targets/web_test.dart
+12
-0
No files found.
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
dc084b90
...
...
@@ -83,7 +83,8 @@ class WebEntrypointTarget extends Target {
.
childDirectory
(
'lib'
)
.
childFile
(
'generated_plugin_registrant.dart'
)
.
absolute
.
path
;
final
Uri
generatedImport
=
packageUriMapper
.
map
(
generatedPath
);
final
String
generatedImport
=
packageUriMapper
.
map
(
generatedPath
)?.
toString
()
??
globals
.
fs
.
file
(
generatedPath
).
absolute
.
uri
.
toString
();
contents
=
'''
import '
dart:
ui
' as ui;
...
...
packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart
View file @
dc084b90
...
...
@@ -117,6 +117,18 @@ void main() {
expect
(
generated
,
contains
(
"import 'file:///other/lib/main.dart' as entrypoint;"
));
}));
test
(
'WebEntrypointTarget generates a plugin registrant for a file outside of main'
,
()
=>
testbed
.
run
(()
async
{
environment
.
defines
[
kTargetFile
]
=
globals
.
fs
.
path
.
join
(
'other'
,
'lib'
,
'main.dart'
);
environment
.
defines
[
kHasWebPlugins
]
=
'true'
;
await
const
WebEntrypointTarget
().
build
(
environment
);
final
String
generated
=
environment
.
buildDir
.
childFile
(
'main.dart'
).
readAsStringSync
();
// Import.
expect
(
generated
,
contains
(
"import 'file:///other/lib/main.dart' as entrypoint;"
));
expect
(
generated
,
contains
(
"import 'file:///foo/lib/generated_plugin_registrant.dart';"
));
}));
test
(
'WebEntrypointTarget generates an entrypoint with plugins and init platform on windows'
,
()
=>
testbed
.
run
(()
async
{
environment
.
defines
[
kHasWebPlugins
]
=
'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