[Rcpp-commits] r378 - in pkg: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 15 15:28:48 CET 2010
Author: romain
Date: 2010-01-15 15:28:48 +0100 (Fri, 15 Jan 2010)
New Revision: 378
Added:
pkg/R/Rcpp.package.skeleton.R
pkg/man/Rcpp.package.skeleton.Rd
Removed:
pkg/R/cpp.package.skeleton.R
pkg/man/cpp.package.skeleton.Rd
Modified:
pkg/NAMESPACE
Log:
s/cpp.package.skeleton/Rcpp.package.skeleton/g
Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE 2010-01-15 14:20:08 UTC (rev 377)
+++ pkg/NAMESPACE 2010-01-15 14:28:48 UTC (rev 378)
@@ -5,5 +5,5 @@
RcppDateExample,
RcppParamsExample,
RcppVectorExample,
- cpp.package.skeleton
+ Rcpp.package.skeleton
)
Copied: pkg/R/Rcpp.package.skeleton.R (from rev 372, pkg/R/cpp.package.skeleton.R)
===================================================================
--- pkg/R/Rcpp.package.skeleton.R (rev 0)
+++ pkg/R/Rcpp.package.skeleton.R 2010-01-15 14:28:48 UTC (rev 378)
@@ -0,0 +1,74 @@
+# Copyright (C) 2009 - 2010 Dirk Eddelbuettel and Romain Francois
+#
+# This file is part of Rcpp.
+#
+# Rcpp is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# Rcpp is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+
+Rcpp.package.skeleton <- function(
+ name = "anRpackage", list = character(), environment = .GlobalEnv,
+ path = ".", force = FALSE, namespace = TRUE, code_files = character() ){
+
+ # first let the traditional version do its business
+ call <- match.call()
+ call[[1]] <- as.name("package.skeleton")
+ call[["namespace"]] <- namespace
+ print( call )
+ env <- parent.frame(1)
+
+ tryCatch( eval( call, envir = env ), error = function(e){
+ stop( "error while calling `package.skeleton`" )
+ } )
+
+ message( "\nAdding Rcpp settings" )
+
+ # now pick things up
+ root <- file.path( path, name )
+
+ # Add Rcpp to the DESCRIPTION
+ DESCRIPTION <- file.path( root, "DESCRIPTION" )
+ if( file.exists( DESCRIPTION ) ){
+ x <- cbind( read.dcf( DESCRIPTION ),
+ "Depends" = sprintf( "Rcpp (>= %s)", packageDescription("Rcpp")[["Version"]] ) )
+ write.dcf( x, file = DESCRIPTION )
+ message( " >> added Rcpp to Depends" )
+ }
+
+ # if there is a NAMESPACE, add a useDynLib
+ NAMESPACE <- file.path( root, "NAMESPACE")
+ if( file.exists( NAMESPACE ) ){
+ lines <- readLines( NAMESPACE )
+ if( ! grepl( "useDynLib", lines ) ){
+ lines <- c( sprintf( "useDynLib(%s)", name), lines)
+ writeLines( lines, con = NAMESPACE )
+ message( " >> added useDynLib directive to NAMESPACE" )
+ }
+ }
+
+ # lay things out in the src directory
+ src <- file.path( root, "src")
+ if( !file.exists( src )){
+ dir.create( src )
+ }
+ Makevars <- file.path( src, "Makevars" )
+ if( !file.exists( Makevars ) ){
+ writeLines( c(
+ "PKG_CXXFLAGS=`Rscript -e \"Rcpp:::CxxFlags()\" `" ,
+ "PKG_LIBS = `Rscript -e \"Rcpp:::LdFlasgs()\" `" ),
+ , con = Makevars )
+ message( " >> added Makevars file with Rcpp settings" )
+ }
+
+ invisible( NULL )
+}
+
Deleted: pkg/R/cpp.package.skeleton.R
===================================================================
--- pkg/R/cpp.package.skeleton.R 2010-01-15 14:20:08 UTC (rev 377)
+++ pkg/R/cpp.package.skeleton.R 2010-01-15 14:28:48 UTC (rev 378)
@@ -1,74 +0,0 @@
-# Copyright (C) 2009 - 2010 Dirk Eddelbuettel and Romain Francois
-#
-# This file is part of Rcpp.
-#
-# Rcpp is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# Rcpp is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
-
-cpp.package.skeleton <- function(
- name = "anRpackage", list = character(), environment = .GlobalEnv,
- path = ".", force = FALSE, namespace = TRUE, code_files = character() ){
-
- # first let the traditional version do its business
- call <- match.call()
- call[[1]] <- as.name("package.skeleton")
- call[["namespace"]] <- namespace
- print( call )
- env <- parent.frame(1)
-
- tryCatch( eval( call, envir = env ), error = function(e){
- stop( "error while calling `package.skeleton`" )
- } )
-
- message( "\nAdding Rcpp settings" )
-
- # now pick things up
- root <- file.path( path, name )
-
- # Add Rcpp to the DESCRIPTION
- DESCRIPTION <- file.path( root, "DESCRIPTION" )
- if( file.exists( DESCRIPTION ) ){
- x <- cbind( read.dcf( DESCRIPTION ),
- "Depends" = sprintf( "Rcpp (>= %s)", packageDescription("Rcpp")[["Version"]] ) )
- write.dcf( x, file = DESCRIPTION )
- message( " >> added Rcpp to Depends" )
- }
-
- # if there is a NAMESPACE, add a useDynLib
- NAMESPACE <- file.path( root, "NAMESPACE")
- if( file.exists( NAMESPACE ) ){
- lines <- readLines( NAMESPACE )
- if( ! grepl( "useDynLib", lines ) ){
- lines <- c( sprintf( "useDynLib(%s)", name), lines)
- writeLines( lines, con = NAMESPACE )
- message( " >> added useDynLib directive to NAMESPACE" )
- }
- }
-
- # lay things out in the src directory
- src <- file.path( root, "src")
- if( !file.exists( src )){
- dir.create( src )
- }
- Makevars <- file.path( src, "Makevars" )
- if( !file.exists( Makevars ) ){
- writeLines( c(
- "PKG_CXXFLAGS=`Rscript -e \"Rcpp:::CxxFlags()\" `" ,
- "PKG_LIBS = `Rscript -e \"Rcpp:::LdFlasgs()\" `" ),
- , con = Makevars )
- message( " >> added Makevars file with Rcpp settings" )
- }
-
- invisible( NULL )
-}
-
Copied: pkg/man/Rcpp.package.skeleton.Rd (from rev 372, pkg/man/cpp.package.skeleton.Rd)
===================================================================
--- pkg/man/Rcpp.package.skeleton.Rd (rev 0)
+++ pkg/man/Rcpp.package.skeleton.Rd 2010-01-15 14:28:48 UTC (rev 378)
@@ -0,0 +1,53 @@
+\name{Rcpp.package.skeleton}
+\alias{Rcpp.package.skeleton}
+\title{
+Create a skeleton for a new package depending on Rcpp
+}
+\description{
+ \code{Rcpp.package.skeleton} automates the creation of
+ a new source package that intends to use features of Rcpp.
+
+ It is based on the \link[utils]{package.skeleton} function
+ which it executes first.
+}
+\usage{
+Rcpp.package.skeleton(name = "anRpackage", list = character(),
+ environment = .GlobalEnv, path = ".", force = FALSE,
+ namespace = TRUE, code_files = character())
+}
+\arguments{
+ \item{name}{See \link[utils]{package.skeleton}}
+ \item{list}{See \link[utils]{package.skeleton}}
+ \item{environment}{See \link[utils]{package.skeleton}}
+ \item{path}{See \link[utils]{package.skeleton}}
+ \item{force}{See \link[utils]{package.skeleton}}
+ \item{namespace}{See \link[utils]{package.skeleton}}
+ \item{code_files}{See \link[utils]{package.skeleton}}
+}
+\details{
+ In addition to \link[utils]{package.skeleton} :
+
+ The \samp{DESCRIPTION} file gains a Depends line requesting that
+ the package depends on Rcpp
+
+ The \samp{NAMESPACE}, if any, gains a \code{useDynLib} directove
+
+ The \samp{src} directory is created if it does not exists and
+ a \samp{Makevars} file is added setting the environment variables
+ \samp{PKG_CXXFLAGS} and \samp{PKG_LIBS}
+
+}
+\value{
+Nothing, used for its side effects
+}
+\seealso{
+\link[utils]{package.skeleton}
+}
+\examples{
+\dontrun{
+f <- function(){}
+Rcpp.package.skeleton( "foobar", "f" )
+}
+}
+\keyword{ programming }
+
Deleted: pkg/man/cpp.package.skeleton.Rd
===================================================================
--- pkg/man/cpp.package.skeleton.Rd 2010-01-15 14:20:08 UTC (rev 377)
+++ pkg/man/cpp.package.skeleton.Rd 2010-01-15 14:28:48 UTC (rev 378)
@@ -1,53 +0,0 @@
-\name{cpp.package.skeleton}
-\alias{cpp.package.skeleton}
-\title{
-Create a skeleton for a new package depending on Rcpp
-}
-\description{
- \code{cpp.package.skeleton} automates the creation of
- a new source package that intends to use features of Rcpp.
-
- It is based on the \link[utils]{package.skeleton} function
- which it executes first.
-}
-\usage{
-cpp.package.skeleton(name = "anRpackage", list = character(),
- environment = .GlobalEnv, path = ".", force = FALSE,
- namespace = TRUE, code_files = character())
-}
-\arguments{
- \item{name}{See \link[utils]{package.skeleton}}
- \item{list}{See \link[utils]{package.skeleton}}
- \item{environment}{See \link[utils]{package.skeleton}}
- \item{path}{See \link[utils]{package.skeleton}}
- \item{force}{See \link[utils]{package.skeleton}}
- \item{namespace}{See \link[utils]{package.skeleton}}
- \item{code_files}{See \link[utils]{package.skeleton}}
-}
-\details{
- In addition to \link[utils]{package.skeleton} :
-
- The \samp{DESCRIPTION} file gains a Depends line requesting that
- the package depends on Rcpp
-
- The \samp{NAMESPACE}, if any, gains a \code{useDynLib} directove
-
- The \samp{src} directory is created if it does not exists and
- a \samp{Makevars} file is added setting the environment variables
- \samp{PKG_CXXFLAGS} and \samp{PKG_LIBS}
-
-}
-\value{
-Nothing, used for its side effects
-}
-\seealso{
-\link[utils]{package.skeleton}
-}
-\examples{
-\dontrun{
-f <- function(){}
-cpp.package.skeleton( "foobar", "f" )
-}
-}
-\keyword{ programming }
-
More information about the Rcpp-commits
mailing list