The resolver has installed each package with the highest possible version, while still respecting the compatibility that each package enforces on its dependencies. We simply add these packages (note how the prompt now shows the name of the newly generated project, since we activated it): (HelloWorld) pkg> add Random JSONīoth Random and JSON got added to the project’s Project.toml file, and the resulting dependencies got added to the Manifest.toml file. Let’s say we want to use the standard library package Random and the registered package JSON in our project. HelloWorldįor the rest of the tutorial we enter inside the directory of the project, for convenience: julia> cd("HelloWorld") Adding dependencies to the project We can now activate the project by using the path to the directory where it is installed, and load the package: pkg> activate. The content of src/HelloWorld.jl is: module HelloWorld The Project.toml file contains the name of the package, its unique UUID, its version, the authors and potential dependencies: name = "HelloWorld" This creates a new project HelloWorld in a subdirectory by the same name, with the following files (visualized with the external tree command): shell> tree HelloWorld/ To generate the bare minimum files for a new package, use pkg> generate. We recommend that you use PkgTemplates for creating new packages instead of using the minimal pkg> generate functionality described below. It can also generate files needed for Documentation, CI, etc. The PkgTemplates package offers an easy, repeatable, and customizable way to generate the files for a new package.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |