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
e54e53c1
Unverified
Commit
e54e53c1
authored
Jan 07, 2019
by
Stanislav Baranov
Committed by
GitHub
Jan 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error messages for flutter tool --dynamic flag. (#26107)
parent
4b474d61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+14
-3
No files found.
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
e54e53c1
...
...
@@ -237,8 +237,7 @@ abstract class FlutterCommand extends Command<void> {
argParser
.
addFlag
(
'dynamic'
,
hide:
!
verboseHelp
,
negatable:
false
,
help:
'Enable dynamic code. This flag is intended for use with
\n
'
'--release or --profile; --debug always has this enabled.'
);
help:
'Enable dynamic code. Only allowed with --release or --profile.'
);
}
void
addDynamicModeFlags
({
bool
verboseHelp
=
false
})
{
...
...
@@ -328,12 +327,24 @@ abstract class FlutterCommand extends Command<void> {
final
bool
dynamicFlag
=
argParser
.
options
.
containsKey
(
'dynamic'
)
?
argResults
[
'dynamic'
]
:
false
;
if
(
argResults
[
'debug'
])
if
(
argResults
[
'debug'
])
{
if
(
dynamicFlag
)
throw
ToolExit
(
'Error: --dynamic requires --release or --profile.'
);
return
BuildMode
.
debug
;
}
if
(
argResults
[
'profile'
])
return
dynamicFlag
?
BuildMode
.
dynamicProfile
:
BuildMode
.
profile
;
if
(
argResults
[
'release'
])
return
dynamicFlag
?
BuildMode
.
dynamicRelease
:
BuildMode
.
release
;
if
(
_defaultBuildMode
==
BuildMode
.
debug
&&
dynamicFlag
)
throw
ToolExit
(
'Error: --dynamic requires --release or --profile.'
);
if
(
_defaultBuildMode
==
BuildMode
.
release
&&
dynamicFlag
)
return
BuildMode
.
dynamicRelease
;
if
(
_defaultBuildMode
==
BuildMode
.
profile
&&
dynamicFlag
)
return
BuildMode
.
dynamicProfile
;
return
_defaultBuildMode
;
}
...
...
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