Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions that require 2 or more packages? #7

Closed
longemen3000 opened this issue Jul 3, 2023 · 1 comment
Closed

Extensions that require 2 or more packages? #7

longemen3000 opened this issue Jul 3, 2023 · 1 comment

Comments

@longemen3000
Copy link

longemen3000 commented Jul 3, 2023

Hi, i'm looking on if this package supports the current situation:

  • in MainPackage.jl
module MainPackage
if !isdefined(Base,:get_extension)
using Requires
function __init__()
  @require Pkg1 = "id1" begin
    @require Pkg2 = "id2 begin
      include("../ext/MyExtension.jl")
    end
  end
end
end
end #module
  • in ext/MyExtension.jl
module MyExtension
if isdefined(Base,:get_extension)
  using MainPackage, Pkg1, Pkg2
else
  using ..MainPackage, ..Pkg1, ..Pkg2
end
#code 
end #module
@cjdoris
Copy link
Owner

cjdoris commented Jul 4, 2023

Try it and see 😉

(The answer is yes.)

@cjdoris cjdoris closed this as completed Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants