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

Replace mode in gradle config not working with arrays #219

Open
Arturs-E opened this issue Aug 5, 2024 · 0 comments
Open

Replace mode in gradle config not working with arrays #219

Arturs-E opened this issue Aug 5, 2024 · 0 comments

Comments

@Arturs-E
Copy link

Arturs-E commented Aug 5, 2024

When trying to replace an array value in app/build.gradle file, a new line is added instead of replacing the existing one.

I have a productFlavors section that i'm looking to update:

    productFlavors {
        prod {
            dimension "environment"
            manifestPlaceholders = [displayName:"My App"]
        }
    }

Replace mode works correctly for primitives, like the applicationIdSuffix property, however not so with manifestPlaceholders property, which is an array - instead of replacing the existing array, a new one - equal to the existing one - is created.

trapeze config.yaml file:

platforms:
  android:
    gradle:
      - file: app/build.gradle
        target:
          android:
            productFlavors:
              prod:
                manifestPlaceholders:
        replace:
          manifestPlaceholders: = [displayName:"My App"]

Currently it results in the following gradle config:

    productFlavors {
        prod {
            dimension "environment"
            manifestPlaceholders = [displayName:"My App"]
            manifestPlaceholders = [displayName:"My App"]
        }
    }

I've tried different configuration variants but nothing really seems to work. Is there something i'm missing in the configuration?

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

No branches or pull requests

1 participant