|
4 | 4 |
|
5 | 5 | Next-generation package manager for Julia. Still quite alpha. The last commit that works on 0.6 is [4bd137919](https://github.com/JuliaLang/Pkg.jl/commit/4bd1379195ce10056c26fb689f732907dd4f09fa).
|
6 | 6 |
|
7 |
| -To install, `Pkg.clone` the `Pkg` repo itself: |
| 7 | +Pkg is available from the Julia nightly build or by building the Julia master branch. |
8 | 8 |
|
9 |
| -```jl |
10 |
| -Pkg.clone("https://github.com/JuliaLang/Pkg.jl.git") |
11 |
| -``` |
12 | 9 |
|
13 |
| -Packages are installed under `joinpath(homedir(), ".julia", "packages")`, so they won't influence the packages that you already have installed. |
| 10 | +#### Using the development version of Pkg.jl |
14 | 11 |
|
15 |
| -```jl |
16 |
| -$ julia |
17 |
| - |
18 |
| -julia> using Pkg |
19 |
| -``` |
20 |
| - |
21 |
| -This gives you a `pkg> ` REPL mode, activated by the `]` key. Currently, this supports thee operations: `add`, `rm` and `up`: |
22 |
| - |
23 |
| -```jl |
24 |
| -pkg> add JSON |
25 |
| -INFO: Resolving package versions |
26 |
| -INFO: Cloning [682c06a0-de6a-54ab-a142-c8b1cf79cde6] JSON |
27 |
| -INFO: Installing JSON v0.13.0 [9003b4622ec7e553] |
28 |
| -INFO: Updating project file /Users/stefan/projects/julia/Project.toml |
29 |
| -INFO: [+] JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" |
30 |
| -INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml |
31 |
| -INFO: [34da2185] + Compat v0.31.0 |
32 |
| -INFO: [682c06a0] + JSON v0.13.0 |
33 |
| - |
34 |
| -pkg> add Compat @0.28 |
35 |
| -INFO: Resolving package versions |
36 |
| -INFO: Installing Compat v0.28.0 [0427af7e2c8610c8] |
37 |
| -INFO: Updating project file /Users/stefan/projects/julia/Project.toml |
38 |
| -INFO: [+] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" |
39 |
| -INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml |
40 |
| -INFO: [34da2185] ↓ Compat v0.31.0 ⇒ v0.28.0 |
41 |
| - |
42 |
| -pkg> rm Compat |
43 |
| -INFO: Updating project file /Users/stefan/projects/julia/Project.toml |
44 |
| -INFO: [-] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" |
45 |
| -INFO: [-] JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" |
46 |
| -INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml |
47 |
| -INFO: [34da2185] - Compat v0.28.0 |
48 |
| -INFO: [682c06a0] - JSON v0.13.0 |
49 |
| - |
50 |
| -pkg> add JSON @0.10 |
51 |
| -INFO: Resolving package versions |
52 |
| -INFO: Installing JSON v0.10.0 [77699b5cc09b169c] |
53 |
| -INFO: Updating project file /Users/stefan/projects/julia/Project.toml |
54 |
| -INFO: [+] JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" |
55 |
| -INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml |
56 |
| -INFO: [34da2185] + Compat v0.31.0 |
57 |
| -INFO: [682c06a0] + JSON v0.10.0 |
58 |
| - |
59 |
| -pkg> up |
60 |
| -INFO: Resolving package versions |
61 |
| -INFO: Updating project file /Users/stefan/projects/julia/Project.toml |
62 |
| -INFO: [no changes] |
63 |
| -INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml |
64 |
| -INFO: [682c06a0] ↑ JSON v0.10.0 ⇒ v0.13.0 |
65 |
| -``` |
66 |
| - |
67 |
| -Package operations create a `Project.toml` file that record what dependencies your project (or named global environment) has – i.e. what you've explicitly added. It also creates a `Manifest.toml` file that records the exact versions of each of those dependenices and their transitive dependencies – and the graph between them. You can load top-level dependencies via the usual `using JSON` or `import JSON` constructs in the REPL or in Julia scripts. |
| 12 | +If you want to develop this package do the following steps: |
| 13 | +- Clone the repo anywhere. |
| 14 | +- Remove the `uuid = ` line from the `Project.toml` file. |
| 15 | +- Change the current directory to the Pkg repo you just cloned. |
| 16 | +- `import Pkg` will now load the files in the cloned repo instead of the Pkg stdlib . |
| 17 | +- To test your changes, simple `include("test/runtests.jl")`. |
0 commit comments