-
Notifications
You must be signed in to change notification settings - Fork 4
How to debug UI Kit locally
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.
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.
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.
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
.