Tuesday, 8 February 2022

Replace an XML file for each flavour in android

I am trying to integrate Braze into my application for push notification. Braze need us to create a braze.xml file inside src/main/res/values where we add the API key and other braze related stuff(here is the documentation).

Now I need to differentiate prod and qa environment meaning they will have 2 different API keys.

I was wondering how I could use a different braze.xml for different flavours.

I found this:

sourceSets {
    main {
         java {
            srcDirs = ['src']
         }
    }

    test {
        java {
            srcDirs = ['test']
        }
    }
}

and I was wondering how to use it to replace my braze.xml for different build variants.



from Replace an XML file for each flavour in android

No comments:

Post a Comment