The Wayback Machine - https://web.archive.org/web/20201108093227/https://github.com/niw/KeyboardGuide/pull/1
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

Support Cocoapods #1

Closed
wants to merge 1 commit into from
Closed

Support Cocoapods #1

wants to merge 1 commit into from

Conversation

@aceontech
Copy link

@aceontech aceontech commented Oct 23, 2020

Thank you for your work on this library!

I've created a Podspec file so it can be included into projects that use Cocoapods for dependency management. I've tested it on one of the projects I'm working on, and the spec passes the lint validation (pod lib lint).

I improvised the extended description field, so you may want that changed.

@niw
Copy link
Owner

@niw niw commented Oct 24, 2020

Hi @aceontech, thank you for your pull request.

I was thinking a little bit about CocoaPods and I am not strongly feeling it’s necessary to add podspec file to the repository. Because CocoaPods users can use this library without having a podspec file in this repository.

For example, add next simple podspac file as like the one in your patch in the project then add pod 'KeyboardGuide', :podspec => 'path/to/KeyboardGuide.podspec' in Podfile, then it can use this library, since it doesn't have any dependencies (other than UIKit.)

Pod::Spec.new do |spec|
  spec.name = "KeyboardGuide"
  spec.version = "0.2.0"
  spec.authors = ""
  spec.summary = "KeyboardGuide"
  spec.homepage = "https://github.com/niw/KeyboardGuide"
  spec.platform = :ios, "11.0"
  spec.source = {
    :git => "https://github.com/niw/KeyboardGuide.git", :tag => "#{spec.version}"
  }
  spec.source_files  = "Sources/KeyboardGuide/*.swift"
end

Also, since CocoaPods is managing its package version by the podspec file content, not git tags. Therefore adding podspec file to the repository causes a certain type of legacy and an unnecessary restriction to the project repository that need to sync git tag and podspec file content change.

Now, Swift Package Manager is integrated in Xcode and I think it is getting a de-facto package manager for Apple platform. CocoaPods is one of 3rd party package management tools, and there are a few others commonly used for Apple platform such as Carthage. If the project supports one of these 3rd party one, it will ends up with adding more and more management files to the project and these will be legacy at some point near future when Swift Package adaptation increased, so I am worrying of it as well.

I am not fully making decisions about CocoaPod support (or Carthage,) as long as it is commonly widely used in the community, and wondering how it is difficult to use Swift Package Manager alongside CocoaPods or others, or migrate to it.

Thoughts?


spec.homepage = "https://github.com/niw/KeyboardGuide"
spec.license = "MIT"
spec.author = { "Yoshimasa Niwa" => "[email protected]" }

This comment has been minimized.

@niw

niw Oct 24, 2020
Owner

It can omit email, simply spec.author = "Yoshimasa Niwa" should be fine.

spec.description = <<-DESC
A modern, real iOS keyboard system notifications handler framework that Just Works.
Based on years experience of iOS application development and various tests on each iOS version and device, it supports both Swift and Objective-C and works mostly reasonably on the latest 3 versions of iOS, which is iOS 11, 12 and iOS 13 now, and covers almost all iOS users.
DESC

This comment has been minimized.

@niw

niw Oct 24, 2020
Owner

I think this description is not required, as you mentioned in the comment it's shorten version of content that users can see on GitHub repository.


spec.source = { :git => "https://github.com/niw/KeyboardGuide.git", :tag => "#{spec.version}" }
spec.source_files = "Sources", "Sources/**/*.{h,m,swift}"
spec.exclude_files = "Sources/Exclude"

This comment has been minimized.

@niw

niw Oct 24, 2020
Owner

This exclude_files is not needed, and path seems irrelevant.

spec.platform = :ios, "11.0"

spec.source = { :git => "https://github.com/niw/KeyboardGuide.git", :tag => "#{spec.version}" }
spec.source_files = "Sources", "Sources/**/*.{h,m,swift}"

This comment has been minimized.

@niw

niw Oct 24, 2020
Owner

This should be spec.source_files = "Sources/KeyboardGuide/*.swift" a little bit explicitly, in case later adding test target or others, which shouldn't be a automatically part of source_files.

spec.source_files = "Sources", "Sources/**/*.{h,m,swift}"
spec.exclude_files = "Sources/Exclude"

spec.swift_version = '4.2'

This comment has been minimized.

@niw

niw Oct 24, 2020
Owner

This swift_version is not needed I think, also 4.2 is quite old.

@aceontech
Copy link
Author

@aceontech aceontech commented Oct 31, 2020

Hi @niw!

Actually, I agree wholeheartedly with all of the points you made. I didn't know about the :podspec trick, so I'll be using that instead. With that in place, there is really no need to include the podspec. I will be moving my projects to SwiftPM soon anyway.

Thanks!

@aceontech aceontech closed this Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.