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
9eb9ea0f
Unverified
Commit
9eb9ea0f
authored
Jan 14, 2020
by
xster
Committed by
GitHub
Jan 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let the tool warn about all old API plugins (#48282)
parent
e1812c82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+0
-1
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+31
-6
No files found.
packages/flutter_tools/lib/src/plugins.dart
View file @
9eb9ea0f
...
...
@@ -497,7 +497,6 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
'following https://flutter.dev/go/android-plugin-migration.'
);
}
break
;
}
}
templateContent
=
_androidPluginRegistryTemplateNewEmbedding
;
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
9eb9ea0f
...
...
@@ -129,7 +129,7 @@ flutter:
);
}
void
createOldJavaPlugin
3
(
)
{
void
createOldJavaPlugin
(
String
pluginName
)
{
final
Directory
pluginUsingOldEmbeddingDir
=
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_plugin_using_old_embedding_dir.'
);
pluginUsingOldEmbeddingDir
...
...
@@ -137,7 +137,7 @@ flutter:
.
writeAsStringSync
(
'''
flutter:
plugin:
androidPackage:
plugin3
androidPackage:
$pluginName
pluginClass: UseOldEmbedding
'''
);
pluginUsingOldEmbeddingDir
...
...
@@ -145,14 +145,14 @@ flutter:
.
childDirectory
(
'src'
)
.
childDirectory
(
'main'
)
.
childDirectory
(
'java'
)
.
childDirectory
(
'plugin3'
)
.
childDirectory
(
pluginName
)
.
childFile
(
'UseOldEmbedding.java'
)
..
createSync
(
recursive:
true
);
flutterProject
.
directory
.
childFile
(
'.packages'
)
.
writeAsStringSync
(
'
plugin3
:
${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
\n
'
,
'
$pluginName
:
${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
\n
'
,
mode:
FileMode
.
append
,
);
}
...
...
@@ -379,7 +379,7 @@ dependencies:
createNewJavaPlugin1
();
createNewKotlinPlugin2
();
createOldJavaPlugin
3
(
);
createOldJavaPlugin
(
'plugin3'
);
await
injectPlugins
(
flutterProject
);
...
...
@@ -497,7 +497,7 @@ dependencies:
when
(
flutterProject
.
isModule
).
thenReturn
(
true
);
when
(
androidProject
.
getEmbeddingVersion
()).
thenReturn
(
AndroidEmbeddingVersion
.
v2
);
createOldJavaPlugin
3
(
);
createOldJavaPlugin
(
'plugin3'
);
await
injectPlugins
(
flutterProject
);
...
...
@@ -558,6 +558,31 @@ dependencies:
XcodeProjectInterpreter:
()
=>
xcodeProjectInterpreter
,
});
testUsingContext
(
'Module using multiple old plugins all show warnings'
,
()
async
{
when
(
flutterProject
.
isModule
).
thenReturn
(
true
);
when
(
androidProject
.
getEmbeddingVersion
()).
thenReturn
(
AndroidEmbeddingVersion
.
v2
);
createOldJavaPlugin
(
'plugin3'
);
createOldJavaPlugin
(
'plugin4'
);
await
injectPlugins
(
flutterProject
);
final
File
registrant
=
flutterProject
.
directory
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'io'
,
'flutter'
,
'plugins'
))
.
childFile
(
'GeneratedPluginRegistrant.java'
);
expect
(
registrant
.
readAsStringSync
(),
contains
(
'plugin3.UseOldEmbedding.registerWith(shimPluginRegistry.registrarFor("plugin3.UseOldEmbedding"));'
));
expect
(
registrant
.
readAsStringSync
(),
contains
(
'plugin4.UseOldEmbedding.registerWith(shimPluginRegistry.registrarFor("plugin4.UseOldEmbedding"));'
));
expect
(
testLogger
.
statusText
,
contains
(
'The plugin `plugin3` is built using an older version of the Android plugin API'
));
expect
(
testLogger
.
statusText
,
contains
(
'The plugin `plugin4` is built using an older version of the Android plugin API'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FeatureFlags:
()
=>
featureFlags
,
XcodeProjectInterpreter:
()
=>
xcodeProjectInterpreter
,
});
testUsingContext
(
'Does not throw when AndroidManifest.xml is not found'
,
()
async
{
when
(
flutterProject
.
isModule
).
thenReturn
(
false
);
...
...
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