Skip to content

Working with different branches

Jaime Bosque edited this page Oct 6, 2020 · 4 revisions

Git allows the usage of branches, which means having the code organized in different lines of work. This allows any developer to divert from a specific line of work to perform a fix, or to create a new release, etc. As a general rule we work on fixes that are committed to the master branch and we freeze a branch per release. We also tag the code for each published release. With this in mind, it should be very easy for any developer to compile the application for any release.

Note: read more on branches and tags on the git official documentation

The information published by the DHIS2 Android team whenever there is a new release includes the information needed to compile the application. For example, from this announcement in the DHIS2 community or in the Github release information:


Community annoucement

Github release

In both cases we can see that the released App is using:

  • App: 2.1.2
  • SDK: 1.1.2
  • Rule Engine: so far we have not included this information as it hasn’t been changing but will be included in future releases. Getting the branch is possible though by inspecting the Github release information, in this case, we can get that the branch was android_2.0.1.

Note: we use semantic versioning to tag the releases of the submodules. Read more about this on the official website

We need to focus on the App version we want to compile disregarding the SDK and the Rule Engine. In this example we are going to use the 2.1.2 and so, we can click on the release information tag (image on the left) or manually find the tag in the main repository code (image on the right). Both will take us to the same “point in time” where we can get the rest of the information we need.

By clicking there we will be able to see the tags for the SDK and the RuleEngine if we check the repository:

In this case we can obtain that the version 2.1.2 was compiled with:

  • SDK tag: 18d180e
  • RuleEngine tag: 10af7eb

In Android Studio we can choose the branches or tags we are going to be working within the bottom right corner (clicking on Git). In this example we are choosing the ones mentioned above: