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
caa56d6a
Unverified
Commit
caa56d6a
authored
Aug 06, 2019
by
Jonah Williams
Committed by
GitHub
Aug 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable track widget creation on debug builds (#37512)
parent
a785db78
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
1 deletion
+57
-1
dart.dart
...ages/flutter_tools/lib/src/build_system/targets/dart.dart
+1
-1
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+56
-0
No files found.
packages/flutter_tools/lib/src/build_system/targets/dart.dart
View file @
caa56d6a
...
@@ -96,7 +96,7 @@ class KernelSnapshot extends Target {
...
@@ -96,7 +96,7 @@ class KernelSnapshot extends Target {
final
CompilerOutput
output
=
await
compiler
.
compile
(
final
CompilerOutput
output
=
await
compiler
.
compile
(
sdkRoot:
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
,
mode:
buildMode
),
sdkRoot:
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
,
mode:
buildMode
),
aot:
buildMode
!=
BuildMode
.
debug
,
aot:
buildMode
!=
BuildMode
.
debug
,
trackWidgetCreation:
false
,
trackWidgetCreation:
buildMode
==
BuildMode
.
debug
,
targetModel:
TargetModel
.
flutter
,
targetModel:
TargetModel
.
flutter
,
targetProductVm:
buildMode
==
BuildMode
.
release
,
targetProductVm:
buildMode
==
BuildMode
.
release
,
outputFilePath:
environment
.
buildDir
.
childFile
(
'app.dill'
).
path
,
outputFilePath:
environment
.
buildDir
.
childFile
(
'app.dill'
).
path
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
caa56d6a
...
@@ -114,6 +114,59 @@ flutter_tools:lib/''');
...
@@ -114,6 +114,59 @@ flutter_tools:lib/''');
expect
(
result
.
exceptions
.
values
.
single
.
exception
,
isInstanceOf
<
MissingDefineException
>());
expect
(
result
.
exceptions
.
values
.
single
.
exception
,
isInstanceOf
<
MissingDefineException
>());
}));
}));
test
(
'kernel_snapshot does not use track widget creation on profile builds'
,
()
=>
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'
),
trackWidgetCreation:
false
,
targetModel:
anyNamed
(
'targetModel'
),
targetProductVm:
anyNamed
(
'targetProductVm'
),
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
)
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
await
const
KernelSnapshot
().
build
(<
File
>[],
androidEnvironment
);
},
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
{
return
mockKernelCompiler
;
});
when
(
mockKernelCompiler
.
compile
(
sdkRoot:
anyNamed
(
'sdkRoot'
),
aot:
anyNamed
(
'aot'
),
trackWidgetCreation:
true
,
targetModel:
anyNamed
(
'targetModel'
),
targetProductVm:
anyNamed
(
'targetProductVm'
),
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
)
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
await
const
KernelSnapshot
().
build
(<
File
>[],
Environment
(
projectDir:
fs
.
currentDirectory
,
defines:
<
String
,
String
>{
kBuildMode:
'debug'
,
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
),
}));
},
overrides:
<
Type
,
Generator
>{
KernelCompilerFactory:
()
=>
MockKernelCompilerFactory
(),
}));
test
(
'aot_elf_profile Produces correct output directory'
,
()
=>
testbed
.
run
(()
async
{
test
(
'aot_elf_profile Produces correct output directory'
,
()
=>
testbed
.
run
(()
async
{
await
buildSystem
.
build
(
const
AotElfProfile
(),
androidEnvironment
);
await
buildSystem
.
build
(
const
AotElfProfile
(),
androidEnvironment
);
...
@@ -321,3 +374,6 @@ class FakeKernelCompiler implements KernelCompiler {
...
@@ -321,3 +374,6 @@ class FakeKernelCompiler implements KernelCompiler {
return
CompilerOutput
(
outputFilePath
,
0
,
null
);
return
CompilerOutput
(
outputFilePath
,
0
,
null
);
}
}
}
}
class
MockKernelCompilerFactory
extends
Mock
implements
KernelCompilerFactory
{}
class
MockKernelCompiler
extends
Mock
implements
KernelCompiler
{}
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