SCons tool for R. Automatically identifies .r script dependencies and outputs for use with SCons build system.
scons_r is an external tool for SCons and can most easily be installed by checking out the scons_r repository to either
- /path_to_your_project/site_scons/site_tools/scons_r/, for one project only, or
- ~/.scons/site_scons/site_tools/scons_r/, for installation for all your projects (SCons 2.1 or above).
See ToolsIndex for more details about installing external tools.
If the project is managed with git, this can be accomplished with submodules:
git submodule add https://github.com/kboyd/scons_r.git site_scons/site_tools/scons_r
In a SConstruct
or SConscript
file, create an environment
including the R tool and process an R script named input.r
with the
following python code.
env = Environment(tools=['scons_r'])
env.R('input.r')
scons_r contains both unit tests and end-to-end SCons style tests. Running them is currently very awkward, still searching for better way to setup and run the tests. My current approach is given below, but will need to be translated to each particular system for particular locations.
unittests (from repository root)
export PYTHONPATH=../:/usr/lib/scons-2.3.1
python unittest/regular\_expression\_test.py
end-to-end tests (from root of scons repo with runtest.py)
./runtest.py path\_to\_repo/test/basic.py