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
853c8c56
Commit
853c8c56
authored
Dec 17, 2019
by
Alek Åström
Committed by
Flutter GitHub Bot
Dec 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Add violating plugin name to validation errors (#46601)
parent
56f4eaf5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
AUTHORS
AUTHORS
+1
-0
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+3
-3
plugin_parsing_test.dart
...flutter_tools/test/general.shard/plugin_parsing_test.dart
+13
-0
No files found.
AUTHORS
View file @
853c8c56
...
...
@@ -48,3 +48,4 @@ Rody Davis Jr <rody.davis.jr@gmail.com>
Robin Jespersen <info@unitedpartners.de>
Jefferson Quesado <jeff.quesado@gmail.com>
Mark Diener <rpzrpzrpz@gmail.com>
Alek Åström <alek.astrom@gmail.com>
packages/flutter_tools/lib/src/plugins.dart
View file @
853c8c56
...
...
@@ -74,7 +74,7 @@ class Plugin {
)
{
final
List
<
String
>
errors
=
validatePluginYaml
(
pluginYaml
);
if
(
errors
.
isNotEmpty
)
{
throwToolExit
(
'Invalid plugin specification.
\n
${errors.join('\n')}
'
);
throwToolExit
(
'Invalid plugin specification
$name
.
\n
${errors.join('\n')}
'
);
}
if
(
pluginYaml
!=
null
&&
pluginYaml
[
'platforms'
]
!=
null
)
{
return
Plugin
.
_fromMultiPlatformYaml
(
name
,
path
,
pluginYaml
,
dependencies
);
...
...
@@ -89,11 +89,11 @@ class Plugin {
List
<
String
>
dependencies
,
)
{
assert
(
pluginYaml
!=
null
&&
pluginYaml
[
'platforms'
]
!=
null
,
'Invalid multi-platform plugin specification.'
);
'Invalid multi-platform plugin specification
$name
.'
);
final
YamlMap
platformsYaml
=
pluginYaml
[
'platforms'
]
as
YamlMap
;
assert
(
_validateMultiPlatformYaml
(
platformsYaml
).
isEmpty
,
'Invalid multi-platform plugin specification.'
);
'Invalid multi-platform plugin specification
$name
.'
);
final
Map
<
String
,
PluginPlatform
>
platforms
=
<
String
,
PluginPlatform
>{};
...
...
packages/flutter_tools/test/general.shard/plugin_parsing_test.dart
View file @
853c8c56
...
...
@@ -122,6 +122,19 @@ void main() {
expect
(
windowsPlugin
.
pluginClass
,
'WinSamplePlugin'
);
});
test
(
'Legacy Format and Multi-Platform Format together is not allowed and error message contains plugin name'
,
()
{
const
String
pluginYamlRaw
=
'androidPackage: com.flutter.dev
\n
'
'platforms:
\n
'
' android:
\n
'
' package: com.flutter.dev
\n
'
;
final
YamlMap
pluginYaml
=
loadYaml
(
pluginYamlRaw
)
as
YamlMap
;
expect
(
()
=>
Plugin
.
fromYaml
(
_kTestPluginName
,
_kTestPluginPath
,
pluginYaml
,
const
<
String
>[]),
throwsToolExit
(
message:
_kTestPluginName
),
);
});
test
(
'A default_package field is allowed'
,
()
{
const
String
pluginYamlRaw
=
'platforms:
\n
'
...
...
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