Skip to content

[Issue #77] Clean up platform specific logic and remove unnecessary f… #82

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LowAmmo
Copy link

@LowAmmo LowAmmo commented Apr 8, 2025

…iles

  • Modify all of the os() compiler directives to just make an exception for linux, but group other platforms together

    • Will make supporting iPadOS & VisionOS easier in the future
  • Specify platform versions in Package.swift to match those in cocoapods

Description

Extracted some of the changes from #78 that are just around cleaning up the compiler directives around Linux vs Apple platforms.
Also cleaned up any around Swift version being >=5, and instead have the dependency managers (cocoapods or SPM) enforce already being on Swift 5+.

No logic changes - only restructured the "#if" logic to be a little cleaner, and should be able to easily support VisionOS, iPadOs, or other future Apple platforms without a code change - just a Package.swift or podspec change.

After Merging

After merging this in, could consider creating a new tag - 2.0.3.

Motivation and Context

This is Part 1 of resolving Issue #77

Trying to separate out the changes to make them easier to review. (from the discussion on the Pull Request #78 )

How Has This Been Tested?

Tested locally via unit testing and in our app that consumes this via SwiftJWT.

Checklist:

  • I have submitted a CLA form
  • If applicable, I have updated the documentation accordingly.
  • If applicable, I have added tests to cover my changes.

…sary files

* Modify all of the os() compiler directives to just make an exception for linux, but group other platforms together
  * Will make supporting iPadOS & VisionOS easier in the future

* Specify platform versions in Package.swift to match those in cocoapods
Copy link

sonarqubecloud bot commented Apr 8, 2025

@LowAmmo
Copy link
Author

LowAmmo commented Apr 8, 2025

@dannys42 - Here are JUST changes to clean up the compiler directives. So it looks like a lot of changes - but really it's all just swapping the order of the directive so instead of:

 #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
     // Apple Platforms Logic
 #elif os(Linux)
     // Linux/OpenSSL Logic
 #endif

I set everything up like this:

 #if os(Linux)
     // Linux/OpenSSL Logic
 #else
     // Apple Platforms Logic
 #endif

Also...looks like this repo is a mix of using spaces and tabs... If you want me to make everything tabs I can (or could also do a separate commit for that), just let me know.

@LowAmmo
Copy link
Author

LowAmmo commented Apr 30, 2025

@dannys42 - Just a ping to hopefully get this on your radar sometime soon...

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