Language: 简体中文
The MBox plugin is used to extend the MBox dependency management capability and add the CocoaPods dependency management.
The MBoxCocoapods
plugin will automatically deploy the Bundler
environment, and then comment all to CocoaPods
. Therefore, in principle, all the commands native to CocoaPods
are supported, and the mbox
entry command is added before the original command:
$ mbox pod
Redirect to CocoaPods with MBox environment
The plug-in hooks the CocoaPods
environment deploy and dependency anlayzer. Taking mbox pod install
as an example, there will be the following changes:
- Analyze the
Gemfile
andGemfile.lock
in the project, automatically install and use the correctBundler
- Automatically analyze the
Bundler
environment, and automatically install the requiredGem
- Forward commands to
CocoaPods
- Read the
Podfile
andPodfile.lock
in theCocoaPods
Container, generate a newPodfile
in the Workspace root directory, and use thePodfile
as the mainPodfile
ofCocoaPods
- If the dependent component has been added to the Workspace, the local repository will be used automatically, without modifying the
Podfile
, and thePodfile.lock
in the project will not be modified
Notice:
- If you need to modify the
Podfile
, please modify thePodfile
in the repository. Do not modify thePodfile
under Workspace. - To add/remove Pod components in Workspace, you need to re-execute
mbox pod install
to updateCocoaPods
dependencies
Some capabilities are provided through Hook MBox and CocoaPods:
- [MBoxCore]
mbox go
will open the.xcworkspace
/.xcodeproj
with Xcode - [MBoxContainer] Add container for
CocoaPods
- [MBoxDependencyManager] Add the dependency management tool for
CocoaPods
The plugin ONLY works in a workspace.
Dependent MBox components:
- MBoxCore
- MBoxGit
- MBoxRuby
- MBoxWorkspace
- MBoxDependencyManager
- MBoxContainer
Dependent Ruby components:
- CocoaPods, >= 1.7.0, < 1.11.0
- Activate in workspace:
$ mbox plugin enable cocoapods
-
Activate in repository, it allow you commit the plugin in git and sync to others:
Modify the
.mboxconfig
in the repository:
{
"plugins": {
"MBoxCocoapods": {}
}
}
- Write a
Gemfile
and add the gems you required - Configure the
Workspace/.mboxconfig
:
{
"podfile": "XX/Podfile",
# (Required) The relative path of `Podfile` in the repository
"podlock": "XX/Podfile.lock"
#(Optional)The relative path of `Podfile.lock` in the repository. If you have not the lock file, please don't config it.
}
- We will search the
*.podspec
/*.podspec.json
in the root directory of the repository - If the
podspec
is not in the root directory, you could configure the relative path in the.mboxconfig
:
{
# If you have only one podspec
"podspec": "xx/yy.podspec"
# If you have more podspecs
"podspecs": [
"xx/yy1.podspec",
"xx/yy2.podspec"
]
}
Please reference the section Contributing
MBox is available under GNU General Public License v2.0 or later.