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

Allow free choice of different display name as per the custom variant #237

Open
dileepZion opened this issue Mar 27, 2024 · 2 comments
Open
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@dileepZion
Copy link
Contributor

Background

  • If it is an enhancement of an existing feature, describe which feature and how it works at the moment.
  • Currently the V_APP_NAME as per the tool, works to change the Bundle name(Target name) and also the Bundle Display name.
    Hence it is not possible to use only V_APP_NAME or app_name as a parameter to switch to different names of the app.
    Currently when I have gone through the code, here is the below way to update the info.plist
    In XCConfigFactory, updateInfoPlist method has below code:
Bash("plutil", arguments: "-replace", "CFBundleName", "-string", "$(V_APP_NAME)", configFilePath),
Bash("plutil", arguments: "-replace", "CFBundleDisplayName", "-string", "$(V_APP_NAME)", configFilePath),
Bash("plutil", arguments: "-replace", "CFBundleExecutable", "-string", "$(V_APP_NAME)", configFilePath),

Solution

It is good if we only give the V_APP_NAME to CFBundleName and CFBundleExecutable and allow the user to change CFBundleDisplayName according to their own requirement. Like,
Dev -> APP_NAME_DEV
QA -> APP_NAME_QA
UAT -> APP_NAME_UAT

Thanks!

@dileepZion dileepZion added the enhancement New feature or request label Mar 27, 2024
@GMinucci GMinucci self-assigned this Jan 28, 2025
@GMinucci GMinucci added this to the Release 1.3.0 milestone Jan 28, 2025
@GMinucci
Copy link
Collaborator

GMinucci commented Feb 4, 2025

Hi @dileepZion , thanks for the suggestion. I was testing in the latest variants configuration and just using the app name I was able to rename my app without breaking anything. For example, the following configuration:

#
# Auto generated by Variants
#

ios:
    xcodeproj: VariantsTestApp.xcodeproj
    target:
        name: VariantsTestApp
        bundle_id: com.backbase.VariantsTestApp
        test_target: VariantsTestAppTests
    ...
    variants:
        default:
            ...
        Beta:
            id_suffix: beta
            ...
        Prod:
            id_suffix: prod
            app_name: Variants
            ...

This will produce the following apps:

  • Running variants switch will select the default variant and the app name will be VariantsTestApp
  • Running variants switch --variant beta will select the beta variant and the app name will be VariantsTestApp Beta since you are not providing a app_name, meaning the name will be the base name VariantsTestApp combined with the variant name Beta
  • Running variants switch --variant prod will select the prod variant and the app name will be Variants as it's specified in the app_name configuration for the variant
    Does that achieve the requirement already or is there anything missing?

@GMinucci GMinucci added the question Further information is requested label Feb 4, 2025
@GMinucci GMinucci removed this from the Release 1.3.0 milestone Feb 6, 2025
@GMinucci
Copy link
Collaborator

GMinucci commented Feb 6, 2025

Since the requested feature is working at the moment I'll move it out of the milestone. In case this is not working as expected we can re-add it to a later milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants