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
1513b971
Unverified
Commit
1513b971
authored
Aug 03, 2020
by
Jenn Magder
Committed by
GitHub
Aug 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add integration test for plugins without ios directories (#62630)
parent
d261f1ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
4 deletions
+86
-4
plugin_dependencies_test.dart
dev/devicelab/bin/tasks/plugin_dependencies_test.dart
+86
-4
No files found.
dev/devicelab/bin/tasks/plugin_dependencies_test.dart
View file @
1513b971
...
@@ -78,6 +78,11 @@ Future<void> main() async {
...
@@ -78,6 +78,11 @@ Future<void> main() async {
);
);
});
});
checkDirectoryNotExists
(
path
.
join
(
pluginCDirectory
.
path
,
'android'
,
));
final
File
pluginCpubspec
=
File
(
path
.
join
(
pluginCDirectory
.
path
,
'pubspec.yaml'
));
final
File
pluginCpubspec
=
File
(
path
.
join
(
pluginCDirectory
.
path
,
'pubspec.yaml'
));
await
pluginCpubspec
.
writeAsString
(
'''
await
pluginCpubspec
.
writeAsString
(
'''
name: plugin_c
name: plugin_c
...
@@ -98,6 +103,27 @@ environment:
...
@@ -98,6 +103,27 @@ environment:
flutter: ">=1.5.0 <2.0.0"
flutter: ">=1.5.0 <2.0.0"
'''
,
flush:
true
);
'''
,
flush:
true
);
section
(
'Create plugin D without ios/ directory'
);
final
Directory
pluginDDirectory
=
Directory
(
path
.
join
(
tempDir
.
path
,
'plugin_d'
));
await
inDirectory
(
tempDir
,
()
async
{
await
flutter
(
'create'
,
options:
<
String
>[
'--org'
,
'io.flutter.devicelab.plugin_d'
,
'--template=plugin'
,
'--platforms=android'
,
pluginDDirectory
.
path
,
],
);
});
checkDirectoryNotExists
(
path
.
join
(
pluginDDirectory
.
path
,
'ios'
,
));
section
(
'Write dummy Kotlin code in plugin B'
);
section
(
'Write dummy Kotlin code in plugin B'
);
final
File
pluginBKotlinClass
=
File
(
path
.
join
(
final
File
pluginBKotlinClass
=
File
(
path
.
join
(
...
@@ -120,7 +146,7 @@ public class DummyPluginBClass {
...
@@ -120,7 +146,7 @@ public class DummyPluginBClass {
}
}
'''
,
flush:
true
);
'''
,
flush:
true
);
section
(
'Make plugin A depend on plugin B
and plugin C
'
);
section
(
'Make plugin A depend on plugin B
, C, and D
'
);
final
File
pluginApubspec
=
File
(
path
.
join
(
pluginADirectory
.
path
,
'pubspec.yaml'
));
final
File
pluginApubspec
=
File
(
path
.
join
(
pluginADirectory
.
path
,
'pubspec.yaml'
));
String
pluginApubspecContent
=
await
pluginApubspec
.
readAsString
();
String
pluginApubspecContent
=
await
pluginApubspec
.
readAsString
();
...
@@ -130,7 +156,9 @@ public class DummyPluginBClass {
...
@@ -130,7 +156,9 @@ public class DummyPluginBClass {
' plugin_b:
\n
'
' plugin_b:
\n
'
' path:
${pluginBDirectory.path}
\n
'
' path:
${pluginBDirectory.path}
\n
'
' plugin_c:
\n
'
' plugin_c:
\n
'
' path:
${pluginCDirectory.path}
\n
'
,
' path:
${pluginCDirectory.path}
\n
'
' plugin_d:
\n
'
' path:
${pluginDDirectory.path}
\n
'
,
);
);
await
pluginApubspec
.
writeAsString
(
pluginApubspecContent
,
flush:
true
);
await
pluginApubspec
.
writeAsString
(
pluginApubspecContent
,
flush:
true
);
...
@@ -187,7 +215,7 @@ public class DummyPluginAClass {
...
@@ -187,7 +215,7 @@ public class DummyPluginAClass {
'['
'['
'{'
'{'
'"name":"plugin_a",'
'"name":"plugin_a",'
'"dependencies":["plugin_b","plugin_c"]'
'"dependencies":["plugin_b","plugin_c"
,"plugin_d"
]'
'},'
'},'
'{'
'{'
'"name":"plugin_b",'
'"name":"plugin_b",'
...
@@ -196,6 +224,10 @@ public class DummyPluginAClass {
...
@@ -196,6 +224,10 @@ public class DummyPluginAClass {
'{'
'{'
'"name":"plugin_c",'
'"name":"plugin_c",'
'"dependencies":[]'
'"dependencies":[]'
'},'
'{'
'"name":"plugin_d",'
'"dependencies":[]'
'}'
'}'
']'
;
']'
;
final
String
graphString
=
json
.
encode
(
dependencyGraph
);
final
String
graphString
=
json
.
encode
(
dependencyGraph
);
...
@@ -206,7 +238,7 @@ public class DummyPluginAClass {
...
@@ -206,7 +238,7 @@ public class DummyPluginAClass {
);
);
}
}
section
(
'Build plugin A example app'
);
section
(
'Build plugin A example
Android
app'
);
final
StringBuffer
stderr
=
StringBuffer
();
final
StringBuffer
stderr
=
StringBuffer
();
await
inDirectory
(
exampleApp
,
()
async
{
await
inDirectory
(
exampleApp
,
()
async
{
...
@@ -237,6 +269,56 @@ public class DummyPluginAClass {
...
@@ -237,6 +269,56 @@ public class DummyPluginAClass {
return
TaskResult
.
failure
(
'Failed to build plugin A example APK'
);
return
TaskResult
.
failure
(
'Failed to build plugin A example APK'
);
}
}
if
(
Platform
.
isMacOS
)
{
section
(
'Build plugin A example iOS app'
);
await
inDirectory
(
exampleApp
,
()
async
{
await
evalFlutter
(
'build'
,
options:
<
String
>[
'ios'
,
'--no-codesign'
,
],
);
});
final
Directory
appBundle
=
Directory
(
path
.
join
(
pluginADirectory
.
path
,
'example'
,
'build'
,
'ios'
,
'iphoneos'
,
'Runner.app'
,
));
if
(!
exists
(
appBundle
))
{
return
TaskResult
.
failure
(
'Failed to build plugin A example iOS app'
);
}
checkDirectoryExists
(
path
.
join
(
appBundle
.
path
,
'Frameworks'
,
'plugin_a.framework'
,
));
checkDirectoryExists
(
path
.
join
(
appBundle
.
path
,
'Frameworks'
,
'plugin_b.framework'
,
));
checkDirectoryExists
(
path
.
join
(
appBundle
.
path
,
'Frameworks'
,
'plugin_c.framework'
,
));
// Plugin D is Android only and should not be embedded.
checkDirectoryNotExists
(
path
.
join
(
appBundle
.
path
,
'Frameworks'
,
'plugin_d.framework'
,
));
}
return
TaskResult
.
success
(
null
);
return
TaskResult
.
success
(
null
);
}
on
TaskResult
catch
(
taskResult
)
{
}
on
TaskResult
catch
(
taskResult
)
{
return
taskResult
;
return
taskResult
;
...
...
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