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
3383b564
Unverified
Commit
3383b564
authored
Nov 12, 2019
by
Jonah Williams
Committed by
GitHub
Nov 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always link desktop platforms (#44753)
parent
47f71ba3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
dart.dart
...ages/flutter_tools/lib/src/build_system/targets/dart.dart
+14
-1
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+33
-0
No files found.
packages/flutter_tools/lib/src/build_system/targets/dart.dart
View file @
3383b564
...
...
@@ -193,6 +193,19 @@ class KernelSnapshot extends Target {
targetPlatform
==
TargetPlatform
.
fuchsia_arm64
)
{
targetModel
=
TargetModel
.
flutterRunner
;
}
// Force linking of the platform for desktop embedder targets since these
// do not correctly load the core snapshots in debug mode.
// See https://github.com/flutter/flutter/issues/44724
bool
forceLinkPlatform
;
switch
(
targetPlatform
)
{
case
TargetPlatform
.
darwin_x64
:
case
TargetPlatform
.
windows_x64
:
case
TargetPlatform
.
linux_x64
:
forceLinkPlatform
=
true
;
break
;
default
:
forceLinkPlatform
=
false
;
}
final
CompilerOutput
output
=
await
compiler
.
compile
(
sdkRoot:
artifacts
.
getArtifactPath
(
...
...
@@ -206,7 +219,7 @@ class KernelSnapshot extends Target {
targetModel:
targetModel
,
outputFilePath:
environment
.
buildDir
.
childFile
(
'app.dill'
).
path
,
packagesPath:
packagesPath
,
linkPlatformKernelIn:
buildMode
.
isPrecompiled
,
linkPlatformKernelIn:
forceLinkPlatform
||
buildMode
.
isPrecompiled
,
mainPath:
targetFileAbsolute
,
depFilePath:
environment
.
buildDir
.
childFile
(
'kernel_snapshot.d'
).
path
,
extraFrontEndOptions:
extraFrontEndOptions
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
3383b564
...
...
@@ -205,6 +205,39 @@ flutter_tools:lib/''');
KernelCompilerFactory:
()
=>
MockKernelCompilerFactory
(),
}));
test
(
'kernel_snapshot forces platform linking on debug for darwin target platforms'
,
()
=>
testbed
.
run
(()
async
{
final
MockKernelCompiler
mockKernelCompiler
=
MockKernelCompiler
();
when
(
kernelCompilerFactory
.
create
(
any
)).
thenAnswer
((
Invocation
_
)
async
{
return
mockKernelCompiler
;
});
when
(
mockKernelCompiler
.
compile
(
sdkRoot:
anyNamed
(
'sdkRoot'
),
aot:
anyNamed
(
'aot'
),
buildMode:
anyNamed
(
'buildMode'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
targetModel:
anyNamed
(
'targetModel'
),
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
),
extraFrontEndOptions:
anyNamed
(
'extraFrontEndOptions'
),
fileSystemRoots:
anyNamed
(
'fileSystemRoots'
),
fileSystemScheme:
anyNamed
(
'fileSystemScheme'
),
linkPlatformKernelIn:
true
,
dartDefines:
anyNamed
(
'dartDefines'
),
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
await
const
KernelSnapshot
().
build
(
androidEnvironment
..
defines
[
kTargetPlatform
]
=
'darwin-x64'
..
defines
[
kBuildMode
]
=
'debug'
);
},
overrides:
<
Type
,
Generator
>{
KernelCompilerFactory:
()
=>
MockKernelCompilerFactory
(),
}));
test
(
'kernel_snapshot does use track widget creation on debug builds'
,
()
=>
testbed
.
run
(()
async
{
final
MockKernelCompiler
mockKernelCompiler
=
MockKernelCompiler
();
when
(
kernelCompilerFactory
.
create
(
any
)).
thenAnswer
((
Invocation
_
)
async
{
...
...
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