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

Upgrade PeerTalk project structure for Swift Package Manager #61

Closed
wants to merge 3 commits into from

Conversation

programmarchy
Copy link

Hello! I've got a big, opinionated, but hopefully useful PR, which does the following:

  • Adds support for Swift Package Manager
  • Consistently applies "PeerTalk" spelling (not "Peertalk" or "peertalk")
  • Fixes all warnings and upgrades projects files to latest Xcode
  • Configures tests for both iOS and macOS
  • Includes sample entitlements file for sandboxed macOS app
  • Moves examples into separate directory and xcworkspace
  • Bumps version to 2.0 (since this will be a breaking change)

This PR does not make any code changes, except the minimum necessary to play well with Swift Package Manager.

PR #56 got the ball rolling for Swift Package Manager, but it wasn't fully complete. So I continued that work, using the AFNetworking repo as a guide, since it supports Swift Package Manager, CocoaPods, a standard Framework target, and Carthage.

Here's roughly the steps that I took:

  • Renamed peertalk to Sources
  • Created Package.swift
  • Changed header imports to double quoted instead of angle bracketed (required by SPM)
  • Created two separate umbrella headers:
    • Sources/PeerTalk.h for SPM with double quoted headers
    • Framework/PeerTalk.h for use in the standard Framework targets
  • Moved Info.plist to Framework for use by standard targets and so it's not picked up by SPM
  • Renamed peertalk-tests to Tests and configured targets for both iOS and macOS
  • Performed recommended Xcode upgrades
  • Suppressed a warning CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER
  • Moved example projects into Example folder and created a separate xcproject and xcworkspace to house them
  • Regenerated the icons from the PDF in the etc folder
  • Searched and replaced i.e. s/Peertalk|peertalk/PeerTalk/g
  • Updated podspec to pick up source files in new path location
  • Deleted some apparently unused items (index.html and etc/styles.css)

Phew! It's a lot but I think this project was due for a spring cleaning.

I've tested the following:

  • Swift Package
  • Unit tests passing
  • macOS and iOS apps run and talk to each other
  • Building framework

But haven't tested CocoaPods or Carthage yet.

- Support Swift Package Manager
- Configure tests for both iOS and macOS
- Consistently apply "PeerTalk" spelling
- Include sample entitlements file for sandboxed macOS app
- Move examples into separate directory
- Upgrade project file to latest Xcode version
@programmarchy
Copy link
Author

Requesting review from @rsms @jonathandann

Also @tonyarnold @hughbe @sieren who also wanted Swift Package support

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

Successfully merging this pull request may close these issues.

1 participant