ionic-team / trapeze

The mobile project configuration toolbox. Manage native iOS, Android, Ionic/Capacitor, React Native, and Flutter apps through a simple YAML format.
https://trapeze.dev
Other
319 stars 39 forks source link

Unable to execute more than one `replace` or `insert` value in `variables.gradle` #182

Closed csahid closed 1 year ago

csahid commented 1 year ago

Hello, I need to replace the values of multiple line in my variables.gradle but it seems that trapeze only go for the first change it sees.

Here is my config.yml at the gradle level:

platforms:
  android:
    versionName: $VERSION_NAME
    versionCode: $CI_BUILD_NUMBER
    gradle:
      - file: variables.gradle
        target:
          ext:
            compileSdkVersion:
        replace:
          compileSdkVersion: 32

      - file: variables.gradle
        target:
          ext:
            targetSdkValue:
        replace:
          targetSdkValue: 33

      - file: variables.gradle
        target:
          ext:
        insertType: 'variable'
        insert:
          - rgcfaIncludeGoogle: true
          - rgcfaIncludeFacebook: true

This configuration is able to change the value of compileSdkVersion correctly but not the rest.

I don't know if there is a problem in my yaml file or with trapeze, can you help please ? Thanks

edit : Also it seems that the issue is happening when we try to modify the same file multiple times ; if there is 2+ modifications in a single file, the first one is taken into account then trapeze goes to the next file in the list and does the same thing : makes only the first modification it sees and goes to next file in line, etc...

Ichoui commented 1 year ago

Same here ... it would be really practical to modify the file more than 1 time 😬