Skip to content

Conversation

@tatsuky
Copy link
Contributor

@tatsuky tatsuky commented Jan 23, 2024

Hi, I'm new to this project. This PR adds the watchOS support for the supportedDestinations configuration, initially added in #1336.

Changes

  • Added the watchOS case to the SupportedDestination enum.
  • Added a configuration template for watchOS.
  • Added test cases.

Tests

You can use the following example spec to verify the changes.

name: MyProject
options:
  bundleIdPrefix: com.myapp
targets:
  MyWatchKitApp:
    type: application
    platform: watchOS
    sources: [MyWatchKitApp]
    settings:
      MARKETING_VERSION: 1
      CURRENT_PROJECT_VERSION: 1
    dependencies:
      - target: MyFramework
    info:
      path: MyWatchKitApp/Info.plist
      properties:
        WKCompanionAppBundleIdentifier: com.myapp
        WKApplication: true
  MyFramework:
    type: framework
    supportedDestinations: [iOS, watchOS]
    platform: iOS
    sources: [MyFramework]
    settings:
      GENERATE_INFOPLIST_FILE: YES

Thanks.

Comment on lines 46 to 47
case .watchOS:
return 5
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @yonaskolb and @amatig,
I'm wondering why the priorities are currently in this order and where watchOS should be. Any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding test cases helped me realize this - TARGETED_DEVICE_FAMILY and SUPPORTED_PLATFORMS are ordered based on this priority. watchOS is 4, meaning it needs to be between tvOS (3) and visionOS (7).

Copy link
Collaborator

@giginet giginet left a comment

Choose a reason for hiding this comment

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

Great contribution! I wished this feature 💯

I'll test this feature for my use case.

}


$0.it("supportedDestinations merges settings - iOS, watchOS") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These tests can be parameterized tests to reduce redundancy.

But it's better existing test cases also become parameterized tests.
So I think it's good at this time.

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

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

Thank you @tatsuky

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.

5 participants