1

I learned of a way to run julia, so I can use the file structure of a package for my project. Namely julia --project inside my developement directory. With this I can load all projects structured like projectName/src/projectName.jl inside the same folder.

An Example:

all my julia projects/
├─ project 1/
│  ├─ working with files in julia.jl
│  ├─ data.csv
├─ project 2/
│  ├─ project.toml
│  ├─ src/
│  │  ├─ project 2.jl
├─ project 3/
│  ├─ draft.uxf
│  ├─ .gitignore
│  ├─ project.toml
│  ├─ auto_compile.jl
│  ├─ src/
│  │  ├─ project 3.jl

With this file structure I want to call auto_compile.jl that does the following:

using Pkg

cd("..")
Pkg.activate(".")
Pkg.instatiate()

Pkg.add("PackageCompiler")
using PackageCompiler

create_app("Project 3", "Project 3 Compiled")

However, PackageCompiler.jl only works with the --project command. The --project argument doesnt seem to modify LOAD_PATH, what does it do exactly? Can I edit my julia session with --project later on? I figured julia does the same when loading packages from the ~user/.julia/packages/ dir, but how do I do that, and are there more usefull arguments I should know about?

Baumwolle 25
  • 113
  • 5
  • Also as a sidenote, a `julia-repl` tag would be useful. maybe someone with a high enough rep wants to do that. – Baumwolle 25 May 09 '22 at 13:25
  • Not sure of this question, but do not confuse the _working directory_ with the _environment_ directory. The first one you can set it with `cd(DIR)`, for example `cd(@__DIR__`) to set it to the current file path, the latter with the `Pkg.acivate(DIR)` call.. – Antonello May 09 '22 at 16:37

1 Answers1

0

after some quick "testing" I can confirm:

the --project/--project=. flags when starting julia from the terminal do the same as Pkg.activate(".")

Baumwolle 25
  • 113
  • 5