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

Update gradle.properties #198

Open
Ali-H888 opened this issue Aug 24, 2023 · 5 comments
Open

Update gradle.properties #198

Ali-H888 opened this issue Aug 24, 2023 · 5 comments

Comments

@Ali-H888
Copy link

Hello

I'm using "@trapezedev/configure": "^7.0.10" and I want to update the gradle.properties in android

Is there an option to update the variables inside it?

@marioshtika
Copy link

Hey @Ali-H888 did you find a way to do this?

I think at some point this was possible (#56) but I can not find it how to make it work.

@Ali-H888
Copy link
Author

Ali-H888 commented Feb 6, 2024

Hello @marioshtika, what I did was to replace the gradle.properties file with one of my own

platforms:
    android:
       ....
        copy:
            -   src: ../configuration/android/gradle.properties
                dest: gradle.properties

@marioshtika
Copy link

Hey @Ali-H888 thank you for your response, I was thinking of the same workaround.

I checked the repository and I saw that the properties operator exists in here
And the interface also exists in here

So something like this should have worked

platforms:
  android:
    properties:
      - file: gradle.properties
        entries: 
          android.enableJetifier: true

I followed the logic and it looks like it is working but it is not writing it back to the file

I am getting the below error message

Fatal error: Error running command
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received [Object: null prototype]

@mlynch can you take a look at this and check if this is a bug.

@Ali-H888
Copy link
Author

Ali-H888 commented Feb 6, 2024

@marioshtika Yeah, same here. I didn't check it since a while now, but you got me interested in finding why, and I think I did :)

If you check here you will find that they are passing data to the write file argument instead of the serialized string and that's what is causing the error. I tried changing it locally on my project and it worked when I replaced the data argument with the serialized variable.

@marioshtika
Copy link

marioshtika commented Feb 6, 2024

Hey @Ali-H888 you were right. I also tested this on my local machine and it worked.

I created a pull request for this and hopefully someone will merge it on the main branch.

@mlynch ^

Thank you in advance.

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

2 participants