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
0093c6a4
Unverified
Commit
0093c6a4
authored
Jun 12, 2020
by
Jenn Magder
Committed by
GitHub
Jun 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Podfile migration warning to support federated plugins (#59201)
parent
97dc7eee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
18 deletions
+46
-18
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+31
-10
project.dart
packages/flutter_tools/lib/src/project.dart
+0
-7
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+15
-1
No files found.
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
0093c6a4
...
...
@@ -33,10 +33,15 @@ const String brokenCocoaPodsConsequence = '''
This
can
happen
if
the
version
of
Ruby
that
CocoaPods
was
installed
with
is
different
from
the
one
being
used
to
invoke
it
.
This
can
usually
be
fixed
by
re
-
installing
CocoaPods
.
For
more
info
,
see
https:
//github.com/flutter/flutter/issues/14293.''';
const
String
outOfDatePodfileConsequence
=
'''
const
String
outOfDate
Frameworks
PodfileConsequence
=
'''
This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes.
If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/24641 for instructions.'''
;
const
String
outOfDatePluginsPodfileConsequence
=
'''
This can cause issues if your application depends on plugins that do not support iOS.
See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms for details.
If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/45197 for instructions.'''
;
const
String
cocoaPodsInstallInstructions
=
'''
sudo gem install cocoapods'''
;
...
...
@@ -375,25 +380,41 @@ class CocoaPods {
}
}
// Previously, the Podfile created a symlink to the cached artifacts engine framework
// and installed the Flutter pod from that path. This could get out of sync with the copy
// of the Flutter engine that was copied to ios/Flutter by the xcode_backend script.
// It was possible for the symlink to point to a Debug version of the engine when the
// Xcode build configuration was Release, which caused App Store submission rejections.
//
// Warn the user if they are still symlinking to the framework.
void
_warnIfPodfileOutOfDate
(
XcodeBasedProject
xcodeProject
)
{
if
(
xcodeProject
is
!
IosProject
)
{
return
;
}
// Previously, the Podfile created a symlink to the cached artifacts engine framework
// and installed the Flutter pod from that path. This could get out of sync with the copy
// of the Flutter engine that was copied to ios/Flutter by the xcode_backend script.
// It was possible for the symlink to point to a Debug version of the engine when the
// Xcode build configuration was Release, which caused App Store submission rejections.
//
// Warn the user if they are still symlinking to the framework.
final
Link
flutterSymlink
=
_fileSystem
.
link
(
_fileSystem
.
path
.
join
(
xcodeProject
.
symlinks
.
path
,
(
xcodeProject
as
IosProject
)
.
symlinks
.
path
,
'flutter'
,
));
if
(
flutterSymlink
.
existsSync
())
{
_logger
.
printError
(
'Warning: Podfile is out of date
\n
'
'
$outOfDatePodfileConsequence
\n
'
'
$outOfDateFrameworksPodfileConsequence
\n
'
'To regenerate the Podfile, run:
\n
'
'
$podfileMigrationInstructions
\n
'
,
emphasis:
true
,
);
return
;
}
// Most of the pod and plugin parsing logic was moved from the Podfile
// into the tool's podhelper.rb script. If the Podfile still references
// the old parsed .flutter-plugins file, prompt the regeneration. Old line was:
// plugin_pods = parse_KV_file('../.flutter-plugins')
if
(
xcodeProject
.
podfile
.
existsSync
()
&&
xcodeProject
.
podfile
.
readAsStringSync
().
contains
(
'.flutter-plugins
\'
'
))
{
_logger
.
printError
(
'Warning: Podfile is out of date
\n
'
'
$outOfDatePluginsPodfileConsequence
\n
'
'To regenerate the Podfile, run:
\n
'
'
$podfileMigrationInstructions
\n
'
,
emphasis:
true
,
...
...
packages/flutter_tools/lib/src/project.dart
View file @
0093c6a4
...
...
@@ -324,9 +324,6 @@ abstract class XcodeBasedProject {
/// The CocoaPods 'Manifest.lock'.
File
get
podManifestLock
;
/// Directory containing symlinks to pub cache plugins source generated on `pod install`.
Directory
get
symlinks
;
}
/// Represents the iOS sub-project of a Flutter project.
...
...
@@ -389,7 +386,6 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// The default '
Info
.
plist
' file of the host app. The developer can change this location in Xcode.
File get defaultHostInfoPlist => hostAppRoot.childDirectory(_hostAppProjectName).childFile('
Info
.
plist
');
@override
Directory get symlinks => _flutterLibRoot.childDirectory('
.
symlinks
');
@override
...
...
@@ -970,9 +966,6 @@ class MacOSProject extends FlutterProjectPlatform implements XcodeBasedProject {
@override
Directory
get
xcodeWorkspace
=>
_macOSDirectory
.
childDirectory
(
'
$_hostAppProjectName
.xcworkspace'
);
@override
Directory
get
symlinks
=>
ephemeralDirectory
.
childDirectory
(
'.symlinks'
);
/// The file where the Xcode build will write the name of the built app.
///
/// Ideally this will be replaced in the future with inspection of the Runner
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
0093c6a4
...
...
@@ -355,7 +355,7 @@ void main() {
));
});
testWithoutContext
(
'prints warning, if Podfile
is out of date
'
,
()
async
{
testWithoutContext
(
'prints warning, if Podfile
creates the Flutter engine symlink
'
,
()
async
{
pretendPodIsInstalled
();
fs
.
file
(
fs
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
...
...
@@ -373,6 +373,20 @@ void main() {
expect
(
logger
.
errorText
,
contains
(
'Warning: Podfile is out of date'
));
});
testWithoutContext
(
'prints warning, if Podfile parses .flutter-plugins'
,
()
async
{
pretendPodIsInstalled
();
fs
.
file
(
fs
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
..
createSync
()
..
writeAsStringSync
(
'plugin_pods = parse_KV_file(
\'
../.flutter-plugins
\'
)'
);
await
cocoaPodsUnderTest
.
processPods
(
xcodeProject:
projectUnderTest
.
ios
,
engineDir:
'engine/path'
,
);
expect
(
logger
.
errorText
,
contains
(
'Warning: Podfile is out of date'
));
});
testWithoutContext
(
'throws, if Podfile is missing.'
,
()
async
{
pretendPodIsInstalled
();
try
{
...
...
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