Вопрос

I have a set of apps which are basically white labels of one app. The basic app has a web backend. With ant, when I ran the debug build of a white label app, the library project was compiled as debug with dev_server parameters and when I compiled a release build, the live_server parameters were used. Other parameters (and resources) were overridden by the white label app and it all worked pretty well.

So basically, if I compiled a white label for app 1 and debug build, the app was compiled for <dev_server>/1 as the basic service address and so on.

With gradle, I've tried different strategies but can't get it to work quite as conveniently without setting each parameter in each app's build.gradle. The basic problem seems to be that a library project with gradle always builds in release so I can really change backend parameters based on what build I'm using.

Any ideas how to set up the project structure to make it work that way?

Это было полезно?

Решение

Instead of library project, try going for the productFlavour concept as mentioned here http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Product-flavors

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top