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
23f5fbc6
Unverified
Commit
23f5fbc6
authored
Dec 17, 2020
by
Jenn Magder
Committed by
GitHub
Dec 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CocoaPods minimum version to 1.9 (#71170)
parent
9f7e785c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
70 deletions
+8
-70
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+0
-6
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+2
-39
cocoapods_validator.dart
...ages/flutter_tools/lib/src/macos/cocoapods_validator.dart
+1
-6
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+5
-11
cocoapods_validator_test.dart
...ls/test/general.shard/macos/cocoapods_validator_test.dart
+0
-8
No files found.
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
23f5fbc6
...
...
@@ -160,12 +160,6 @@ class UserMessages {
// Messages used in CocoaPodsValidator
String
cocoaPodsVersion
(
String
version
)
=>
'CocoaPods version
$version
'
;
String
cocoaPodsUninitialized
(
String
consequence
)
=>
'CocoaPods installed but not initialized.
\n
'
'
$consequence
\n
'
'To initialize CocoaPods, run:
\n
'
' pod setup
\n
'
"once to finalize CocoaPods' installation."
;
String
cocoaPodsMissing
(
String
consequence
,
String
installInstructions
)
=>
'CocoaPods not installed.
\n
'
'
$consequence
\n
'
...
...
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
23f5fbc6
...
...
@@ -89,11 +89,9 @@ class CocoaPods {
_processManager
=
processManager
,
_xcodeProjectInterpreter
=
xcodeProjectInterpreter
,
_logger
=
logger
,
_platform
=
platform
,
_artifacts
=
artifacts
,
_usage
=
usage
,
_processUtils
=
ProcessUtils
(
processManager:
processManager
,
logger:
logger
),
_fileSystemUtils
=
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
platform
),
_operatingSystemUtils
=
OperatingSystemUtils
(
fileSystem:
fileSystem
,
logger:
logger
,
...
...
@@ -103,19 +101,17 @@ class CocoaPods {
final
FileSystem
_fileSystem
;
final
ProcessManager
_processManager
;
final
FileSystemUtils
_fileSystemUtils
;
final
ProcessUtils
_processUtils
;
final
OperatingSystemUtils
_operatingSystemUtils
;
final
XcodeProjectInterpreter
_xcodeProjectInterpreter
;
final
Logger
_logger
;
final
Platform
_platform
;
final
Artifacts
_artifacts
;
final
Usage
_usage
;
Future
<
String
>
_versionText
;
String
get
cocoaPodsMinimumVersion
=>
'1.
6
.0'
;
String
get
cocoaPodsRecommendedVersion
=>
'1.
9
.0'
;
String
get
cocoaPodsMinimumVersion
=>
'1.
9
.0'
;
String
get
cocoaPodsRecommendedVersion
=>
'1.
10
.0'
;
Future
<
bool
>
get
isInstalled
=>
_processUtils
.
exitsHappy
(<
String
>[
'which'
,
'pod'
]);
...
...
@@ -157,28 +153,6 @@ class CocoaPods {
}
}
/// Whether CocoaPods ran 'pod setup' once where the costly pods' specs are
/// cloned.
///
/// Versions >= 1.8.0 do not require 'pod setup' and default to a CDN instead
/// of a locally cloned repository.
/// See http://blog.cocoapods.org/CocoaPods-1.8.0-beta/
///
/// A user can override the default location via the CP_REPOS_DIR environment
/// variable.
///
/// See https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/config.rb#L138
/// for details of this variable.
Future
<
bool
>
get
isCocoaPodsInitialized
async
{
final
Version
installedVersion
=
Version
.
parse
(
await
cocoaPodsVersionText
);
if
(
installedVersion
!=
null
&&
installedVersion
>=
Version
.
parse
(
'1.8.0'
))
{
return
true
;
}
final
String
cocoapodsReposDir
=
_platform
.
environment
[
'CP_REPOS_DIR'
]
??
_fileSystem
.
path
.
join
(
_fileSystemUtils
.
homeDirPath
,
'.cocoapods'
,
'repos'
);
return
_fileSystem
.
isDirectory
(
_fileSystem
.
path
.
join
(
cocoapodsReposDir
,
'master'
));
}
Future
<
bool
>
processPods
({
@required
XcodeBasedProject
xcodeProject
,
@required
BuildMode
buildMode
,
...
...
@@ -246,17 +220,6 @@ class CocoaPods {
case
CocoaPodsStatus
.
recommended
:
break
;
}
if
(!
await
isCocoaPodsInitialized
)
{
_logger
.
printError
(
'Warning: CocoaPods installed but not initialized. Skipping pod install.
\n
'
'
$noCocoaPodsConsequence
\n
'
'To initialize CocoaPods, run:
\n
'
' pod setup
\n
'
"once to finalize CocoaPods' installation."
,
emphasis:
true
,
);
return
false
;
}
return
true
;
}
...
...
packages/flutter_tools/lib/src/macos/cocoapods_validator.dart
View file @
23f5fbc6
...
...
@@ -30,12 +30,7 @@ class CocoaPodsValidator extends DoctorValidator {
ValidationType
status
=
ValidationType
.
installed
;
if
(
cocoaPodsStatus
==
CocoaPodsStatus
.
recommended
)
{
if
(
await
_cocoaPods
.
isCocoaPodsInitialized
)
{
messages
.
add
(
ValidationMessage
(
_userMessages
.
cocoaPodsVersion
(
await
_cocoaPods
.
cocoaPodsVersionText
)));
}
else
{
status
=
ValidationType
.
partial
;
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
cocoaPodsUninitialized
(
noCocoaPodsConsequence
)));
}
messages
.
add
(
ValidationMessage
(
_userMessages
.
cocoaPodsVersion
(
await
_cocoaPods
.
cocoaPodsVersionText
)));
}
else
{
if
(
cocoaPodsStatus
==
CocoaPodsStatus
.
notInstalled
)
{
status
=
ValidationType
.
missing
;
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
23f5fbc6
...
...
@@ -80,7 +80,7 @@ void main() {
xcodeProjectInterpreter:
mockXcodeProjectInterpreter
,
usage:
usage
,
);
pretendPodVersionIs
(
'1.
9
.0'
);
pretendPodVersionIs
(
'1.
10
.0'
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'templates'
,
'cocoapods'
,
'Podfile-ios-objc'
,
))
...
...
@@ -177,33 +177,27 @@ void main() {
testWithoutContext
(
'detects below minimum version'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.
5
.0'
);
pretendPodVersionIs
(
'1.
6
.0'
);
expect
(
await
cocoaPodsUnderTest
.
evaluateCocoaPodsInstallation
,
CocoaPodsStatus
.
belowMinimumVersion
);
});
testWithoutContext
(
'detects below recommended version'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.
6
.0'
);
pretendPodVersionIs
(
'1.
9
.0'
);
expect
(
await
cocoaPodsUnderTest
.
evaluateCocoaPodsInstallation
,
CocoaPodsStatus
.
belowRecommendedVersion
);
});
testWithoutContext
(
'detects at recommended version'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.
9
.0'
);
pretendPodVersionIs
(
'1.
10
.0'
);
expect
(
await
cocoaPodsUnderTest
.
evaluateCocoaPodsInstallation
,
CocoaPodsStatus
.
recommended
);
});
testWithoutContext
(
'detects above recommended version'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.
9
.1'
);
pretendPodVersionIs
(
'1.
10
.1'
);
expect
(
await
cocoaPodsUnderTest
.
evaluateCocoaPodsInstallation
,
CocoaPodsStatus
.
recommended
);
});
testWithoutContext
(
'detects initialized over 1.8.0'
,
()
async
{
pretendPodIsInstalled
();
pretendPodVersionIs
(
'1.8.0'
);
expect
(
await
cocoaPodsUnderTest
.
isCocoaPodsInitialized
,
isTrue
);
});
});
group
(
'Setup Podfile'
,
()
{
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_validator_test.dart
View file @
23f5fbc6
...
...
@@ -18,7 +18,6 @@ void main() {
cocoaPods
=
MockCocoaPods
();
when
(
cocoaPods
.
evaluateCocoaPodsInstallation
)
.
thenAnswer
((
_
)
async
=>
CocoaPodsStatus
.
recommended
);
when
(
cocoaPods
.
isCocoaPodsInitialized
).
thenAnswer
((
_
)
async
=>
true
);
when
(
cocoaPods
.
cocoaPodsVersionText
).
thenAnswer
((
_
)
async
=>
'1.8.0'
);
});
...
...
@@ -44,13 +43,6 @@ void main() {
expect
(
result
.
type
,
ValidationType
.
partial
);
});
testWithoutContext
(
'Emits partial status when CocoaPods is not initialized'
,
()
async
{
when
(
cocoaPods
.
isCocoaPodsInitialized
).
thenAnswer
((
_
)
async
=>
false
);
final
CocoaPodsValidator
workflow
=
CocoaPodsValidator
(
cocoaPods
,
UserMessages
());
final
ValidationResult
result
=
await
workflow
.
validate
();
expect
(
result
.
type
,
ValidationType
.
partial
);
});
testWithoutContext
(
'Emits partial status when CocoaPods version is too low'
,
()
async
{
when
(
cocoaPods
.
evaluateCocoaPodsInstallation
)
.
thenAnswer
((
_
)
async
=>
CocoaPodsStatus
.
belowRecommendedVersion
);
...
...
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