Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-08-28 Dirk Eddelbuettel <[email protected]>

* R/Rcpp.package.skeleton.R: Create DESCRIPTION with Auhors@R fiel
* inst/tinytest/test_rcpp_package_skeleton.R: Adjust tests

2024-08-20 Dirk Eddelbuettel <[email protected]>

* inst/tinytest/test_sugar.R: Skip one more NA related test on arm64
Expand Down
23 changes: 16 additions & 7 deletions R/Rcpp.package.skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,27 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
DESCRIPTION <- file.path(root, "DESCRIPTION")
if (file.exists(DESCRIPTION)) {
imports <- c(if (isTRUE(module)) "methods", sprintf("Rcpp (>= %s)", getRcppVersion()))
x <- cbind(read.dcf(DESCRIPTION),
splitname <- strsplit(author, " ")[[1]]
x <- cbind(read.dcf(DESCRIPTION, fields = c("Package", "Type", "Title", "Version", "Date",
"Description", "License")),
"Imports" = paste(imports, collapse = ", "),
"LinkingTo" = "Rcpp")
x[, "Author"] <- author
x[, "Maintainer"] <- sprintf("%s <%s>", maintainer, email)
"LinkingTo" = "Rcpp",
"Authors@R" = sprintf("person(\"%s\", \"%s\", role = c(\"aut\", \"cre\"), email = \"%s\")",
paste(splitname[-length(splitname)], collapse=" "),
splitname[length(splitname)],
email))
#x[, "Author"] <- author
#x[, "Maintainer"] <- sprintf("%s <%s>", maintainer, email)
x[, "License"] <- license
x[, "Title"] <- "What the Package Does in One 'Title Case' Line"
x[, "Description"] <- "One paragraph description of what the package does as one or more full sentences."
x[, "Title"] <- "Concise Summary of What the Package Does"
x[, "Description"] <- "More about what it does (maybe more than one line)."
message( " >> added Imports: Rcpp" )
message( " >> added LinkingTo: Rcpp" )
write.dcf(x, file = DESCRIPTION)

write.dcf(x[1, c("Package", "Type", "Title", "Version", "Date",
"Authors@R", "Description", "License", "Imports", "LinkingTo"),
drop = FALSE],
file = DESCRIPTION)
}

## add useDynLib and importFrom to NAMESPACE
Expand Down
8 changes: 4 additions & 4 deletions inst/tinytest/test_rcpp_package_skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ checkTrue( "foo" %in% list.files(path), "pkg path generated as named" )

## check the DESCRIPTION
DESCRIPTION <- as.list( read.dcf( file.path(pkg_path, "DESCRIPTION") )[1,] )
checkTrue( DESCRIPTION["Author"] == "Boo-Boo Bear",
"wrote the Author field in DESCRIPTION" )
checkTrue( DESCRIPTION["Maintainer"] == "Yogi Bear <[email protected]>",
"wrote the Maintainer field in DESCRIPTION")
checkEqual(gsub("\\n", " ", DESCRIPTION["Authors@R"]), # need to neutralise a line break
'person("Boo-Boo", "Bear", role = c("aut", "cre"), email = "[email protected]")',
"wrote the Authors@R field in DESCRIPTION" )
checkTrue( DESCRIPTION["Date"] == format(Sys.Date()), "uses current date in DESCRIPTION")
checkTrue( DESCRIPTION["License"] == "An Opensource License",
"wrote the License field in DESCRIPTION" )
checkTrue( DESCRIPTION["LinkingTo"] == "Rcpp",
Expand Down
Loading