Skip to content

Supporting Android #110

@mortenbekditlevsen

Description

@mortenbekditlevsen

Hi there,
I am trying to build combine-schedulers for Android, but cross-compiling from macOS.

By updating dependencies for swift-concurrency-extras to 1.3.2 and xctest-dynamic-overlay to 1.7.0 I can get the package compiling by adding the OpenCombineSchedulers trait.

Unfortunately traits don't appear to work transitively, so when including combine-schedulers as a dependency to swift-dependencies (which is my goal to get building for Android), then I can't pass the trait.

And as I am building on macOS, the following lines in the Package.swift have no effect:

#if !canImport(Darwin)
  package.traits.insert(
    .default(enabledTraits: ["OpenCombineSchedulers"])
  )
#endif

Would it be sufficient to check for the platform when conditionally depending on OpenCombineShim?

So:

        .product(
          name: "OpenCombineShim",
          package: "OpenCombine",
          condition: .when(platforms: [.linux, .android])
        ),

rather than:

        .product(
          name: "OpenCombineShim",
          package: "OpenCombine",
          condition: .when(platforms: [.linux, .android], traits: ["OpenCombineSchedulers"])
        ),

?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions