Debugging

Timo Abele Gerd Aschemann Jody Winter Ralf D. Müller

2 minutes to read

Things not working as you expected? Here are some tips that might help you.

Environment

To get the best out of docToolchain, we recommend that you set up a development environment. This way you get to see the inner workings and you also get to add extra debug output to the tasks that you want to inspect.

Gradle

You get more hints about what is going on with Gradle when you add the --info flag to your ./dtcw generateSite command:

./dtcw generateSite --info

This outputs all config settings as seen by docToolchain along with many other internal settings.

jBake Templates

If something goes wrong with a template, you typically don’t receive much information about the problem. Take a look at menu.gsp to see how you can use try/catch blocks to get an error message. But to find out where the problem is occurring, you’ll need to use the poor man’s debugger and add some System.out.println statements. Make sure that you use the full System.out.println statement and not only println otherwise you won’t see any output.

Theming, Menu and Images

How the system creates the menu entries might seem like magic, but sometimes you cannot work out why an image is not shown. Remember, there is a way that you can check the generated files.

Check the build/microsite/tmp folder to see the folder that is fed into jBake. In this folder, all files will have additional jbake attributes which are used to build the menu. They are generated from the original attributes of the file and folder/filename information. Now check the build/microsite/output folder to see the generated result. This often helps you find out where an image actually is located.

Script Execution Debugging

The execution of the ../../../bin/doctoolchain bash script may be traced by setting the environment variable DTC_BASH_OPTS to, e.g., -vx.