Description Usage Arguments Details Examples
The idea of build automation is not new. GNU Make and Java Ant are well established and robust build automation systems but require the use and installation of additional software. The makeR package provides a sim- plified framework written entirely in R to manage Sweave projects where multiple versions are created based upon a single source repository. For example, a monthly report where each version is identical, with perhaps the exception of easily extracted properties (e.g. date ranges for data extraction, title, etc.).
1 2 3 4 |
projectDir |
the root directory of the project. |
name |
the name of the project. Only used for new projects. |
sourceDir |
the directory containing the source files. Only used for new projects. |
buildDir |
the directory where built versions will be located. Only used for new projects. |
releaseDir |
the directory where released versions will be located. Only used for new projects. |
sourceFile |
the source file to be built. This can be a file pattern (e.g. .rnw$) so that multiple files of the same type can be built or a single file. The comparison will be done ignoring case. |
properties |
list of global properties for the project. |
Most interaction with the makeR
package will occur
through the Project
class. Project
is an S3
class that defines some generic functions (e.g. print).
The Project
class contains a number of properties
and methods. By convention, properties begin with a
capital case letter and methods begin with a lower case
letter. Each is accessedd using the dollar sign notation
(e.g. myproject$build()
). See below for details
for each property and method.
See demo('rbloggers')
for an interactive example.
Properties:
BuildDir
- the
directory where builds will occur.
Builds
-
list of completed builds.
CurrentBuild
- an
integer of the last build.
ProjectDir
- the
base directory where the project is located.
ProjectFile
- the name of the source file to be
built.
ProjectName
- the name of the
project.
Properties
- a list of the project
properties. See also p$getProperties()
.
ReleaseDir
- the directory where released files
will be located.
SourceDir
- the directory
containing the source files.
Versions
- a
list of the project versions.
file.info
-
the file info from the last time the PROJECT.xml file was
read.
Methods:
build
Builds the project.
version
- (optional) the version to build.
saveEnv
- if TRUE, the build environment (.rda)
will be saved in the build directory. builder
-
the builder function. See also builder.rnw
,
builder.cacheSweave
,
builder.tex
clean
- if TRUE a clean
build will be performed.
rebuild
Rebuilds
the project without first copying the files.
version
- (optional) the version to rebuild.
saveEnv
- if TRUE, the build environment (.rda)
will be saved in the build directory. builder
-
the builder function.See also builder.rnw
,
builder.cacheSweave
,
builder.tex
save
Saves the
PROJECT.xml file.
newVersion
Creates a new
versions of the project. name
- (optional) the
version name. properties
- version specific
properties.
release
Releases a version
(i.e. copies the built file to the releases directory)
version
- (optional) the version to release. If
omitted the latest version will be released.
getProperties
Returns the project properties.
addProperty
Adds a project property.
name
- The property name. value
- The
property value.
removeProperty
Removes the
given project property. name
- The property name.
getReleases
Returns a list of released
files.
openRelease
Opens the given released
file with the system's default application. file
- The released file to open.
debug
Sets
working directory and assigns properties for the latest
version so R code can be run in interactive mode.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
myProject = Project(name="RBloggers", projectDir=projectDir, properties=list(email=email, passwd=passwd))
myProject$save()
## Create the first version. This will be for summarizing December 2011 posts.
myProject$newVersion(name='2011-12', properties=list(startDate='2011-12-01', endDate='2011-12-31'))
## Add Project property
myProject$addProperty("author", "Jason Bryer")
## Build the initial version.
myProject$build()
myProject$rebuild(builder=builder.tex, sourceFile='rbloggers.tex')
myProject$Builds ## See that the build completed successfully
## Release the latest version
myProject$release(version='2011-12')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.