Skip to content
Open
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rextendr (development version)

* `use_extendr()` now generates `cleanup` and `cleanup.win`.

# rextendr 0.4.2

* Sets the `extendr-api` version to the latest stable version instead of `"*"` when creating a new package. This is fetched from <https://crates.io/api/v1/crates/extendr-api> and will fall back to `"*"` if not available <https://github.com/extendr/rextendr/pull/467>
Expand Down
14 changes: 14 additions & 0 deletions R/use_extendr.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ use_extendr <- function(
data = list(lib_name = lib_name)
)

use_rextendr_template(
"cleanup",
save_as = file.path("src", "cleanup"),
quiet = quiet,
overwrite = overwrite
)

use_rextendr_template(
"cleanup.win",
save_as = file.path("src", "cleanup.win"),
quiet = quiet,
overwrite = overwrite
)

use_rextendr_template(
"_gitignore",
save_as = file.path("src", ".gitignore"),
Expand Down
1 change: 1 addition & 0 deletions inst/templates/cleanup
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rm -f src/Makevars
1 change: 1 addition & 0 deletions inst/templates/cleanup.win
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rm -f src/Makevars.win
4 changes: 4 additions & 0 deletions tests/testthat/_snaps/use_extendr.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@
> File 'src/entrypoint.c' already exists. Skip writing the file.
> File 'src/Makevars.in' already exists. Skip writing the file.
> File 'src/Makevars.win.in' already exists. Skip writing the file.
> File 'src/cleanup' already exists. Skip writing the file.
> File 'src/cleanup.win' already exists. Skip writing the file.
> File 'src/.gitignore' already exists. Skip writing the file.
> File 'src/rust/Cargo.toml' already exists. Skip writing the file.
> File 'src/rust/src/lib.rs' already exists. Skip writing the file.
Expand All @@ -380,6 +382,8 @@
v Writing 'src/entrypoint.c'
v Writing 'src/Makevars.in'
v Writing 'src/Makevars.win.in'
v Writing 'src/cleanup'
v Writing 'src/cleanup.win'
v Writing 'src/.gitignore'
v Writing 'src/rust/Cargo.toml'
v Writing 'src/rust/src/lib.rs'
Expand Down
Loading