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
e9403815
Unverified
Commit
e9403815
authored
Nov 10, 2017
by
xster
Committed by
GitHub
Nov 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print a warning when cocoapods specs repo is out of date (#12915)
parent
3cbb8750
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
1 deletion
+60
-1
cocoapods.dart
packages/flutter_tools/lib/src/ios/cocoapods.dart
+14
-1
cocoapods_test.dart
packages/flutter_tools/test/ios/cocoapods_test.dart
+46
-0
No files found.
packages/flutter_tools/lib/src/ios/cocoapods.dart
View file @
e9403815
...
...
@@ -133,7 +133,20 @@ class CocoaPods {
printStatus
(
result
.
stderr
,
indent:
4
);
}
}
if
(
result
.
exitCode
!=
0
)
if
(
result
.
exitCode
!=
0
)
{
_diagnosePodInstallFailure
(
result
);
throwToolExit
(
'Error running pod install'
);
}
}
void
_diagnosePodInstallFailure
(
ProcessResult
result
)
{
if
(
result
.
stdout
is
String
&&
result
.
stdout
.
contains
(
'out-of-date source repos'
))
{
printError
(
"Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
\n
"
'To update the CocoaPods specs, run:
\n
'
' pod repo update
\n
'
,
emphasis:
true
,
);
}
}
}
packages/flutter_tools/test/ios/cocoapods_test.dart
View file @
e9403815
...
...
@@ -131,6 +131,52 @@ void main() {
ProcessManager:
()
=>
mockProcessManager
,
},
);
testUsingContext
(
'outdated specs repo should print error'
,
()
async
{
fs
.
file
(
fs
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
))
..
createSync
()
..
writeAsString
(
'Existing Podfile'
);
when
(
mockProcessManager
.
run
(
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
workingDirectory:
'project/ios'
,
environment:
<
String
,
String
>{
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
},
)).
thenReturn
(
new
ProcessResult
(
1
,
1
,
'''
[!] Unable to satisfy the following requirements:
- `Firebase/Auth` required by `Podfile`
- `Firebase/Auth (= 4.0.0)` required by `Podfile.lock`
None of your spec sources contain a spec satisfying the dependencies: `Firebase/Auth, Firebase/Auth (= 4.0.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.'''
,
''
,
));
try
{
await
cocoaPodsUnderTest
.
processPods
(
appIosDir:
projectUnderTest
,
iosEngineDir:
'engine/path'
,
);
expect
(
fs
.
file
(
fs
.
path
.
join
(
'project'
,
'ios'
,
'Podfile'
)).
readAsStringSync
()
,
'Existing Podfile'
);
fail
(
'Exception expected'
);
}
catch
(
ToolExit
)
{
expect
(
testLogger
.
errorText
,
contains
(
"CocoaPods's specs repository is too out-of-date to satisfy dependencies"
));
}
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
mockProcessManager
,
},
);
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
...
...
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