Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

CocoaHeads Lyon 17/01/2013 : CocoaPods

407 views

Published on

"CocoaPods"
Par Vincent Tourraine aux CocoaHeads Lyon du 17 janvier 2013.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

CocoaHeads Lyon 17/01/2013 : CocoaPods

  1. 1. CocoaPods“The best way to manage library dependencies in Objective-C projects.” CocoaHeads Lyon - janvier 2013 Vincent Tourraine - shazino
  2. 2. Pour quoi faire ?• Gérer les dépendances d’un projet XCode - Bibliothèques - Frameworks - Toutes classes, ressources, etc
  3. 3. Comment ça marche ?1. Écrire un Podfile pour lister les dépendances2. Utiliser la commande pod pour générer un workspace basé sur un projet et les dépendances du Podfile.
  4. 4. Exemple de Podfile platform :ios platform :ios pod pod JSONKit JSONKit pod pod AFNetworking, >= 1.0 AFNetworking, >= 1.0 pod pod Objection, :head Objection, :head
  5. 5. Commande pod• Installation $ $ (sudo) gem install cocoapods (sudo) gem install cocoapods $ $ pod setup pod setup
  6. 6. Commande pod• Génération du workspace $ pod install $ pod install• Mise à jour du workspace $ pod update $ pod update
  7. 7. Exemple de .podspecPod::Spec.new do |s|Pod::Spec.new do |s| s.name s.name = LibraryName’ = LibraryName’ s.version s.version = 1.0.0’ = 1.0.0’ s.summary s.summary = A library that...’ = A library that...’ s.author s.author = { Machin => machin@gmail.com } = { Machin => machin@gmail.com } s.source s.source = { = { :git => https://github.com/USER/REPO.git, :git => https://github.com/USER/REPO.git, :tag => 0.4.2 } :tag => 0.4.2 } s.source_files = Classes, External/**/*.{h,m}’ s.source_files = Classes, External/**/*.{h,m}’ s.dependency s.dependency JSONKit, ~> 1.4’ JSONKit, ~> 1.4’endend
  8. 8. Création du .podspec • Génération automatique$ pod spec create [ NAME | https://github.com/USER/REPO ]$ pod spec create [ NAME | https://github.com/USER/REPO ] • Test conformité $ pod spec lint NAME.podspec $ pod spec lint NAME.podspec
  9. 9. Plus d’infos• Trouver les Pods http://cocoapods.orghttps://github.com/cocoaPods/Spec• Documentation https://github.com/CocoaPods/CocoaPods/wiki
  10. 10. Plus d’infos• Trouver les Pods http://cocoapods.orghttps://github.com/cocoaPods/Spec• Documentation https://github.com/CocoaPods/CocoaPods/wiki

×