Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Prerequisites 
  • Building
  • Signing
  • QA Release
  • Production release
  • Debug Logs
  • Playstore

Prerequisites

Before creating any release artifacts, remember to tag the commit on Github for the codebase version that you'll use to create the release whether:

  • Library (aar) or implementation (apk)
  • Snapshot or Release version

This is helpful when one wants to revert back or check out the code base that created the specific release(s).

In the tag, add a bullet list summary of the main features/fixes introduced.

If it is a release (as opposed to snapshot), use the Github Draft Release feature. Check out https://help.github.com/en/articles/creating-releases

NB: It is not recommended to do that for the snapshot versions. 

Building

In order to create a release APK, all libraries in the OpenSRP chain have to have been built in the release variant. That is, if your application depends on the opensrp-client-core library, the library has to be built in the release variant.

...

Debug logs

In production, it is bad practice to have debug logs turned on. They may carry sensitive information that was being logged during development. To ensure that the release APK does not have debug logging, add this snippet to your proguard-rules file (proguard-rules.pro). 

-assumenosideeffects class android.util.Log {
public static *** d(...);
}

This strips out debug logs but you can strip out other modes as well.

Some information should never be logged using the modes if you don't intend to strip them. For more info, check out https://developer.android.com/reference/android/util/Log

...

Sometimes the process of creating the release which includes shrinking, optimization and obfuscation produces unexpected side effects that may be easily caught in the QA process.

Why follow this release process for production APKs?

Unlike the debug variant, the release variant is highly optimized for size and performance. For more information on this and more checkout this link https://developer.android.com/studio/build/shrink-code.html

NB: For releases, OpenSRP is currently in the process of implementing a regular release schedule for the release variants of the libraries to be upload on maven.