Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Podspec working #2

Closed
MrZoidberg opened this issue Sep 21, 2016 · 10 comments
Closed

Make Podspec working #2

MrZoidberg opened this issue Sep 21, 2016 · 10 comments

Comments

@MrZoidberg
Copy link

Hi,

I was trying to update your Podspec, unfortunately it's still not working (see my branch), but I think together we can figure out this problem.

Currently, I have the following problems:

- ERROR | file patterns: The `preserve_paths` pattern did not match any file.
- ERROR | file patterns: The `vendored_libraries` pattern did not match any file.
- ERROR | xcodebuild: Returned an unsuccessful exit code.
- ERROR | xcodebuild:  Carpaccio/Carpaccio/RAWConverter.h:27:46: error: unknown type name 'NSImage'
- NOTE  | xcodebuild:  Carpaccio/Carpaccio/RAWConverter.mm:11:9: fatal error: 'Cocoa/Cocoa.h' file not found
@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Oh, thanks a lot! I actually tried making the Podspec at a stage where cocoapods was not working very well with Xcode 8 yet (the validation tool was not possible to run)… and I'm no expert in using it. However, Carpaccio should be a simple one as we don't do anything clever with build settings. I'll take a look at the iOS build I've recently added in the Xcode project and report back in a bit ->

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Oh, that Xcode based build for iOS is actually happily building now (also tests, including on travis – that CI was failing for a while because of Xcode 8 issues as well).

This is the full set of source code files that should be compiled in:

Carpaccio/Carpaccio/ImageLoaderProtocol.swift
Carpaccio/Carpaccio/Collection.swift
Carpaccio/Carpaccio/CGSize+Extensions.swift
Carpaccio/Carpaccio/BitmapImage.swift
Carpaccio/Carpaccio/RAWImageLoader.swift
Carpaccio/Carpaccio/ImageMetadata.swift
Carpaccio/Carpaccio/Image.swift
Carpaccio/Carpaccio/BitmapImage+iOS.swift
Carpaccio/Carpaccio/Collection+Extensions.swift

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Ah, that RAWConverter.mm was actually a remnant of our earlier RAW converter code which was based on libraw – we since moved over to CoreImage. I've dropped those source files now from the repo, altogether with libraw etc static libraries that were still in the repo and no longer necessary.

@MrZoidberg
Copy link
Author

Just be sure to use the latest (currently pre-release) version of CocoaPods.

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Thanks, that got me a bit further (progress pushed to master) – maybe you know how to finish this off?

  • I've now got as far as having pod spec lint fail as it's evidently using the Swift 2.3 compiler to build.
  • Based on what I've read (I'm a Carthage man myself, not used cocoapods really in production), fixing this doesn't appear to be a Podspec level issue but that there are presently some hacks on the level of a Podfile to make cocoapods behave.
  • Not sure how I would incorporate any of that into actually checking this pod validates?

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Looking at your fork btw, the Includes directory, the header search paths entries pointing at it, all the static libraries btw are all actually unnecessary and I've removed those today evening now from confusing people from the repo (they all predate the actual CoreImage based form of the code).

All in all this should really be as simple a pod as it gets – the Xcode configuration literally just compiles that handful of source files and links against AppKit / UIKit.

@MrZoidberg
Copy link
Author

I'll investigate tomorrow. As far as I understood, you need CocoaPods 1.1.0.rc.2 for Swift 3.0

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Yep, it seems to all work now – pod install / update works with the Swift compiler version set in the containing target. Tested with this tiny Podfile hooked to a made up Foobar Xcode macOS app target:

target 'Foobar'
platform :osx, '10.10'
use_frameworks!
pod 'Carpaccio', :git => 'git@github.com:mz2/Carpaccio.git', :branch => 'master'

(iOS should be fine too)

What I wasn't able to work out yet successfully is how to get pod spec lint to behave with it. This may be why cocoapods 1.1.0.rc.2 still a prerelease :-)

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Yep, a few more tweaks were still necessary, now up – the Swift compiler version can now be hinted for pod spec lint by creating a .swift-version file in the repo.

@mz2
Copy link
Owner

mz2 commented Sep 21, 2016

Please reopen if you hit any issues with building Carpaccio as a cocoapod.

@mz2 mz2 closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants