...
Create a branch based on master. This can have any name you deem fit e.g
travis-deploy-javadoc
Add a gradle task in the project build file for generating javadocs in the project’s build.gradle file as shown here
For a library make sure this gradle task is placed on the library’s build.gradle file and not the sample app’s build.gradle file.
In the travis.yml file add a command for generating the javadocs as shown here on line 53 and 54. This goes in the
script
sectionIn the travis.yml file add a github pages provider which will deploy the javadocs to the github pages branch as shown here on line 58 to 64 . The special note of the following variables :-
local_dir
This variable specifies the location where the generated javadocs are found in the project structure
branch
The branch on which the deployment will be triggered on when a git push is done. Branch created on step 1 e.g
travis-deploy-javadoc
. This will be changed later tomaster
In the travis.yml file add the encrypted github access token to the
global env
section as shown herePush these changes. After a successful build the generated javadocs should be published on http://smartregister.org/{project repo name}
After confirming that the javadocs have been published, change the deploy branch to master as shown here . This is done so as to ensure that publishing of the javadocs is only done after changes are merged to master.
...