Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
Use relative paths and sort (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored Jan 21, 2025
1 parent 9c9bb8b commit 842fe91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pkgload (development version)

* The generator of `compile_commands.json` now works with sources in subdirectories (#308, @krlmlr).

* The generator of `compile_commands.json` now checks for existing `R_SHARE_DIR`
and `R_INCLUDE_DIR` environment variables (#287, #296, @TimTaylor and
@shikokuchuo).
Expand All @@ -8,7 +10,8 @@
of extra whitespace in `make`'s output (#288, @TimTaylor).

* The generator of `compile_commands.json` now uses escaped double quotes for LinkingTo packages to ensure valid argument strings when parsed on Windows (#305, @tylermorganwall).



# pkgload 1.4.0

* The `reset` argment of `load_all()` is no longer supported because preserving
Expand Down
6 changes: 3 additions & 3 deletions R/compilation-db.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ generate_db <- function(path = ".") {
return(invisible(NULL))
}

files <- build_files(src_path)
commands <- build_commands(src_path, package, files, desc)
files <- sort(fs::path_rel(build_files(src_path), src_path))
commands <- sort(build_commands(src_path, package, files, desc))
directives <- Map(
cmd = commands,
file = files,
Expand Down Expand Up @@ -116,7 +116,7 @@ find_source <- function(file) {
))
}

candidates[[1]]
fs::path(dir, candidates[[1]])
}

build_commands <- function(src_path, package, files, desc) {
Expand Down

0 comments on commit 842fe91

Please sign in to comment.