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
e6fa5717
Unverified
Commit
e6fa5717
authored
Dec 05, 2019
by
Jonah Williams
Committed by
GitHub
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix release web builds where the target file is not under lib (#46179)
parent
e3005e69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
web.dart
packages/flutter_tools/lib/src/build_system/targets/web.dart
+4
-5
web_test.dart
...ols/test/general.shard/build_system/targets/web_test.dart
+11
-0
No files found.
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
e6fa5717
...
...
@@ -68,11 +68,10 @@ class WebEntrypointTarget extends Target {
);
// By construction, this will only be null if the .packages file does not
// have an entry for the user's application.
final
Uri
mainImport
=
packageUriMapper
.
map
(
importPath
);
if
(
mainImport
==
null
)
{
throw
Exception
(
'Missing package definition for
$mainImport
'
);
}
// have an entry for the user's application or if the main file is
// outside of the lib/ directory.
final
String
mainImport
=
packageUriMapper
.
map
(
importPath
)?.
toString
()
??
fs
.
file
(
importPath
).
absolute
.
uri
.
toString
();
String
contents
;
if
(
hasPlugins
)
{
...
...
packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart
View file @
e6fa5717
...
...
@@ -76,6 +76,17 @@ void main() {
expect
(
generated
,
contains
(
"import 'package:foo/main.dart' as entrypoint;"
));
}));
test
(
'WebEntrypointTarget generates an entrypoint for a file outside of main'
,
()
=>
testbed
.
run
(()
async
{
environment
.
defines
[
kTargetFile
]
=
fs
.
path
.
join
(
'other'
,
'lib'
,
'main.dart'
);
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;"
));
}));
test
(
'WebEntrypointTarget generates an entrypoint with plugins and init platform on windows'
,
()
=>
testbed
.
run
(()
async
{
environment
.
defines
[
kHasWebPlugins
]
=
'true'
;
environment
.
defines
[
kInitializePlatform
]
=
'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