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

Issues when adding entries to build.gradle #210

Open
skle opened this issue Jan 25, 2024 · 0 comments
Open

Issues when adding entries to build.gradle #210

skle opened this issue Jan 25, 2024 · 0 comments

Comments

@skle
Copy link

skle commented Jan 25, 2024

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?

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