Skip to content

Use targets with git submodules #1234

Closed Answered by hlageek
j-kreis asked this question in Help
Feb 18, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

I have a setting where I use the main project for orchestrating subprojects. If I would try to transpose my setting onto your problem, it would look something like this for the parent directory pipeline:

list(
 tar_target(
    name = submoduleA_path,
    command = here::here("submodules", "project A"),
    format = "file"
   ),
 tar_target(
    name = compiled_submoduleA,
    command = run_submodule(
        dir = submoduleA_path
       )
    )
)

where

run_submodule  <- function(dir){
     withr::with_dir(dir, targets::tar_make())
      return(Sys.time())
}

and downstream targets can be made dependent on compiled_submoduleA. @wlandau already suggested above how targets in submodules can…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@j-kreis
Comment options

@wlandau
Comment options

Comment options

You must be logged in to vote
1 reply
@j-kreis
Comment options

Answer selected by j-kreis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants