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
ade8dfac
Unverified
Commit
ade8dfac
authored
Nov 01, 2019
by
Emmanuel Garcia
Committed by
GitHub
Nov 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the plugin registrant to io.flutter.plugins and add the @Keep annotation (#44011)
parent
93ab9e64
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
30 deletions
+23
-30
MainActivity.kt
...m/example/android_embedding_v2_smoke_test/MainActivity.kt
+1
-1
MainActivity.java
...ng/app/src/main/java/io/flutter/add2app/MainActivity.java
+1
-1
MainActivity.java
...g/app/src/main/java/io/flutter/addtoapp/MainActivity.java
+1
-1
MainActivity.java
...g/app/src/main/java/io/flutter/addtoapp/MainActivity.java
+1
-1
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+11
-18
MainActivity.java.tmpl
...pp/src/main/java/androidIdentifier/MainActivity.java.tmpl
+1
-1
MainActivity.kt.tmpl
...pp/src/main/kotlin/androidIdentifier/MainActivity.kt.tmpl
+1
-1
MainActivity.java.tmpl
...c/main/java/androidIdentifier/host/MainActivity.java.tmpl
+1
-1
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+5
-5
No files found.
dev/integration_tests/android_embedding_v2_smoke_test/android/app/src/main/kotlin/com/example/android_embedding_v2_smoke_test/MainActivity.kt
View file @
ade8dfac
package
com.example.android_embedding_v2_smoke_test
import
androidx.annotation.NonNull;
import
dev.flutter.plugins.GeneratedPluginRegistrant
import
io.flutter.embedding.android.FlutterActivity
import
io.flutter.embedding.engine.FlutterEngine
import
io.flutter.plugins.GeneratedPluginRegistrant
class
MainActivity
:
FlutterActivity
()
{
override
fun
configureFlutterEngine
(
@NonNull
flutterEngine
:
FlutterEngine
)
{
...
...
dev/integration_tests/android_host_app_v2_embedding/app/src/main/java/io/flutter/add2app/MainActivity.java
View file @
ade8dfac
package
io
.
flutter
.
add2app
;
import
androidx.annotation.NonNull
;
import
dev.flutter.plugins.GeneratedPluginRegistrant
;
import
io.flutter.embedding.android.FlutterActivity
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.plugins.GeneratedPluginRegistrant
;
public
class
MainActivity
extends
FlutterActivity
{
@Override
...
...
dev/integration_tests/android_module_host_with_custom_build_v2_embedding/app/src/main/java/io/flutter/addtoapp/MainActivity.java
View file @
ade8dfac
package
io
.
flutter
.
add2app
;
import
androidx.annotation.NonNull
;
import
dev.flutter.plugins.GeneratedPluginRegistrant
;
import
io.flutter.embedding.android.FlutterActivity
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.plugins.GeneratedPluginRegistrant
;
public
class
MainActivity
extends
FlutterActivity
{
@Override
...
...
dev/integration_tests/module_host_with_custom_build_v2_embedding/app/src/main/java/io/flutter/addtoapp/MainActivity.java
View file @
ade8dfac
package
io
.
flutter
.
add2app
;
import
androidx.annotation.NonNull
;
import
dev.flutter.plugins.GeneratedPluginRegistrant
;
import
io.flutter.embedding.android.FlutterActivity
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.plugins.GeneratedPluginRegistrant
;
public
class
MainActivity
extends
FlutterActivity
{
@Override
...
...
packages/flutter_tools/lib/src/plugins.dart
View file @
ade8dfac
...
...
@@ -311,12 +311,14 @@ public final class GeneratedPluginRegistrant {
}
'''
;
const
String
_androidPluginRegistryTemplateNewEmbedding
=
'''package
dev
.flutter.plugins;
const
String
_androidPluginRegistryTemplateNewEmbedding
=
'''package
io
.flutter.plugins;
{{#androidX}}
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
{{/androidX}}
{{^androidX}}
import android.support.annotation.Keep;
import android.support.annotation.NonNull;
{{/androidX}}
import io.flutter.embedding.engine.FlutterEngine;
...
...
@@ -329,6 +331,7 @@ import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
{{#needsShim}}
...
...
@@ -399,10 +402,14 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
'main'
,
'java'
,
);
String
registryPath
;
final
String
registryPath
=
fs
.
path
.
join
(
javaSourcePath
,
'io'
,
'flutter'
,
'plugins'
,
'GeneratedPluginRegistrant.java'
,
);
String
templateContent
;
final
String
appEmbeddingVersion
=
_getAndroidEmbeddingVersion
(
project
);
switch
(
appEmbeddingVersion
)
{
case
'2'
:
...
...
@@ -415,23 +422,9 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
break
;
}
}
registryPath
=
fs
.
path
.
join
(
javaSourcePath
,
'dev'
,
'flutter'
,
'plugins'
,
'GeneratedPluginRegistrant.java'
,
);
templateContent
=
_androidPluginRegistryTemplateNewEmbedding
;
break
;
case
'1'
:
registryPath
=
fs
.
path
.
join
(
javaSourcePath
,
'io'
,
'flutter'
,
'plugins'
,
'GeneratedPluginRegistrant.java'
,
);
templateContent
=
_androidPluginRegistryTemplateOldEmbedding
;
break
;
default
:
...
...
packages/flutter_tools/templates/app/android-java.tmpl/app/src/main/java/androidIdentifier/MainActivity.java.tmpl
View file @
ade8dfac
...
...
@@ -7,9 +7,9 @@ import androidx.annotation.NonNull;
{{^
androidX
}}
import
android
.
support
.
annotation
.
NonNull
;
{{/
androidX
}}
import
dev
.
flutter
.
plugins
.
GeneratedPluginRegistrant
;
import
io
.
flutter
.
embedding
.
android
.
FlutterActivity
;
import
io
.
flutter
.
embedding
.
engine
.
FlutterEngine
;
import
io
.
flutter
.
plugins
.
GeneratedPluginRegistrant
;
public
class
MainActivity
extends
FlutterActivity
{
@
Override
...
...
packages/flutter_tools/templates/app/android-kotlin.tmpl/app/src/main/kotlin/androidIdentifier/MainActivity.kt.tmpl
View file @
ade8dfac
...
...
@@ -7,9 +7,9 @@ import androidx.annotation.NonNull;
{{^
androidX
}}
import
android
.
support
.
annotation
.
NonNull
;
{{/
androidX
}}
import
dev
.
flutter
.
plugins
.
GeneratedPluginRegistrant
import
io
.
flutter
.
embedding
.
android
.
FlutterActivity
import
io
.
flutter
.
embedding
.
engine
.
FlutterEngine
import
io
.
flutter
.
plugins
.
GeneratedPluginRegistrant
class
MainActivity
:
FlutterActivity
()
{
override
fun
configureFlutterEngine
(@
NonNull
flutterEngine
:
FlutterEngine
)
{
...
...
packages/flutter_tools/templates/module/android/host_app_common/app.tmpl/src/main/java/androidIdentifier/host/MainActivity.java.tmpl
View file @
ade8dfac
...
...
@@ -8,9 +8,9 @@ import androidx.annotation.NonNull;
{{^
androidX
}}
import
android
.
support
.
annotation
.
NonNull
;
{{/
androidX
}}
import
dev
.
flutter
.
plugins
.
GeneratedPluginRegistrant
;
import
io
.
flutter
.
embedding
.
android
.
FlutterActivity
;
import
io
.
flutter
.
embedding
.
engine
.
FlutterEngine
;
import
io
.
flutter
.
plugins
.
GeneratedPluginRegistrant
;
public
class
MainActivity
extends
FlutterActivity
{
@
Override
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
ade8dfac
...
...
@@ -190,11 +190,11 @@ void main() {
await
injectPlugins
(
flutterProject
);
final
File
registrant
=
flutterProject
.
directory
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'
dev
'
,
'flutter'
,
'plugins'
))
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'
io
'
,
'flutter'
,
'plugins'
))
.
childFile
(
'GeneratedPluginRegistrant.java'
);
expect
(
registrant
.
existsSync
(),
isTrue
);
expect
(
registrant
.
readAsStringSync
(),
contains
(
'package
dev
.flutter.plugins'
));
expect
(
registrant
.
readAsStringSync
(),
contains
(
'package
io
.flutter.plugins'
));
expect
(
registrant
.
readAsStringSync
(),
contains
(
'class GeneratedPluginRegistrant'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
...
...
@@ -282,7 +282,7 @@ plugin3:${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
await
injectPlugins
(
flutterProject
);
final
File
registrant
=
flutterProject
.
directory
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'
dev
'
,
'flutter'
,
'plugins'
))
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'
io
'
,
'flutter'
,
'plugins'
))
.
childFile
(
'GeneratedPluginRegistrant.java'
);
expect
(
registrant
.
readAsStringSync
(),
...
...
@@ -362,11 +362,11 @@ plugin3:${pluginUsingOldEmbeddingDir.childDirectory('lib').uri.toString()}
await
injectPlugins
(
flutterProject
);
final
File
registrant
=
flutterProject
.
directory
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'
dev
'
,
'flutter'
,
'plugins'
))
.
childDirectory
(
fs
.
path
.
join
(
'android'
,
'app'
,
'src'
,
'main'
,
'java'
,
'
io
'
,
'flutter'
,
'plugins'
))
.
childFile
(
'GeneratedPluginRegistrant.java'
);
expect
(
registrant
.
existsSync
(),
isTrue
);
expect
(
registrant
.
readAsStringSync
(),
contains
(
'package
dev
.flutter.plugins'
));
expect
(
registrant
.
readAsStringSync
(),
contains
(
'package
io
.flutter.plugins'
));
expect
(
registrant
.
readAsStringSync
(),
contains
(
'class GeneratedPluginRegistrant'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
...
...
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