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
5a6d2a0a
Unverified
Commit
5a6d2a0a
authored
Mar 30, 2021
by
Jenn Magder
Committed by
GitHub
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for outdated Podfile before running pod install (#79343)
parent
f59b185b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+1
-1
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+6
-16
No files found.
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
5a6d2a0a
...
@@ -162,6 +162,7 @@ class CocoaPods {
...
@@ -162,6 +162,7 @@ class CocoaPods {
if
(!
xcodeProject
.
podfile
.
existsSync
())
{
if
(!
xcodeProject
.
podfile
.
existsSync
())
{
throwToolExit
(
'Podfile missing'
);
throwToolExit
(
'Podfile missing'
);
}
}
_warnIfPodfileOutOfDate
(
xcodeProject
);
bool
podsProcessed
=
false
;
bool
podsProcessed
=
false
;
if
(
_shouldRunPodInstall
(
xcodeProject
,
dependenciesChanged
))
{
if
(
_shouldRunPodInstall
(
xcodeProject
,
dependenciesChanged
))
{
if
(!
await
_checkPodCondition
())
{
if
(!
await
_checkPodCondition
())
{
...
@@ -170,7 +171,6 @@ class CocoaPods {
...
@@ -170,7 +171,6 @@ class CocoaPods {
await
_runPodInstall
(
xcodeProject
,
buildMode
);
await
_runPodInstall
(
xcodeProject
,
buildMode
);
podsProcessed
=
true
;
podsProcessed
=
true
;
}
}
_warnIfPodfileOutOfDate
(
xcodeProject
);
return
podsProcessed
;
return
podsProcessed
;
}
}
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
5a6d2a0a
...
@@ -20,6 +20,7 @@ import 'package:test/fake.dart';
...
@@ -20,6 +20,7 @@ import 'package:test/fake.dart';
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/fake_process_manager.dart'
;
typedef
InvokeProcess
=
Future
<
ProcessResult
>
Function
();
typedef
InvokeProcess
=
Future
<
ProcessResult
>
Function
();
...
@@ -322,6 +323,7 @@ void main() {
...
@@ -322,6 +323,7 @@ void main() {
buildMode:
BuildMode
.
debug
,
buildMode:
BuildMode
.
debug
,
),
throwsToolExit
(
message:
'CocoaPods not installed or not in valid state'
));
),
throwsToolExit
(
message:
'CocoaPods not installed or not in valid state'
));
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
testWithoutContext
(
'throwsToolExit if CocoaPods install is broken'
,
()
async
{
testWithoutContext
(
'throwsToolExit if CocoaPods install is broken'
,
()
async
{
...
@@ -332,17 +334,10 @@ void main() {
...
@@ -332,17 +334,10 @@ void main() {
buildMode:
BuildMode
.
debug
,
buildMode:
BuildMode
.
debug
,
),
throwsToolExit
(
message:
'CocoaPods not installed or not in valid state'
));
),
throwsToolExit
(
message:
'CocoaPods not installed or not in valid state'
));
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
testWithoutContext
(
'exits if Podfile creates the Flutter engine symlink'
,
()
async
{
testWithoutContext
(
'exits if Podfile creates the Flutter engine symlink'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.10.0'
);
fakeProcessManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
),
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
..
createSync
()
..
createSync
()
..
writeAsStringSync
(
'Existing Podfile'
);
..
writeAsStringSync
(
'Existing Podfile'
);
...
@@ -355,17 +350,10 @@ void main() {
...
@@ -355,17 +350,10 @@ void main() {
xcodeProject:
projectUnderTest
.
ios
,
xcodeProject:
projectUnderTest
.
ios
,
buildMode:
BuildMode
.
debug
,
buildMode:
BuildMode
.
debug
,
),
throwsToolExit
(
message:
'Podfile is out of date'
));
),
throwsToolExit
(
message:
'Podfile is out of date'
));
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
testWithoutContext
(
'exits if iOS Podfile parses .flutter-plugins'
,
()
async
{
testWithoutContext
(
'exits if iOS Podfile parses .flutter-plugins'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.10.0'
);
fakeProcessManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
),
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
..
createSync
()
..
createSync
()
..
writeAsStringSync
(
'plugin_pods = parse_KV_file(
\'
../.flutter-plugins
\'
)'
);
..
writeAsStringSync
(
'plugin_pods = parse_KV_file(
\'
../.flutter-plugins
\'
)'
);
...
@@ -374,6 +362,7 @@ void main() {
...
@@ -374,6 +362,7 @@ void main() {
xcodeProject:
projectUnderTest
.
ios
,
xcodeProject:
projectUnderTest
.
ios
,
buildMode:
BuildMode
.
debug
,
buildMode:
BuildMode
.
debug
,
),
throwsToolExit
(
message:
'Podfile is out of date'
));
),
throwsToolExit
(
message:
'Podfile is out of date'
));
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
testWithoutContext
(
'prints warning if macOS Podfile parses .flutter-plugins'
,
()
async
{
testWithoutContext
(
'prints warning if macOS Podfile parses .flutter-plugins'
,
()
async
{
...
@@ -396,6 +385,7 @@ void main() {
...
@@ -396,6 +385,7 @@ void main() {
expect
(
logger
.
errorText
,
contains
(
'Warning: Podfile is out of date'
));
expect
(
logger
.
errorText
,
contains
(
'Warning: Podfile is out of date'
));
expect
(
logger
.
errorText
,
contains
(
'rm macos/Podfile'
));
expect
(
logger
.
errorText
,
contains
(
'rm macos/Podfile'
));
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
});
});
testWithoutContext
(
'throws, if Podfile is missing.'
,
()
async
{
testWithoutContext
(
'throws, if Podfile is missing.'
,
()
async
{
...
...
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