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
f264d6c2
Unverified
Commit
f264d6c2
authored
Dec 09, 2019
by
Emmanuel Garcia
Committed by
GitHub
Dec 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow plugins that don't support the Android platform (#46282)
parent
37384f25
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
8 deletions
+51
-8
plugin_dependencies_test.dart
dev/devicelab/bin/tasks/plugin_dependencies_test.dart
+50
-7
flutter.gradle
packages/flutter_tools/gradle/flutter.gradle
+1
-1
No files found.
dev/devicelab/bin/tasks/plugin_dependencies_test.dart
View file @
f264d6c2
...
...
@@ -59,6 +59,43 @@ Future<void> main() async {
);
});
section
(
'Create plugin C without android/ directory'
);
final
Directory
pluginCDirectory
=
Directory
(
path
.
join
(
tempDir
.
path
,
'plugin_c'
));
await
inDirectory
(
tempDir
,
()
async
{
await
flutter
(
'create'
,
options:
<
String
>[
'--org'
,
'io.flutter.devicelab.plugin_c'
,
'--template=plugin'
,
pluginCDirectory
.
path
,
],
);
});
File
(
path
.
join
(
pluginCDirectory
.
path
,
'android'
)).
deleteSync
(
recursive:
true
);
final
File
pluginCpubspec
=
File
(
path
.
join
(
pluginCDirectory
.
path
,
'pubspec.yaml'
));
await
pluginCpubspec
.
writeAsString
(
'''
name: plugin_c
version: 0.0.1
flutter:
plugin:
platforms:
ios:
pluginClass: Plugin_cPlugin
dependencies:
flutter:
sdk: flutter
environment:
sdk: ">=2.0.0-dev.28.0 <3.0.0"
flutter: ">=1.5.0 <2.0.0"
'''
,
flush:
true
);
section
(
'Write dummy Kotlin code in plugin B'
);
final
File
pluginBKotlinClass
=
File
(
path
.
join
(
...
...
@@ -81,17 +118,19 @@ public class DummyPluginBClass {
}
'''
,
flush:
true
);
section
(
'Make plugin A depend on plugin B'
);
section
(
'Make plugin A depend on plugin B
and plugin C
'
);
final
File
pubspec
=
File
(
path
.
join
(
pluginADirectory
.
path
,
'pubspec.yaml'
));
String
content
=
await
pubspec
.
readAsString
();
content
=
c
ontent
.
replaceFirst
(
final
File
p
luginAp
ubspec
=
File
(
path
.
join
(
pluginADirectory
.
path
,
'pubspec.yaml'
));
String
pluginApubspecContent
=
await
pluginA
pubspec
.
readAsString
();
pluginApubspecContent
=
pluginApubspecC
ontent
.
replaceFirst
(
'
\n
dependencies:
\n
'
,
'
\n
dependencies:
\n
'
' plugin_b:
\n
'
' path:
${pluginBDirectory.path}
\n
'
,
' path:
${pluginBDirectory.path}
\n
'
' plugin_c:
\n
'
' path:
${pluginCDirectory.path}
\n
'
,
);
await
p
ubspec
.
writeAsString
(
c
ontent
,
flush:
true
);
await
p
luginApubspec
.
writeAsString
(
pluginApubspecC
ontent
,
flush:
true
);
section
(
'Write Kotlin code in plugin A that references Kotlin code from plugin B'
);
...
...
@@ -142,11 +181,15 @@ public class DummyPluginAClass {
'
\"
dependencyGraph
\"
:['
'{'
'
\"
name
\"
:
\"
plugin_a
\"
,'
'
\"
dependencies
\"
:[
\"
plugin_b
\"
]'
'
\"
dependencies
\"
:[
\"
plugin_b
\"
,
\"
plugin_c
\"
]'
'},'
'{'
'
\"
name
\"
:
\"
plugin_b
\"
,'
'
\"
dependencies
\"
:[]'
'},'
'{'
'
\"
name
\"
:
\"
plugin_c
\"
,'
'
\"
dependencies
\"
:[]'
'}'
']'
'}'
;
...
...
packages/flutter_tools/gradle/flutter.gradle
View file @
f264d6c2
...
...
@@ -349,7 +349,7 @@ class FlutterPlugin implements Plugin<Project> {
return
}
Project
dependencyProject
=
project
.
rootProject
.
findProject
(
":$pluginDependencyName"
)
if
(
dependencyProject
==
null
)
{
if
(
!
dependencyProject
.
projectDir
.
exists
()
||
dependencyProject
==
null
)
{
return
}
// Wait for the Android plugin to load and add the dependency to the plugin project.
...
...
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