android - Add suffix to generated string resource -


i have gradle config setup below. allow side side installs of different builds/flavors

buildtypes {     release {     }     debug {         applicationidsuffix ".debug"         // somehow add debug suffix app id?     } } productflavors {     ci {         applicationid "com.myapp.ci"         ext.betadistributiongroupaliases = "mobileworkforce.ci"         resvalue "string", "app_name", "appname.ci"     }      staging {         applicationid "com.myapp.staging"         resvalue "string", "app_name", "appname.staging"     }      production {         applicationid "com.myapp"         resvalue "string", "app_name", "appname"     } 

the issue cannot figure out how update app_name string resource have suffix "debug" app_name string resource (used label application)

i able create viable solution using manifestplaceholders instead of generating string resources. not ideal because result appname.debug.ci instead of appname.ci.debug works.

buildtypes {     release {          manifestplaceholders = [ activitylabel:"appname"]     }     debug {         applicationidsuffix ".debug"                      manifestplaceholders = [ activitylabel:"appname.debug"]     } } productflavors {     def addactivitylabelsuffix = { placeholders, suffix ->         def appname = placeholders.get("activitylabel")         placeholders.put("activitylabel", appname + suffix);     }     ci {         applicationid "com.myapp.ci"         ext.betadistributiongroupaliases = "mobileworkforce.ci"         addactivitylabelsuffix getmanifestplaceholders(), ".ci"     }      staging {         applicationid "com.myapp.staging"         addactivitylabelsuffix getmanifestplaceholders(), ".staging"     }      production {         applicationid "com.myapp"         resvalue "string", "app_name", "appname"     } } 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -