diff --git a/R/create.r b/R/create.r index 3376270ca..579ba1bcc 100644 --- a/R/create.r +++ b/R/create.r @@ -1,37 +1,8 @@ -#' Creates a new package, following all devtools package conventions. -#' -#' Similar to \code{\link{package.skeleton}}, except that it only creates -#' the standard devtools directory structures; it doesn't try and create -#' source code and data files by inspecting the global environment. -#' -#' \code{create} requires that the directory doesn't exist yet; it will be -#' created but deleted upon failure. \code{setup} assumes an existing -#' directory from which it will infer the package name. -#' -#' @param path location to create new package. The last component of the path -#' will be used as the package name. -#' @param description list of description values to override default values or -#' add additional values. -#' @param check if \code{TRUE}, will automatically run \code{\link{check}} -#' @param rstudio Create an RStudio project file? -#' (with \code{\link{use_rstudio}}) -#' @param quiet if \code{FALSE}, the default, prints informative messages. -#' @seealso Text with \code{\link{package.skeleton}} +#' @rdname devtools-deprecated #' @export -#' @examples -#' \dontrun{ -#' # Create a package using all defaults: -#' path <- file.path(tempdir(), "myDefaultPackage") -#' create(path) -#' -#' # Override a description attribute. -#' path <- file.path(tempdir(), "myCustomPackage") -#' my_description <- list("Maintainer" = -#' "'Yoni Ben-Meshulam' ") -#' create(path, my_description) -#' } create <- function(path, description = getOption("devtools.desc"), check = FALSE, rstudio = TRUE, quiet = FALSE) { + .Deprecated("usethis::create_package()", package = "devtools") check_package_name(path) # ensure the parent directory exists @@ -65,10 +36,11 @@ create <- function(path, description = getOption("devtools.desc"), invisible(TRUE) } -#' @rdname create +#' @rdname devtools-deprecated #' @export setup <- function(path = ".", description = getOption("devtools.desc"), check = FALSE, rstudio = TRUE, quiet = FALSE) { + .Deprecated("usethis::create_package()", package = "devtools") check_package_name(path) parent_dir <- normalizePath(dirname(path), winslash = "/", mustWork = TRUE) @@ -86,20 +58,11 @@ setup <- function(path = ".", description = getOption("devtools.desc"), invisible(TRUE) } -#' Create a default DESCRIPTION file for a package. -#' -#' @details -#' To set the default author and licenses, set \code{options} -#' \code{devtools.desc.author} and \code{devtools.desc.license}. I use -#' \code{options(devtools.desc.author = '"Hadley Wickham [aut,cre]"', -#' devtools.desc.license = "GPL-3")}. -#' @param path path to package root directory -#' @param extra a named list of extra options to add to \file{DESCRIPTION}. -#' Arguments that take a list -#' @param quiet if \code{TRUE}, suppresses output from this function. +#' @rdname devtools-deprecated #' @export create_description <- function(path = ".", extra = getOption("devtools.desc"), quiet = FALSE) { + .Deprecated("usethis::use_description()", package = "devtools") # Don't call check_dir(path) here (#803) desc_path <- file.path(path, "DESCRIPTION") diff --git a/man/create.Rd b/man/create.Rd deleted file mode 100644 index 80bfb1f18..000000000 --- a/man/create.Rd +++ /dev/null @@ -1,53 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create.r -\name{create} -\alias{create} -\alias{setup} -\title{Creates a new package, following all devtools package conventions.} -\usage{ -create(path, description = getOption("devtools.desc"), check = FALSE, - rstudio = TRUE, quiet = FALSE) - -setup(path = ".", description = getOption("devtools.desc"), check = FALSE, - rstudio = TRUE, quiet = FALSE) -} -\arguments{ -\item{path}{location to create new package. The last component of the path -will be used as the package name.} - -\item{description}{list of description values to override default values or -add additional values.} - -\item{check}{if \code{TRUE}, will automatically run \code{\link{check}}} - -\item{rstudio}{Create an RStudio project file? -(with \code{\link{use_rstudio}})} - -\item{quiet}{if \code{FALSE}, the default, prints informative messages.} -} -\description{ -Similar to \code{\link{package.skeleton}}, except that it only creates -the standard devtools directory structures; it doesn't try and create -source code and data files by inspecting the global environment. -} -\details{ -\code{create} requires that the directory doesn't exist yet; it will be -created but deleted upon failure. \code{setup} assumes an existing -directory from which it will infer the package name. -} -\examples{ -\dontrun{ -# Create a package using all defaults: -path <- file.path(tempdir(), "myDefaultPackage") -create(path) - -# Override a description attribute. -path <- file.path(tempdir(), "myCustomPackage") -my_description <- list("Maintainer" = - "'Yoni Ben-Meshulam' ") -create(path, my_description) -} -} -\seealso{ -Text with \code{\link{package.skeleton}} -} diff --git a/man/create_description.Rd b/man/create_description.Rd deleted file mode 100644 index d5305c021..000000000 --- a/man/create_description.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create.r -\name{create_description} -\alias{create_description} -\title{Create a default DESCRIPTION file for a package.} -\usage{ -create_description(path = ".", extra = getOption("devtools.desc"), - quiet = FALSE) -} -\arguments{ -\item{path}{path to package root directory} - -\item{extra}{a named list of extra options to add to \file{DESCRIPTION}. -Arguments that take a list} - -\item{quiet}{if \code{TRUE}, suppresses output from this function.} -} -\description{ -Create a default DESCRIPTION file for a package. -} -\details{ -To set the default author and licenses, set \code{options} -\code{devtools.desc.author} and \code{devtools.desc.license}. I use -\code{options(devtools.desc.author = '"Hadley Wickham [aut,cre]"', - devtools.desc.license = "GPL-3")}. -} diff --git a/man/devtools-deprecated.Rd b/man/devtools-deprecated.Rd index 91632ca94..2b33b12a9 100644 --- a/man/devtools-deprecated.Rd +++ b/man/devtools-deprecated.Rd @@ -1,9 +1,12 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/check-cran.r, R/infrastructure-git.R, -% R/infrastructure.R, R/revdep-email.R, R/revdep-summarise.R, R/revdep.R, -% R/zzz.r +% Please edit documentation in R/check-cran.r, R/create.r, +% R/infrastructure-git.R, R/infrastructure.R, R/revdep-email.R, +% R/revdep-summarise.R, R/revdep.R, R/zzz.r \name{check_cran} \alias{check_cran} +\alias{create} +\alias{setup} +\alias{create_description} \alias{use_git} \alias{use_github} \alias{use_git_hook} @@ -47,6 +50,15 @@ check_cran(pkgs, libpath = file.path(tempdir(), "R-lib"), srcpath = libpath, install_dir = tempfile("check_cran_install"), env_vars = NULL, quiet_check = TRUE) +create(path, description = getOption("devtools.desc"), check = FALSE, + rstudio = TRUE, quiet = FALSE) + +setup(path = ".", description = getOption("devtools.desc"), check = FALSE, + rstudio = TRUE, quiet = FALSE) + +create_description(path = ".", extra = getOption("devtools.desc"), + quiet = FALSE) + use_git(message = "Initial commit", pkg = ".") use_github(auth_token = github_pat(), private = FALSE, pkg = ".",