Commit 2ffc2bcd authored by Jaden's avatar Jaden Committed by Flavio TARSETTI

update development docs for bob.devtools, fixes #201

parent 282a24eb
......@@ -9,14 +9,14 @@ This section is a compilation of notes and advice about how to develop the ``bea
Preparing the package for development
=====================================
The requirements for installing and preparing the ``beat.editor`` package for development are as following:
The requirements for installing and preparing the ``beat.editor`` package for development are as following:
#. Linux or MacOS
#. Working internet connection
#. Useable Conda setup (see `Bob's documentation on it <https://www.idiap.ch/software/bob/docs/bob/bob/master/install.html>`_)
#. Up-to-date Firefox and Chrome browsers (both need headless support, a relatively recent feature)
#. Docker installed and available to the current user
#. A relatively recent version of `NodeJS & NPM <http://nodejs.org/>`_.
#. `NodeJS version 9.x & the associated NPM version <http://nodejs.org/>`_.
Installation Steps
------------------
......@@ -24,31 +24,30 @@ Installation Steps
#. Clone the ``beat.editor`` repository: ::
$ git clone git@gitlab.idiap.ch:beat/beat.editor.git
$ cd beat.editor
#. Clone the ``bob.admin`` repository, necessary for building a development Conda environment: ::
#. Build a development Conda environment using `the Bob/BEAT CLI tool <https://www.idiap.ch/software/bob/docs/bob/bob.devtools/master/install.html>`_: ::
$ git clone git@gitlab.idiap.ch:bob/bob.admin.git
$ conda create -n bdt -c https://www.idiap.ch/software/bob/conda bob.devtools
#. Use ``bob.admin`` to create a development Conda environment named ``beatedit`` for Python 3.6: ::
$ conda activate base
$ conda install pyyaml # install a dependency that isn't fetched by default
$ cd beat.editor
$ ../bob.admin/conda/conda-bootstrap.py --overwrite --python=3.6 beatedit
#. We will need the ``buildout`` command, so install the `bob.buildout` package to the new environment as well: ::
#. Activate the created environment and use the ``buildout`` command from ``bob.buildout`` in the new environment to generate the executables for ``beat.editor``: ::
$ conda install -n bdt -c https://www.idiap.ch/software/bob/conda bob.buildout
$ conda activate beatedit
$ buildout
#. Note for development mode: Add the line ``dependent-scripts = true`` then use the ``buildout`` command to ensure to generate all the executables in the ``bin/``
folder even ``beat`` for ``beat.editor``: ::
#. Activate the created environment and use the ``bdt`` command from ``bob.devtools`` to build the ``beat.editor`` package: ::
$ conda activate bdt
$ bdt build
#. For development, we want to generate all our CLI tools in the ``beat.editor`` project folder. Add the line ``dependent-scripts = true`` to ``buildout.cfg`` under the ``[scripts]`` section and use the ``buildout`` command to generate all the package's executables in ``bin/``: ::
$ buildout
#. In ``bin/`` you should several new executables for the project. The Python setup part is done.
#. In ``bin/`` you should several executables for the project, including a ``beat`` executable that is the entry point to the server. The Python setup is now complete, but the Javascript environment needs to be similarly set up for development work.
#. Go into the root folder for the Javascript and install the dependencies via NPM: ::
#. Go into the root folder for the Javascript and install the dependencies via NPM (this will take a few minutes): ::
$ cd conda/js
$ npm install
......@@ -61,11 +60,11 @@ Installation Steps
$ npm start
#. In a separate terminal tab/window, go back to the root of the ``beat.editor`` project and run the web server in development mode: ::
#. In a separate terminal tab/window, go back to the root of the ``beat.editor`` project and run the web server in development mode using that ``beat`` executable: ::
$ ./bin/beat editor serve --dev
#. You should now be able to go ``localhost:9101`` in your browser to see the ``beat.editor`` web app, now served by the webpack dev server.
#. You should now be able to go ``localhost:9101`` in your browser to see the ``beat.editor`` web app, now served by the webpack dev server. This dev server will watch the Javascript/JSX files on disk and rebuild the web app when any of the files change.
Important Concepts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment