Skip to content

Replace mode in gradle config not working with arrays #219

@Arturs-E

Description

@Arturs-E

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?

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