From 3aaa5c5ff11bd9edc6ba9642c69fa958bbce04c9 Mon Sep 17 00:00:00 2001 From: TEC Date: Mon, 7 Oct 2024 23:41:49 +0800 Subject: [PATCH] Allow use of a url and subdir in [sources] Monorepos exist, so we shouldn't complain when somebody tries to combine the url and subdir parameters. --- src/API.jl | 6 ++++++ src/project.jl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/API.jl b/src/API.jl index 401ca06be1..f316019083 100644 --- a/src/API.jl +++ b/src/API.jl @@ -195,6 +195,9 @@ function update_source_if_set(project, pkg) if pkg.path !== nothing source["path"] = pkg.path end + if pkg.subdir !== nothing + source["subdir"] = pkg.subdir + end path, repo = get_path_repo(project, pkg.name) if path !== nothing pkg.path = path @@ -205,6 +208,9 @@ function update_source_if_set(project, pkg) if repo.rev !== nothing pkg.repo.rev = repo.rev end + if repo.subdir !== nothing + pkg.repo.subdir = repo.subdir + end end function develop(ctx::Context, pkgs::Vector{PackageSpec}; shared::Bool=true, diff --git a/src/project.jl b/src/project.jl index f7a7e83757..1b559898c2 100644 --- a/src/project.jl +++ b/src/project.jl @@ -92,7 +92,7 @@ read_project_compat(raw, project::Project) = read_project_sources(::Nothing, project::Project) = Dict{String,Any}() function read_project_sources(raw::Dict{String,Any}, project::Project) - valid_keys = ("path", "url", "rev") + valid_keys = ("path", "url", "rev", "subdir") sources = Dict{String,Any}() for (name, source) in raw if !(source isa AbstractDict)