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
e69b4346
Unverified
Commit
e69b4346
authored
Aug 13, 2018
by
Mikkel Nygaard Ravn
Committed by
GitHub
Aug 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken Flutter module with plugins (#20496)
parent
ba723b60
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
6 deletions
+21
-6
module_test.dart
dev/devicelab/bin/tasks/module_test.dart
+11
-0
cocoapods.dart
packages/flutter_tools/lib/src/ios/cocoapods.dart
+4
-3
Flutter.java
...Flutter.tmpl/src/main/java/io/flutter/facade/Flutter.java
+5
-2
cocoapods_test.dart
packages/flutter_tools/test/ios/cocoapods_test.dart
+1
-1
No files found.
dev/devicelab/bin/tasks/module_test.dart
View file @
e69b4346
...
@@ -31,6 +31,17 @@ Future<Null> main() async {
...
@@ -31,6 +31,17 @@ Future<Null> main() async {
);
);
});
});
section
(
'Add plugins'
);
final
File
pubspec
=
new
File
(
path
.
join
(
directory
.
path
,
'hello'
,
'pubspec.yaml'
));
String
content
=
await
pubspec
.
readAsString
();
content
=
content
.
replaceFirst
(
'
\n
dependencies:
\n
'
,
'
\n
dependencies:
\n
battery:
\n
package_info:
\n
'
,
);
await
pubspec
.
writeAsString
(
content
,
flush:
true
);
section
(
'Build Flutter module library archive'
);
section
(
'Build Flutter module library archive'
);
await
inDirectory
(
new
Directory
(
path
.
join
(
directory
.
path
,
'hello'
,
'.android'
)),
()
async
{
await
inDirectory
(
new
Directory
(
path
.
join
(
directory
.
path
,
'hello'
,
'.android'
)),
()
async
{
...
...
packages/flutter_tools/lib/src/ios/cocoapods.dart
View file @
e69b4346
...
@@ -148,7 +148,7 @@ class CocoaPods {
...
@@ -148,7 +148,7 @@ class CocoaPods {
return
true
;
return
true
;
}
}
/// Ensures the
`ios` sub-project of the Flutter project at [appDirectory]
/// Ensures the
given iOS sub-project of a parent Flutter project
/// contains a suitable `Podfile` and that its `Flutter/Xxx.xcconfig` files
/// contains a suitable `Podfile` and that its `Flutter/Xxx.xcconfig` files
/// include pods configuration.
/// include pods configuration.
void
setupPodfile
(
IosProject
iosProject
)
{
void
setupPodfile
(
IosProject
iosProject
)
{
...
@@ -156,13 +156,14 @@ class CocoaPods {
...
@@ -156,13 +156,14 @@ class CocoaPods {
// Don't do anything for iOS when host platform doesn't support it.
// Don't do anything for iOS when host platform doesn't support it.
return
;
return
;
}
}
if
(!
iosProject
.
directory
.
existsSync
())
{
final
Directory
runnerProject
=
iosProject
.
directory
.
childDirectory
(
'Runner.xcodeproj'
);
if
(!
runnerProject
.
existsSync
())
{
return
;
return
;
}
}
final
File
podfile
=
iosProject
.
podfile
;
final
File
podfile
=
iosProject
.
podfile
;
if
(!
podfile
.
existsSync
())
{
if
(!
podfile
.
existsSync
())
{
final
bool
isSwift
=
xcodeProjectInterpreter
.
getBuildSettings
(
final
bool
isSwift
=
xcodeProjectInterpreter
.
getBuildSettings
(
iosProject
.
directory
.
childFile
(
'Runner.xcodeproj'
)
.
path
,
runnerProject
.
path
,
'Runner'
,
'Runner'
,
).
containsKey
(
'SWIFT_VERSION'
);
).
containsKey
(
'SWIFT_VERSION'
);
final
File
podfileTemplate
=
fs
.
file
(
fs
.
path
.
join
(
final
File
podfileTemplate
=
fs
.
file
(
fs
.
path
.
join
(
...
...
packages/flutter_tools/templates/module/android/Flutter.tmpl/src/main/java/io/flutter/facade/Flutter.java
View file @
e69b4346
...
@@ -12,6 +12,7 @@ import io.flutter.plugin.common.BasicMessageChannel;
...
@@ -12,6 +12,7 @@ import io.flutter.plugin.common.BasicMessageChannel;
import
io.flutter.plugin.common.StringCodec
;
import
io.flutter.plugin.common.StringCodec
;
import
io.flutter.view.FlutterMain
;
import
io.flutter.view.FlutterMain
;
import
io.flutter.view.FlutterNativeView
;
import
io.flutter.view.FlutterNativeView
;
import
io.flutter.view.FlutterRunArguments
;
import
io.flutter.view.FlutterView
;
import
io.flutter.view.FlutterView
;
import
io.flutter.plugins.GeneratedPluginRegistrant
;
import
io.flutter.plugins.GeneratedPluginRegistrant
;
...
@@ -91,8 +92,10 @@ public final class Flutter {
...
@@ -91,8 +92,10 @@ public final class Flutter {
lifecycle
.
addObserver
(
new
LifecycleObserver
()
{
lifecycle
.
addObserver
(
new
LifecycleObserver
()
{
@OnLifecycleEvent
(
Lifecycle
.
Event
.
ON_CREATE
)
@OnLifecycleEvent
(
Lifecycle
.
Event
.
ON_CREATE
)
public
void
onCreate
()
{
public
void
onCreate
()
{
final
String
appBundlePath
=
FlutterMain
.
findAppBundlePath
(
activity
.
getApplicationContext
());
final
FlutterRunArguments
arguments
=
new
FlutterRunArguments
();
flutterView
.
runFromBundle
(
appBundlePath
,
null
,
"main"
,
true
);
arguments
.
bundlePath
=
FlutterMain
.
findAppBundlePath
(
activity
.
getApplicationContext
());
arguments
.
entrypoint
=
"main"
;
flutterView
.
runFromBundle
(
arguments
);
GeneratedPluginRegistrant
.
registerWith
(
flutterView
.
getPluginRegistry
());
GeneratedPluginRegistrant
.
registerWith
(
flutterView
.
getPluginRegistry
());
}
}
...
...
packages/flutter_tools/test/ios/cocoapods_test.dart
View file @
e69b4346
...
@@ -46,7 +46,7 @@ void main() {
...
@@ -46,7 +46,7 @@ void main() {
mockProcessManager
=
new
MockProcessManager
();
mockProcessManager
=
new
MockProcessManager
();
mockXcodeProjectInterpreter
=
new
MockXcodeProjectInterpreter
();
mockXcodeProjectInterpreter
=
new
MockXcodeProjectInterpreter
();
projectUnderTest
=
await
FlutterProject
.
fromDirectory
(
fs
.
directory
(
'project'
));
projectUnderTest
=
await
FlutterProject
.
fromDirectory
(
fs
.
directory
(
'project'
));
projectUnderTest
.
ios
.
directory
.
createSync
(
recursive:
true
);
projectUnderTest
.
ios
.
directory
.
c
hildDirectory
(
'Runner.xcodeproj'
).
c
reateSync
(
recursive:
true
);
cocoaPodsUnderTest
=
new
CocoaPods
();
cocoaPodsUnderTest
=
new
CocoaPods
();
pretendPodVersionIs
(
'1.5.0'
);
pretendPodVersionIs
(
'1.5.0'
);
fs
.
file
(
fs
.
path
.
join
(
fs
.
file
(
fs
.
path
.
join
(
...
...
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