Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Create Spec and Subspecs for Cocoapods #18

Closed
odrobnik opened this Issue Jan 15, 2013 · 18 comments

Comments

Projects
None yet
3 participants
Collaborator

odrobnik commented Jan 15, 2013

We need the spec file for DTFoundation so that it can be a dependency of DTCoreText. Also the elements that have their own static lib targets should be their own sub specs.

@odrobnik odrobnik added a commit that referenced this issue Jan 15, 2013

@odrobnik odrobnik Added initial podspec. (Your help requested) #18
The idea is do group things together that either require a specific platform (iOS/Mac) or that require specific additional libraries to be linked. e.g. DTHTMLParser requires libxml2

The goal is to be able to link the DTCoreText podspec to use Core and DTHTMLParser as dependency.
62dbffc
Collaborator

odrobnik commented Jan 15, 2013

How do I specify the linking of CoreData.framework for DTDownloadCache?

Contributor

fabiopelosin commented Jan 15, 2013

I think that the best solution would be to namespace DTDownloadChache and DTBonjour in the file system as well.

FYI you can check the validity of a podspec running:

$ pod spec lint DTFoundation.podspec --verbose
// this requires to temporarily remove the branch information from the source.

You can also inspect what CocoaPods sees by running:

$ pod spec lint DTFoundation.podspec --no-clean
$ open /tmp/CocoaPods/Lint/Pods/Pods.xcodeproj
Collaborator

odrobnik commented Jan 15, 2013

i tried the lint thing, but it fails on my MacBook, something about include being unknown...

I know, I still need to split out DTDownloadCache which uses DoreData and a few other things

Also of course I still need to tag version 1.0.0, but I want to do that once the podspec is complete.

Contributor

fabiopelosin commented Jan 15, 2013

i tried the lint thing, but it fails on my MacBook, something about include being unknown...

spec.version.to_s should have fixed it.

Awesome looks like we are getting closer to complete the podspec.

@odrobnik odrobnik added a commit that referenced this issue Jan 16, 2013

@odrobnik odrobnik Updated podspec #18 a40970d
Collaborator

odrobnik commented Jan 16, 2013

I also added a 1.0.0 tag. the podspec repo is having issues right now, so I cannot verify it.

Collaborator

odrobnik commented Jan 16, 2013

I seem to have this problem when lint-ing the pod spec:

-> DTFoundation (1.0.0)
- ERROR | [iOS 5.0] XCODEBUILD > DTFoundation/Core/Source/DTDownload/DTDownloadCache.m:11:9: fatal error: 'NSString+DTPaths.h' file not found

This file is part of the Core sub spec, why can pod not find the file?

alloy commented Jan 16, 2013

@Cocoanetics When you run lint with the --no-clean option and then inspect the Xcode project, like @irrationalfab suggested, can you see what the problem is?

  • Does the file actually still exist?
  • Is it linked into, at least, the Pods/BuildHeaders dir?
  • Are the HEADER_SEARCH_PATHS correct?
Collaborator

odrobnik commented Jan 16, 2013

I see that the NSString+DTPaths is indeed missing. Looks like this is wrong:

spec.subspec 'Core' do |ss|
  ss.source_files = 'Core/Source/*.{h,m}'
  ss.ios.source_files = 'Core/Source/iOS/*.{h,m}'
  ss.osx.source_files = 'Core/Source/OSX/*.{h,m}'
end

How can I configure it correctly to have platform-dependent code in the iOS/OSX folders and platform-independent code in Core/Source

The non-cleaned Pods.xcodeproj only has the iOS source, all the ss.source_files are missing.

alloy commented Jan 16, 2013

Try:

spec.subspec 'Core' do |ss|
  ss.ios.source_files = 'Core/Source/*.{h,m}', 'Core/Source/iOS/*.{h,m}'
  ss.osx.source_files = 'Core/Source/*.{h,m}', 'Core/Source/OSX/*.{h,m}'
end
Collaborator

odrobnik commented Jan 16, 2013

Yes, that did the trick. After cleaning up a few other things I get a successful lint.

Collaborator

odrobnik commented Jan 16, 2013

Now I have both DTFoundation and DTCoreText working, BUT I believe there to be a bug in CocoaPods: there are problems having dependencies on sub-specs from a larger project if these subspecs require a higher deployment target. I raised this issue: CocoaPods/CocoaPods#745

Contributor

fabiopelosin commented Jan 16, 2013

Btw, this is a bug in CocoaPods which should be fixed in 0.17.

Contributor

fabiopelosin commented Jan 16, 2013

the previous comment refers to the source files issue

Collaborator

odrobnik commented Jan 17, 2013

I am trying to further separate the things that need UIKIt and AppKit. These show up in pod search, but they don't get installed by pod install, even if I reference DTFoundation/UIKit. Why?

https://github.com/Cocoanetics/DTFoundation/blob/master/DTFoundation.podspec

Collaborator

odrobnik commented Jan 17, 2013

I think I got it working now. Somehow pod was not updating an existing project as it should.

@odrobnik odrobnik closed this Jan 17, 2013

Contributor

fabiopelosin commented Jan 17, 2013

Where you running pod install or pod update?

Collaborator

odrobnik commented Jan 17, 2013

I was trying both. Neither seemed to add the new UIKit subspec to the Pods project.

Contributor

fabiopelosin commented Jan 17, 2013

Oh, I see, you didn't change the version. This is an unimplemented feature. CocoaPods does't install all the Pods every-time but just the ones that changed. In the future we should check for the SHA1 of the podspec to see if an already installed version needs to be reinstalled. However for the time being the work around for this situations is to delete the folder of the Pod.

@gugmaster gugmaster pushed a commit that referenced this issue Jan 23, 2013

@odrobnik odrobnik Updated podspec #18 62c93ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment