From b8b9789a6975266433904b0ab4d381a9f3317986 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 21 Sep 2016 10:51:58 +0100 Subject: Rebuild apidsl'd headers in cmake. - Moved apidsl headers next to their generated versions. In the future, perhaps all (or most) headers will be apidsl-generated, so the sources should stay together. - Try to find apidsl/apigen binary and astyle binary and use it for the format test. Don't run the format test if these can't be found. --- docs/apidsl.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/apidsl.md (limited to 'docs') diff --git a/docs/apidsl.md b/docs/apidsl.md new file mode 100644 index 00000000..96ff5d0d --- /dev/null +++ b/docs/apidsl.md @@ -0,0 +1,51 @@ +This folder contains the input file (``tox.in.h``) that has to be used to generate the ``tox.h`` api with: https://github.com/TokTok/apidsl + +# Minimal requirements + +There are some minimal requirements to contribute to ``tox.h``: +* unix environment +* ``astyle`` ``>=2.03`` +* [``apidsl``](https://github.com/TokTok/apidsl) (you can use provided service with curl instead) + +## Quick way + +If you want to do it quickly and you don't have time for anything other than copypasting commands, you should have ``curl`` installed. + + +1. Make sure that you have ``curl`` and ``>=astyle-2.03`` installed +2. Modify [``tox.api.h``](/toxcore/tox.api.h) +3. Run command below ↓ + +Command to run from ``toxcore`` directory (quick way, involves using curl): +```bash +# For tox.h: +curl -X POST --data-binary @- https://apidsl.herokuapp.com/apidsl \ + < toxcore/tox.api.h \ + | astyle --options=other/astyle/astylerc \ + > toxcore/tox.h +# For toxav.h: +curl -X POST --data-binary @- https://apidsl.herokuapp.com/apidsl \ + < toxav/toxav.api.h \ + | astyle --options=other/astyle/astylerc \ + > toxav/toxav.h +``` + +You may want to make sure with ``git diff`` that changes made in ``tox.h`` reflect changes in ``tox.in.h``. + +And you're done. + + +## Manually + +If you prefer to have more control over what is happening, there are steps below: + +1. Install [``apidsl``](https://github.com/TokTok/apidsl) +2. Install ``astyle``, version 2.03 or later. +3. Modify [``tox.api.h``](/toxcore/tox.api.h) +4. Use ``apidsl`` ``??`` +5. Parse generated ``tox.h`` with astyle, minimal command for it would be: +```bash +astyle --options=other/astyle/astylerc toxcore/tox.h +``` + +**Always pass output from ``apidsl`` through astyle.** -- cgit v1.2.3