Advanced configuration

revd script is used to either compile individual groups of files or to compile from a revdebug.json configuration file that can be present in the topmost directory of the project. revdebug.json can contain only options, options, and files for the project or multiple hierarchical subprojects with their own options each of which can be instrumented individually. Command line configuration options can override options in revdebug.json if you wish to build a subproject with different options than are specified in revdebug.json.

revd manages the source files you are instrumenting by copying the clean originals to a parallel directory tree under revdsrc/ at the top-level directory of the project and replacing the original files with instrumented versions. This is done so that the original project does not have to be aware of or changed for RevDeBug.

The top-level directory for the project is considered to be the first at or above the current level which contains a package.json or revdebug.json file. All operations are executed with respect to this directory, even if you run revd in a subdirectory.

For example, the following will instrument all the Javascript files in the current directory:

revd *.js

For all Javascript files in all subdirectories as well:

revd "**/*.js"

Note: The quotes are needed to prevent the shell from expanding the wildcards incorrectly on its own. Use quotes around wildcards whenever there is doubt.

If the previous commands are not run in the top project directory then an appropriate path configuration value will be set to make sure the compilation is relative to the top.

If project files are defined in revdebug.json then the project can be instrumented by doing: revd

And if multiple projects or subprojects are defined then they may be instrumented as follows:

revd .project1 

Or for a subproject of .project1:

revd .project1.subproject1

Project names always start with a dot character and the alias for the top-level project is just a dot.

Compiler

In addition to being able to specify all project options on the command line, there are options that can only be passed on the command line in order to tell the compiler what to do or to control behavior, they are:

revdebug.json file structure

The structure of the revdebug.json configuration file may be as follows (please note the names "option1", "option2" etc... used are just placeholders for the actual option names listed farther down):

{
    "option1": option1,
    "option2": option2,
     ...
}

This is for a simple configuration that only specifies options, files would be specified on the command line. For a configuration that specifies what files to instrument:

{
    "option1": option1,
    "option2": option2,
     ...
    "files": "files" or ["files", "more files", ...]
}

You can even specify multiple hierarchical nested projects with their own options as:

{
    "option1": option1, top-level options (inherited by subprojects),
    "option2": option2,
     ...
    ".project1": {
        "option1": option1, options here override parent
        "option2": option2,
        ...
        "files": "files" or ["files", "more files", ...]
    },
    ".project2": {
        "option1": option1, options here override parent
        "option2": option2,
        ...
        ".subproject1": {
            "option1": option1, options here override parent
            "option2": option2,
            ...
            "files": "files" or ["files", "more files", ...]
        },
        ".subproject2": {
            "option1": option1, options here override parent
            "option2": option2,
            ...
            "files": "files" or ["files", "more files", ...]
        }
    }
}

List of options

The actual options are as follows:

All these options can be specified on the command line to override any options in the revdebug.json file, so for example to set host on the command line specify --host address. Options that are boolean such as --apm or --sourceMap can be specified on the command line as such to indicate true or --noapm and --nosourceMap to indicate false, --apm=true and --apm=false are also accepted.

Last updated