Reputation: 1582
I am having two versions of my android project (release and debug). They both are sharing the same source files. I want the debug version to be intact when we checkin any changes for release build. It is not working as we cant have 2 different manifest files for it and if we make change in manifest, it will affect both the projects and keep them out of sync. Is there any way we can have different build configurations for same project? Please advise.
Thanks
Upvotes: 0
Views: 59
Reputation: 28529
If you don't want to impact the debug app when changing the release source files you'll have to use different source files. Having different build files or configuration will not help.
Gradle apps use at least 3 source folders.
src/main/...
is used by all variantssrc/debug/...
is used by the debug
variantsrc/release/...
is used by the release
variantTo do a change that only impact the release variant, just edit code in src/release/...
. This can contain a manifest, res, java code, etc...
That said I'm not why you don't want to change the debug version when changing the release version. The whole point of the debug version is to be the same as the release, except debuggable. The different source folders above should only be used for minor things (like enabling/disabling log output for instance). Making both versions different in bigger ways is not recommended.
Upvotes: 1