Note that there are some explanatory texts on larger screens.

plurals
  1. POBuild configuration management in Android / Intellij / Jenkins
    text
    copied!<p>This question might be subjective, but I think Stackoverflow is still the best place to ask:</p> <p>The problem domain is "advanced Android programming". I do not need information how to set up a single Android project, how to use library projects, or how to use ANT to build a normal project.</p> <p>Assume you got a running App, an ordinary Android project (IDE of choice is IntelliJ, but that should not really matter) build by Jenkins / Ant / Proguard. The result of this build is a final APK you would put in the Play store.</p> <p>Now imagine you need this App as a free and a paid version. No problem so far, simply put all shared code into a library project, and create two child projects, one with an App.java enabling license checks, the other one e.g. limiting the usage.</p> <p>Now imagine you want to target Amazon as well, maybe have a press release version, etc. So your code starts to diverge, with still a lot of stuff shared, but certain parts are specific to e.g. the market you target.</p> <p>In C# there are "conditional compilation statements", like "IF PLAY_STORE ...". Is there anything similar for Java / Android. Also, do they play nice with ANT and the build process.</p> <p>But I am not limited to conditional compilation. The "one project per market" approach is a different one. I am just trying to get a feeling of how you manage these various "build configurations" in a manner that is sustainable. Meaning it works for 15 projects, targeting 3 markets in 2 flavors (FREE and PAID). I hope you see what I am hinting at. The code is very very similar for all Apps, but with the example above I will have 90 different APKs - with these numbers the "manually commenting in source code only needed by this build, etc" just does not cut it anymore.</p> <p>So any tips, tools, search words, experiences with these problem domain (e.g. MAVEN, would it help me with any of it, or is ANT + scripts generating build.xml be better). Another example, if I have a "real" Android project for all target markets, this would allow me to do almost anything. But of course, on the downside, if I add a new page in the lowest level (e.g. a imprint page) I would need to go into 90 Manifest.xml to add the page...</p> <p>Thanks for any help with this, Chris</p> <p>PS: I will add some links I find regarding this topic at the bottom, if anybody comes across this question while there are no answers, this might be a "first read this" section</p> <p><a href="http://www.asyncdev.net/2011/02/android-dev-prod-builds/" rel="noreferrer">http://www.asyncdev.net/2011/02/android-dev-prod-builds/</a></p> <p><a href="http://www.slf4j.org/" rel="noreferrer">http://www.slf4j.org/</a> (related in the "put JAR in to provide IMPL" way)</p> <p>(The SLF4J is just a nice approach to reduce dependencies and provide configuration during deploy - by simply adding a different JAR. To use something like this might be overkill for your own projects, but it would be one way. E.g. for license write interface and a bit of code like SLF4J, then provide either PressRelease.jar or Productive.jar in Lib folder during build, changing how the app behaves...)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload