CocoaPods: Difference between revisions
Jump to navigation
Jump to search
(19 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
2. pod update | 2. pod update | ||
3. Done | 3. Done | ||
==MergePBX== | |||
<source lang="bash"> | |||
brew install mergepbx | |||
git config --global merge.mergepbx.name "XCode project files merger" | |||
git config --global merge.mergepbx.driver "mergepbx %O %A %B" | |||
# git config --global core.attributesfile ~/.gitattributes | |||
echo '*.pbxproj merge=mergepbx' >> ~/.gitattributes | |||
</source> | |||
==Fixing== | ==Fixing== | ||
Line 20: | Line 29: | ||
pod deintegrate | pod deintegrate | ||
sudo gem install cocoapods-clean | sudo gem install cocoapods-clean | ||
sudo gem install cocoapods -v 1.9.1 | |||
cd /opt/dev/chorke/academia/code/base_workspaces/ | cd /opt/dev/chorke/academia/code/base_workspaces/ | ||
cd ./init_workspace/academia-init-iosapp/ | cd ./init_workspace/academia-init-iosapp/ | ||
Line 80: | Line 90: | ||
</source> | </source> | ||
==Private Pod | ==Static Framework== | ||
Like <code>pod 'GoogleMaps', '~> 3.8.0'</code> there are some static frameworks. I mean framework inside framework. For what we have to add the property as below in '''Podspec''' for the dependency pod framework where static framework or has pod dependency like <code>pod 'GoogleMaps', '~> 3.8.0'</code> | |||
s.static_framework = true | |||
<code>use_frameworks! :linkage => :static</code> is the alternative of the dependency framework '''Podspec''' <code>s.static_framework = true</code> property. If <code>s.static_framework = true</code> property missed in the '''Podspec''' of any dependency framework which contains static framework then we could use <code>use_frameworks! :linkage => :static</code> in the dependent '''Podfile''' to handle such static framework. | |||
use_frameworks! :linkage => :static | |||
==Private Pod Patch== | |||
<source lang="bash"> | <source lang="bash"> | ||
tag='v1.0.0';git tag -d $tag;git push --delete origin $tag;\ | tag='v1.0.0';git tag -d $tag;git push --delete origin $tag;\ | ||
git tag $tag;git push origin $tag | git tag $tag; git push origin $tag | ||
</source> | |||
<source lang="bash"> | |||
url=bit.chorke.org:chorkeorg/academia-core-ioslib.git;pod='AcademiaCoreLIB';\ | url=bit.chorke.org:chorkeorg/academia-core-ioslib.git;pod='AcademiaCoreLIB';\ | ||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
url=bit.chorke.org:chorkeorg/academia-core-iossql.git;pod='AcademiaCoreSQL';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
url=bit.chorke.org:chorkeorg/academia-core-iosapi.git;pod='AcademiaCoreAPI';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
url=bit.chorke.org:chorkeorg/academia-core-iosgui.git;pod='AcademiaCoreGUI';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | pod repo remove $pod;pod repo add $pod $url;pod update $pod | ||
</source> | |||
<source lang="bash"> | |||
url=bit.chorke.org:chorkeorg/academia-rupa-iossql.git;pod='AcademiaRupaSQL';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
url=bit.chorke.org:chorkeorg/academia-rupa-iosapi.git;pod='AcademiaRupaAPI';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
url=bit.chorke.org:chorkeorg/academia-rupa-iosvum.git;pod='AcademiaRupaVUM';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
url=bit.chorke.org:chorkeorg/academia-rupa-iosgui.git;pod='AcademiaRupaGUI';\ | |||
pod repo remove $pod;pod repo add $pod $url;pod update $pod | |||
</source> | |||
==Multiple Commands Error== | |||
For '''Xcode 11.4''' please select the '''Xcode''' menu item as following: | |||
File » Workspace Settings » Shared Workspace Settings » Build System » Legacy Build System | |||
⌘ + Shift + Option + K | |||
⌘ + Shift + K | |||
⌘ + Shift + R | |||
⌘ + R | |||
⌘ + U | |||
<source lang="bash"> | |||
p='academia-main-iosapp';b="$p.bkp";if [ -d "$b" ];then rm -rf $b;fi;mv $p $b;\ | |||
git clone "bit.chorke.org:chorkeorg/$p.git";if [ -d "$p" ];then cd $p;\ | |||
cp ../$b/Podfile* .;pod install;git status;cd ..;fi | |||
</source> | |||
==Xcode Freeze== | |||
<source lang="bash"> | |||
sudo rm -rf ~/Library/Developer/Xcode/ | |||
sudo rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState/ | |||
</source> | </source> | ||
==References== | ==References== | ||
{| | |||
| valign="top" | | |||
* [https://medium.com/@shahabejaz/create-and-distribute-private-libraries-with-cocoapods-5b6507b57a03 Distribute Private Libraries with Cocoapods] | * [https://medium.com/@shahabejaz/create-and-distribute-private-libraries-with-cocoapods-5b6507b57a03 Distribute Private Libraries with Cocoapods] | ||
* [https://stackoverflow.com/questions/46428752 Clean specific pod from the local cache] | * [https://stackoverflow.com/questions/46428752 Clean specific pod from the local cache] | ||
Line 101: | Line 168: | ||
* [https://stackoverflow.com/questions/50199354 Add Git Repository as Pod] | * [https://stackoverflow.com/questions/50199354 Add Git Repository as Pod] | ||
* [https://guides.cocoapods.org/using/pod-install-vs-update.html Pod install vs. pod update] | * [https://guides.cocoapods.org/using/pod-install-vs-update.html Pod install vs. pod update] | ||
| valign="top" | | |||
* [https://stackoverflow.com/questions/61442990 GoogleMaps causes build error as an indirect dependency] | |||
* [https://help.apple.com/xcode/mac/current/#/dev14a2fd0c0 If multiple commands produce the same output] | |||
* [https://medium.com/@ihabshea/how-to-get-cocoapods-working-on-macos-big-sur-c09e5d6e4d51 CocoaPods working on MacOS Big Sur] | |||
* [https://medium.com/@mattoakes/a-better-way-to-automatically-merge-changes-in-your-xcode-project-files-3d83b3583fe4 Automatically Merge XCode Project] | |||
* [https://stackoverflow.com/questions/50718018 Error: Multiple commands produce] | |||
* [[Xcode Clean up Installation]] | |||
* [https://developer.apple.com/support/code-signing/ Developer Code Signing] | |||
* [http://guides.cocoapods.org/making/private-cocoapods.html Private Pods] | * [http://guides.cocoapods.org/making/private-cocoapods.html Private Pods] | ||
| valign="top" | | |||
|- | |||
| colspan="3" | | |||
---- | |||
|- | |||
| valign="top" | | |||
* [[Maven]] | |||
* [[Conan]] | |||
* [[Bazel]] | |||
* [[NPM]] | |||
* [[Yarn]] | |||
* [[Ant]] | |||
* [[Ivy]] | |||
| valign="top" | | |||
| valign="top" | | |||
|} |
Latest revision as of 20:59, 18 January 2024
Install
pod --version
pod repo update
cd /opt/dev/chorke/academia/code/base_workspaces/
cd ./core_workspace/academia-core-ioslib/
pod init
vim Podfile
open -a xcode Podfile
pod install
1. Target > building settings > ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES, Value type is Boolean, click on the other, change the value to $(inherited) 2. pod update 3. Done
MergePBX
brew install mergepbx
git config --global merge.mergepbx.name "XCode project files merger"
git config --global merge.mergepbx.driver "mergepbx %O %A %B"
# git config --global core.attributesfile ~/.gitattributes
echo '*.pbxproj merge=mergepbx' >> ~/.gitattributes
Fixing
pod deintegrate
sudo gem install cocoapods-clean
sudo gem install cocoapods -v 1.9.1
cd /opt/dev/chorke/academia/code/base_workspaces/
cd ./init_workspace/academia-init-iosapp/
pod clean
pod setup
pod install
Podspec
pod lib create AcademiaCoreLIB
cd AcademiaCoreLIB/
pod lib lint AcademiaCoreLIB.podspec
pod repo push AcademiaCoreLIB AcademiaCoreLIB.podspec
ls -la ~/.cocoapods/repos/AcademiaCoreLIB/AcademiaCoreLIB/1.0.0/
pod repo add AcademiaCoreLIB bit.chorke.org:chorkeorg/academia-core-ioslib.git
pod spec create AcademiaCoreLIB
open -a Xcode AcademiaCoreLIB.podspec
pod spec lint AcademiaCoreLIB.podspec
pod lib lint
:'
git tag -d v1.0.0
git push --delete origin v1.0.0
'
git tag v1.0.0
git push origin v1.0.0
pod trunk register [email protected] 'Chorke Academia' --description='Chorke Academia, Inc.'
pod trunk push
pod install
# pod repo update
pod update AcademiaCoreLIB
pod install --repo-update
Private Podspec
pod repo add AcademiaCoreLIB bit.chorke.org:chorkeorg/academia-core-ioslib.git
cd ~/.cocoapods/repos/AcademiaCoreLIB/; pod repo lint .
pod repo push AcademiaCoreLIB AcademiaCoreLIB.podspec
pod repo remove AcademiaCoreLIB
# add to podfile as pod dependency
pod 'AcademiaCoreLIB', :git => 'bit.chorke.org:chorkeorg/academia-core-ioslib.git'
Static Framework
Like pod 'GoogleMaps', '~> 3.8.0'
there are some static frameworks. I mean framework inside framework. For what we have to add the property as below in Podspec for the dependency pod framework where static framework or has pod dependency like pod 'GoogleMaps', '~> 3.8.0'
s.static_framework = true
use_frameworks! :linkage => :static
is the alternative of the dependency framework Podspec s.static_framework = true
property. If s.static_framework = true
property missed in the Podspec of any dependency framework which contains static framework then we could use use_frameworks! :linkage => :static
in the dependent Podfile to handle such static framework.
use_frameworks! :linkage => :static
Private Pod Patch
tag='v1.0.0';git tag -d $tag;git push --delete origin $tag;\
git tag $tag; git push origin $tag
url=bit.chorke.org:chorkeorg/academia-core-ioslib.git;pod='AcademiaCoreLIB';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-core-iossql.git;pod='AcademiaCoreSQL';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-core-iosapi.git;pod='AcademiaCoreAPI';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-core-iosgui.git;pod='AcademiaCoreGUI';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-rupa-iossql.git;pod='AcademiaRupaSQL';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-rupa-iosapi.git;pod='AcademiaRupaAPI';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-rupa-iosvum.git;pod='AcademiaRupaVUM';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
url=bit.chorke.org:chorkeorg/academia-rupa-iosgui.git;pod='AcademiaRupaGUI';\
pod repo remove $pod;pod repo add $pod $url;pod update $pod
Multiple Commands Error
For Xcode 11.4 please select the Xcode menu item as following:
File » Workspace Settings » Shared Workspace Settings » Build System » Legacy Build System ⌘ + Shift + Option + K ⌘ + Shift + K ⌘ + Shift + R ⌘ + R ⌘ + U
p='academia-main-iosapp';b="$p.bkp";if [ -d "$b" ];then rm -rf $b;fi;mv $p $b;\
git clone "bit.chorke.org:chorkeorg/$p.git";if [ -d "$p" ];then cd $p;\
cp ../$b/Podfile* .;pod install;git status;cd ..;fi
Xcode Freeze
sudo rm -rf ~/Library/Developer/Xcode/
sudo rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState/