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
33e7af72
Unverified
Commit
33e7af72
authored
Aug 22, 2019
by
Jonah Williams
Committed by
GitHub
Aug 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont throw StateError when calling assemble with bad target (#39000)
parent
1096ea38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
assemble.dart
packages/flutter_tools/lib/src/commands/assemble.dart
+6
-1
assemble_test.dart
...tter_tools/test/general.shard/commands/assemble_test.dart
+10
-0
No files found.
packages/flutter_tools/lib/src/commands/assemble.dart
View file @
33e7af72
...
...
@@ -71,7 +71,12 @@ class AssembleCommand extends FlutterCommand {
throwToolExit
(
'missing target name for flutter assemble.'
);
}
final
String
name
=
argResults
.
rest
.
first
;
return
_kDefaultTargets
.
firstWhere
((
Target
target
)
=>
target
.
name
==
name
);
final
Target
result
=
_kDefaultTargets
.
firstWhere
((
Target
target
)
=>
target
.
name
==
name
,
orElse:
()
=>
null
);
if
(
result
==
null
)
{
throwToolExit
(
'No target named "{target.name} defined."'
);
}
return
result
;
}
/// The environmental configuration for a build invocation.
...
...
packages/flutter_tools/test/general.shard/commands/assemble_test.dart
View file @
33e7af72
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'package:args/command_runner.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/build_system/build_system.dart'
;
...
...
@@ -41,6 +42,15 @@ void main() {
expect
(
bufferLogger
.
statusText
.
trim
(),
'build succeeded.'
);
}));
test
(
'Throws ToolExit if called with non-existent rule'
,
()
=>
testbed
.
run
(()
async
{
when
(
mockBuildSystem
.
build
(
any
,
any
,
buildSystemConfig:
anyNamed
(
'buildSystemConfig'
)))
.
thenAnswer
((
Invocation
invocation
)
async
{
return
BuildResult
(
success:
true
);
});
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
AssembleCommand
());
expect
(
commandRunner
.
run
(<
String
>[
'assemble'
,
'undefined'
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
}));
test
(
'Only writes input and output files when the values change'
,
()
=>
testbed
.
run
(()
async
{
when
(
mockBuildSystem
.
build
(
any
,
any
,
buildSystemConfig:
anyNamed
(
'buildSystemConfig'
)))
.
thenAnswer
((
Invocation
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