Skip to content

add a CocoaPods podspec generator#54

Merged
weissi merged 3 commits intoapple:masterfrom
weissi:jw-podspec-generator
Apr 30, 2019
Merged

add a CocoaPods podspec generator#54
weissi merged 3 commits intoapple:masterfrom
weissi:jw-podspec-generator

Conversation

@weissi
Copy link
Copy Markdown
Member

@weissi weissi commented Apr 15, 2019

Motivation:

Users ask for a CocoaPod. Unfortunately, the CocodPod SwiftLog is
already taken, so I went for SwiftLogAPI.

Modification:

Add a podspec generator.

Result:


Example output:

Pod::Spec.new do |s|
  s.name = 'SwiftLogAPI'
  s.version = '1.0.0'
  s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
  s.summary = 'A Logging API for Swift.'
  s.homepage = 'https://github.com/apple/swift-log'
  s.author = 'Apple Inc.'
  s.source = { :git => 'https://github.com/apple/swift-log.git', :tag => s.version.to_s }
  s.documentation_url = 'https://github.com/apple/swift-log'
  s.module_name = 'Logging'

  s.swift_version = '5.0'
  s.cocoapods_version = '>=1.6.0'
  s.ios.deployment_target = '12.0'
  s.osx.deployment_target = '10.14'
  s.tvos.deployment_target = '12.0'

  s.source_files = 'Sources/Logging/**/*.swift'
end

@weissi weissi force-pushed the jw-podspec-generator branch from 88452ee to 5741d31 Compare April 15, 2019 10:30
@weissi weissi requested a review from tomerd April 15, 2019 10:30
@weissi weissi force-pushed the jw-podspec-generator branch from 5741d31 to 1021e23 Compare April 15, 2019 10:35
@weissi weissi added the 🔨 semver/patch No public API change. label Apr 15, 2019
@weissi weissi added this to the 1.0.1 milestone Apr 15, 2019
@larryonoff
Copy link
Copy Markdown

Please see below my feedback:

  1. I don't see watchOS as a deployment target. Is it supported? I don't think that there're limitations to support watchOS.
  2. What about name 'AppleSwiftLog' or 'swift-log' instead of 'SwiftLogAPI'?

@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 15, 2019

Please see below my feedback:

  1. I don't see watchOS as a deployment target. Is it supported? I don't think that there're limitations to support watchOS.

Oh thanks! Would you mind checking if it works? I have no idea how to build a Watch app :)

  1. What about name 'AppleSwiftLog' or 'swift-log' instead of 'SwiftLogAPI'?

Could do that, or maybe SSWGSwiftLog. @tomerd / @ktoso / @ianpartridge / @tanner0101

@ianpartridge
Copy link
Copy Markdown
Contributor

SwiftLogAPI seems fine to me - it makes it clear that this is an API package, not a backend.

@ktoso
Copy link
Copy Markdown
Member

ktoso commented Apr 15, 2019

A bit unfortunate with the module name already occupied hm... SwiftLogAPI sounds fine though.
Would we care to have all API packages in both systems adopt same naming style for this?

@weissi weissi force-pushed the jw-podspec-generator branch from 1021e23 to 6a1a52d Compare April 16, 2019 18:43
@weissi weissi requested review from ktoso and tomerd April 16, 2019 18:44
@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 16, 2019

@tanner0101 you also fine with pod name SwiftLogAPI?

@weissi weissi force-pushed the jw-podspec-generator branch from 6a1a52d to 7400e10 Compare April 16, 2019 19:43
@weissi weissi force-pushed the jw-podspec-generator branch from 7400e10 to 1359044 Compare April 17, 2019 08:01
@weissi weissi requested review from ktoso and tomerd April 17, 2019 08:02
Copy link
Copy Markdown
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
(opinion on package name == neutral... people who actively use CocoaPods would have opinions / ideas I guess)

@allenhumphreys
Copy link
Copy Markdown
Contributor

allenhumphreys commented Apr 17, 2019

Why is the iOS/tvOS deployment target 12 and macOS 10.14? Are there any unavailable APIs in use? (I'm currently using all this source deploying to iOS 11)

In fact, I can compile all the way down to iOS 8 :-)

@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 17, 2019

Why is the iOS/tvOS deployment target 12 and macOS 10.14? Are there any unavailable APIs in use? (I'm currently using all this source deploying to iOS 11)

Very happy to relax the version here if you tell me what the lowest version is that you could confirm actually working.

@allenhumphreys
Copy link
Copy Markdown
Contributor

@weissi I'll report back shortly

@allenhumphreys
Copy link
Copy Markdown
Contributor

@weissi Here is a git repo that has a rather large set of Apple targets. It uses a local version of the podspec with the following deployment targets:

s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'

iOS, tvOS, and watchOS are informed by Xcode 10.2's minimums that the GUI allows. macOS is 10.9 because Swift isn't supported with a lower deployment target.

I did not actually test on the old platforms running these versions as that could be a rather complicated endeavor. The key thing is that it compiles correctly with these deployment targets. If users actually have issues with running on those older platform versions, that'll be the most informative to any other changes I'd think.

I did verify functionality on all the latest simulators as well as my mac @ 10.14.

@allenhumphreys
Copy link
Copy Markdown
Contributor

Also wanted to mention there was a lot of conversation about the Pod name being SwiftLogAPI, but the actual module name in code is still Logging which means import Logging in actual source code which aligns with SPM integration method. 👍

@weissi weissi force-pushed the jw-podspec-generator branch from 1359044 to 0a4743d Compare April 17, 2019 16:03
@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 17, 2019

@weissi Here is a git repo that has a rather large set of Apple targets. It uses a local version of the podspec with the following deployment targets:

Thank you so much! I updated this PR, please check :).

Also wanted to mention there was a lot of conversation about the Pod name being SwiftLogAPI, but the actual module name in code is still Logging which means import Logging in actual source code which aligns with SPM integration method. 👍

I mean we can also name the pod Logging if that's what you're suggesting, that name is still available. @tomerd / @ianpartridge / @ktoso / @tanner0101 ?

@ktoso
Copy link
Copy Markdown
Member

ktoso commented Apr 17, 2019

A bit hard for me to comment on package naming -- don't know that ecosystem very well... whichever you think works best 👍

@allenhumphreys
Copy link
Copy Markdown
Contributor

In the pods ecosystem, having module names match the pod names is pretty common if it's possible. It actually took me a few minutes to realize I shouldn't be doing import SwiftLogAPI.

@shuoli84
Copy link
Copy Markdown

@weissi I believe it is better to use Logging as package name. It will lock the name to prevent other lib use this general name. Sorry for the late comment.

@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 23, 2019

Thanks @shuoli84 . @tomerd / @ianpartridge okay with making the CocoaPod just Logging then?

@ianpartridge
Copy link
Copy Markdown
Contributor

Fine by me. Really hope we don't have to do CocoaPods for very long!

@weissi weissi force-pushed the jw-podspec-generator branch from 0a4743d to 99ea1a1 Compare April 23, 2019 11:16
@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 23, 2019

@ianpartridge thanks, I updated the PR to use Logging. If @tomerd is happy with this I think I'll pull the trigger and upload it.

@tomerd
Copy link
Copy Markdown
Member

tomerd commented Apr 23, 2019

no strong feeling here, but is it worth reaching out to the owner of SwiftLog pod and see if he wants to work with us on this

@tomerd
Copy link
Copy Markdown
Member

tomerd commented Apr 23, 2019

@daltoniam ^^

Motivation:

Users ask for a CocoaPod. Unfortunately, the CocodPod `SwiftLog` is
already taken, so I went for `SwiftLogAPI`.

Modification:

Add a podspec generator.

Result:

Happier users.
@weissi weissi force-pushed the jw-podspec-generator branch from 99ea1a1 to 970c1aa Compare April 23, 2019 17:41
@weissi
Copy link
Copy Markdown
Member Author

weissi commented Apr 25, 2019

@tomerd the SwiftLog pod has already a published version 1.0 so I'm not sure if we should use that (even if we could). What do you propose to go forward here? pod name Logging?

@tomerd
Copy link
Copy Markdown
Member

tomerd commented Apr 25, 2019

What do you propose to go forward here? pod name Logging?

yes, lets do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CocoaPods / Carthage support

7 participants