Pregunta

I'm in the process of writing my very first pod spec, and while I have managed to write a spec that passes validation and pod install seems to install the pod OK the actual source-files are nowhere to be found in my workspace. This is my podfile:

platform :ios, '7.0'
xcodeproj 'NORLabelNodeiOStest'
pod 'NORLabelNode', :path => '~/Programmering/Development/NORLabelNodePodSpec'
pod 'AFNetworking'

As you can see the NORLabelNode pod is installed through a local version of the podspec which looks like this:

Pod::Spec.new do |s|
  s.name             = "NORLabelNode"
  s.version          = "0.9.2"
  s.summary          = "Extension of Apple's SKLabelNode. Allowing multiple lines through the use of \n in the text-string. "
  s.description      = <<-DESC
                       Behaves like an ordinary SKLabelNode with the one difference that adding newline characters to the text- property actually adds line-breaks. This is achieved by creating SKLabelNodes as child-nodes, but keeping these as part of the internal (private) logic.
                       DESC
  s.homepage         = "https://github.com/nickfalk/NORLabelNode.git"
  s.license          = 'MIT'
  s.author           = { "T. Benjamin Larsen" => "benjamin.larsen@noreagle.no" }
  s.source           = { 
        :git => "https://github.com/nickfalk/NORLabelNode.git", 
        :tag => 'v0.9.2' 
    }
  s.social_media_url = 'https://twitter.com/noreagle'

  s.platform     = :ios, '7.0'
  s.ios.deployment_target = '7.0'
  s.osx.deployment_target = '10.9'
  s.requires_arc = true
  s.frameworks = 'SpriteKit'
  s.source_files = 'NORLabelNode.{h,m}'
end

Running pod install gives no indication that anything has gone amiss:

Analyzing dependencies
Fetching podspec for `NORLabelNode` from `~/Programmering/Development/NORLabelNodePodSpec`
Downloading dependencies
Installing AFNetworking (2.2.3)
Installing NORLabelNode (0.9.2)
Generating Pods project
Integrating client project

[!] From now on use `NORLabelNodeiOStest.xcworkspace`.

The AFNetworking pod installs the files as expected, but my own NORLabelNode does not. Anyone?

¿Fue útil?

Solución

As you can see the NORLabelNode pod is installed through a local version of the podspec which looks like this

That's not how the path option works. It expects a path to the project itself, not the spec.

From the docs:

Using this option CocoaPods will assume the given folder to be the root of the Pod and will link the files directly from there in the Pods project.

If you would like to just use your spec without adding it to the master repo you can create your own repo of specs (docs). Or just place your spec in the correct folder structure in ~/.cocoapods/repos/master

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top