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
0b72d5ca
Unverified
Commit
0b72d5ca
authored
Feb 03, 2022
by
Jonah Williams
Committed by
GitHub
Feb 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] allow disabling profile mode timeline traces (#97622)
parent
4a7e30f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
compile.dart
packages/flutter_tools/lib/src/compile.dart
+6
-2
compile_test.dart
packages/flutter_tools/test/general.shard/compile_test.dart
+13
-2
No files found.
packages/flutter_tools/lib/src/compile.dart
View file @
0b72d5ca
...
...
@@ -177,8 +177,12 @@ List<String> buildModeOptions(BuildMode mode, List<String> dartDefines) {
];
case
BuildMode
.
profile
:
return
<
String
>[
'-Ddart.vm.profile=true'
,
'-Ddart.vm.product=false'
,
// These checks allow the CLI to override the value of this define for
// benchmarks with most timeline traces disabled.
if
(!
dartDefines
.
any
((
String
define
)
=>
define
.
startsWith
(
'dart.vm.profile'
)))
'-Ddart.vm.profile=true'
,
if
(!
dartDefines
.
any
((
String
define
)
=>
define
.
startsWith
(
'dart.vm.product'
)))
'-Ddart.vm.product=false'
,
];
case
BuildMode
.
release
:
return
<
String
>[
...
...
packages/flutter_tools/test/general.shard/compile_test.dart
View file @
0b72d5ca
...
...
@@ -89,16 +89,27 @@ void main() {
]);
});
testWithoutContext
(
'buildModeOptions removes matching profile define'
,
()
{
testWithoutContext
(
'buildModeOptions removes matching profile define
in debug mode
'
,
()
{
expect
(
buildModeOptions
(
BuildMode
.
debug
,
<
String
>[
'dart.vm.profile=true'
]),
<
String
>[
'-Ddart.vm.product=false'
,
'--enable-asserts'
,
]);
});
testWithoutContext
(
'buildModeOptions removes both matching profile and release define'
,
()
{
testWithoutContext
(
'buildModeOptions removes both matching profile and release define
in debug mode
'
,
()
{
expect
(
buildModeOptions
(
BuildMode
.
debug
,
<
String
>[
'dart.vm.profile=true'
,
'dart.vm.product=true'
]),
<
String
>[
'--enable-asserts'
,
]);
});
testWithoutContext
(
'buildModeOptions removes matching profile define in profile mode'
,
()
{
expect
(
buildModeOptions
(
BuildMode
.
profile
,
<
String
>[
'dart.vm.profile=true'
]),
<
String
>[
'-Ddart.vm.product=false'
,
]);
});
testWithoutContext
(
'buildModeOptions removes both matching profile and release define in profile mode'
,
()
{
expect
(
buildModeOptions
(
BuildMode
.
profile
,
<
String
>[
'dart.vm.profile=false'
,
'dart.vm.product=true'
]),
<
String
>[
]);
});
}
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