Skip to content

How to debug UI Kit locally

Gabriel Aumala edited this page Jan 12, 2017 · 4 revisions

MonkeyChat has 2 main dependencies. The SDK and the UI Kit. The SDK is included in this repo, however, the UI Kit is not. if issues with the SDK appear, you can easily debug it because the source code is right there, but if the issues are with the UI Kit, things get more complicated.

To modify UI Kit classes while debugging MonkeyChat, the easiest approach is to use symlinks. To do this, you need to have the UI Kit repository somewhere in your computer.

Creating the symlinks

Open a terminal in the root directory of Monkey-Chat-Android and execute the following

ln -s <path/to/UIKit>/monkeykitui/ monkeykitui

These two commands create symbolic links to the monkeykitui module.

Use the symbolic links in gradle

For gradle to be able to find the modules in the symlink and compile them, first add them to your settings.gradle file. It should look like this:

include ':app', ':monkeyKit', ':monkeykitui'

Then, in the sample app's build.gradle file replace the line that pulls the UI Kit from jitpack with this one:

compile project(':monkeykitui')

Now after cleaning your project you should be able to sync with gradle and run the project. If you modify any UI Kit classes you have to go to the UI Kit directory to commit your changes.

Revert back to Jitpack UI Kit

Once you have merged your local changes in the UI Kit with the master branch of the github repo, you can stop using the symlink by editing removing it from the settings.gradle file.

include ':app', ':monkeyKit'

Then edit your app build.gradle to pull the UI Kit from jitpack instead of compiling the symlink.

compile 'com.github.Criptext:Monkey-UI-Android:<COMMIT-HASH>'

As you can see, with the help of a symlink you can toggle between using your local UI Kit or the one in Github simply by editing a single line in settings.gradle and build.gradle.