Organizing modules. Is it OK to organize a project using several modules in Julia?

Wow, my post was pretty sloppy. Sorry about that. @improbable22 is right, you have to dev, not add if you are just using a local path without a git repo. dev from the pkg repl mode is of course equivalent to Pkg.develop

Additionally, the directory structure I set up was just flat wrong. I guess that’s what happens when I rush and don’t actually test what I’m suggesting. The following directory structure works:

├── Project.toml
└── src
    ├── BoardModule
    │   └── BoardModule.jl
    ├── gameProject.jl
    ├── GameRunner
    │   └── GameRunner.jl
    └── PlayerModule
        └── PlayerModule.jl

Note that if you’re doing one parent module with submodules only the parent module needs a Project.toml.

Then gameProject.jl can contain

module gameProject

include("BoardModule/BoardModule.jl")
include("PlayerModule/PlayerModule.jl")
include("GameRunner/GameRunner.jl")

end # module

plus any other code you want in the top level. Then, say BoardModule. jl is

module BoardModule

export board_greeter

board_greeter() = “Hello World! I’m a game board”

end # module


Then GameRunner.jl could be 

module GameRunner

export game_greeter

import …BoardModule: board_greeter

game_greeter() = println(“Hi, I’m a game. My board also says hello: $(board_greeter())”)

end


This setup I actually implemented on my local machine and tested that it works.