ionic-team/trapeze

Issues when adding entries to build.gradle

skle opened this issue · 0 comments

I'm using the @capacitor-community/photoviewer plugin and trying to automatically insert entries into the build.gradle file.

I'm trying to insert the following row into the 'buildscript' block:

ext.kotlin_version = '1.8.20'

The Yaml code i'm using is:

      - file: build.gradle
        target:
          buildscript:
        inserType: 'variable'
        insert:
          - extkotlin_version: "'1.8.20'"

The result is that the row is inserted but each time i run Trapeze it inserts another row.

I'm also trying to insert a classpath to the buildscript/dependencies block:

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

The Yaml code i'm using is:

      - file: build.gradle
        target:
          buildscript:
            dependencies:
        insert:
          - classpath: '"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"'

The result is that this row is also inserted each time i run Trapeze. But also the $kotlin_version postfix is removed. I tried to escape the $ sign but to no avail.

The final result after running Trapeze 3 times is:

image

I've tried to us the 'replace' function instead of 'insert' but to no avail.

Can anyone tell me what I'm doing wrong or is what I'm trying to achieve simply not possible?