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 = '''
...
@@ -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
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.''';
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.
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.'''
;
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
=
'''
const
String
cocoaPodsInstallInstructions
=
'''
sudo gem install cocoapods'''
;
sudo gem install cocoapods'''
;
...
@@ -375,25 +380,41 @@ class 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
)
{
void
_warnIfPodfileOutOfDate
(
XcodeBasedProject
xcodeProject
)
{
if
(
xcodeProject
is
!
IosProject
)
{
if
(
xcodeProject
is
!
IosProject
)
{
return
;
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
(
final
Link
flutterSymlink
=
_fileSystem
.
link
(
_fileSystem
.
path
.
join
(
xcodeProject
.
symlinks
.
path
,
(
xcodeProject
as
IosProject
)
.
symlinks
.
path
,
'flutter'
,
'flutter'
,
));
));
if
(
flutterSymlink
.
existsSync
())
{
if
(
flutterSymlink
.
existsSync
())
{
_logger
.
printError
(
_logger
.
printError
(
'Warning: Podfile is out of date
\n
'
'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
'
'To regenerate the Podfile, run:
\n
'
'
$podfileMigrationInstructions
\n
'
,
'
$podfileMigrationInstructions
\n
'
,
emphasis:
true
,
emphasis:
true
,
...
...
packages/flutter_tools/lib/src/project.dart
View file @
0093c6a4
...
@@ -324,9 +324,6 @@ abstract class XcodeBasedProject {
...
@@ -324,9 +324,6 @@ abstract class XcodeBasedProject {
/// The CocoaPods 'Manifest.lock'.
/// The CocoaPods 'Manifest.lock'.
File
get
podManifestLock
;
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.
/// Represents the iOS sub-project of a Flutter project.
...
@@ -389,7 +386,6 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -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.
/// 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
');
File get defaultHostInfoPlist => hostAppRoot.childDirectory(_hostAppProjectName).childFile('
Info
.
plist
');
@override
Directory get symlinks => _flutterLibRoot.childDirectory('
.
symlinks
');
Directory get symlinks => _flutterLibRoot.childDirectory('
.
symlinks
');
@override
@override
...
@@ -970,9 +966,6 @@ class MacOSProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -970,9 +966,6 @@ class MacOSProject extends FlutterProjectPlatform implements XcodeBasedProject {
@override
@override
Directory
get
xcodeWorkspace
=>
_macOSDirectory
.
childDirectory
(
'
$_hostAppProjectName
.xcworkspace'
);
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.
/// 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
/// 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() {
...
@@ -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
();
pretendPodIsInstalled
();
fs
.
file
(
fs
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
fs
.
file
(
fs
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
...
@@ -373,6 +373,20 @@ void main() {
...
@@ -373,6 +373,20 @@ void main() {
expect
(
logger
.
errorText
,
contains
(
'Warning: Podfile is out of date'
));
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
{
testWithoutContext
(
'throws, if Podfile is missing.'
,
()
async
{
pretendPodIsInstalled
();
pretendPodIsInstalled
();
try
{
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