variants icon indicating copy to clipboard operation
variants copied to clipboard

Allow multiple Bundle ID and/or per target Bundle ID

Open devmauvsantos opened this issue 3 years ago • 3 comments

Background

Currently, it is mandatory to have a bundle_id on our target list and it needs to be a String, so for example:

variants.yml: bundle_id: 'com.bundle.id1'

Variants will populate the file fastlane/Matchfile with: app_identifier("com.bundle.id2")

But as listed here: https://docs.fastlane.tools/actions/match/#handle-multiple-targets Fastlane already supports multiple targets/bundle IDs

Solution

Two possible solutions would be to allow the user to set a list of bundle ids or multiple targets w/ bundle id.

Example 1:

    xcodeproj: YourXcodeProj.xcodeproj
    targets:
      YourApp:
        name: Your App
        bundle_id: 
           - com.bundle.id1
           - com.bundle.id2
           - com.bundle.id3
        test_target: YourAppTests
        app_icon: AppIcon
        source:
          path: Sources
          info: Sources/Info.plist
          config: Sources

Example 2:

    xcodeproj: YourXcodeProj.xcodeproj
    targets:
      - YourApp:
           name: Your App
           bundle_id: com.bundle.id1
           test_target: YourAppTests
           app_icon: AppIcon
           source:
             path: Sources
             info: Sources/Info.plist
             config: Sources
      - YourAppTarget2:
           name: Your App
           bundle_id: com.bundle.id2
           test_target: YourAppTests
           app_icon: AppIcon
           source:
             path: Sources
             info: Sources/Info.plist
             config: Sources

Expecting the result to be: fastlane/Matchfile app_identifier(["com.bundle.id1", "com.bundle.id2", "com.bundle.id3"])

devmauvsantos avatar Apr 12 '22 13:04 devmauvsantos

Right now each variant has a bundle ID, either specified directly or using the default bundle ID + ID suffixes:

default: com.bundle.id // taken from app.bundle_id variant1: com.bundle.id.aVariantsSuffix // app.bundle_id + id_suffix variant2: com.variant.custom // completely overriding default

When switching to a variant, the bundle ID of that specific variant is configured in the project and also specified in fastlane/Matchfile.

With this in mind, what is the benefit of having multiple ids in fastlane/Matchfile?

arthurpalves avatar Feb 13 '23 11:02 arthurpalves

@arthurpalves to me no value right now as I am not using variants sadly, but our use case used to be we had a project that were 5 different apps, with 4 different environments.

So we used to have:

  • Bank 1 - Dev

  • Bank 1 - Dev 2

  • Bank 1 - Stg

  • Bank 1 - Prod

  • Bank 2 - Dev

  • Bank 2 - Dev 2

  • Bank 2 - Stg

  • Bank 2 - Prod

...

And with that we had a difficult time with so many variants. Apart from that the biggest issue we had was that, for Fastlane we needed the Matchfile to have:

app_identifier(["com.backbase.bank1", "com.backbase.bank2", "com.backbase.bank3"])

So we could run our pipelines once and get the certificate for all of them easily.

devmauvsantos avatar Apr 11 '23 18:04 devmauvsantos

@devmauvsantos I see. We have similar requirements internally. @noursandidb is working on solving this 👍🏽

arthurpalves avatar Apr 25 '23 14:04 arthurpalves