|
| 1 | +# Dependencies |
| 2 | + |
| 3 | +Sometimes you may wish to use a project that isn't resolvable through an |
| 4 | +available index or you want to override the dependency resolution for other |
| 5 | +reasons. In any case you can do this by adding the appropriate IRI and `Source` |
| 6 | +to a `project` entry in the `sysand.toml` configuration file at the root of |
| 7 | +your project. This follows the same structure as found in the lockfile, where |
| 8 | +`identifiers` are given as a list of IRI:s and `sources` are a list of sources. |
| 9 | +A project may have multiple identifiers in case it is referred to differently |
| 10 | +by different projects, and multiple sources where the additional ones after the |
| 11 | +first serve as backups in case the previous ones fail to resolve. Note that |
| 12 | +these should be sources of the exact same project as determined by it's |
| 13 | +checksum, as otherwise you are likely to run into problems when syncing against |
| 14 | +a lockfile. |
| 15 | + |
| 16 | +Below we describe we describe how add overriding sources directly to the |
| 17 | +configuration file, but it is also possible to do through the command line |
| 18 | +interface with the [`sysand add`](../commands/add.md) command. |
| 19 | + |
| 20 | +## Local projects |
| 21 | + |
| 22 | +To specify the source of a project that you have locally in a directory |
| 23 | +`./path/to/project` by the identifier `urn:kpar:my-project`, is done by adding |
| 24 | +the following entry to your `sysand.toml`. |
| 25 | + |
| 26 | +```toml |
| 27 | +[[project]] |
| 28 | +identifiers = [ |
| 29 | + "urn:kpar:my-project", |
| 30 | +] |
| 31 | +sources = [ |
| 32 | + { src_path = "path/to/project" }, |
| 33 | +] |
| 34 | +``` |
| 35 | + |
| 36 | +Note that the path to the project is given by path that is relative to the root |
| 37 | +of your project. |
| 38 | + |
| 39 | +## Local KPARs |
| 40 | + |
| 41 | +If you have a project locally available as a compressed KPAR this can be identified |
| 42 | +by `urn:kpar:my-kpar-project` by adding |
| 43 | + |
| 44 | +```toml |
| 45 | +[[project]] |
| 46 | +identifiers = [ |
| 47 | + "urn:kpar:my-kpar-project", |
| 48 | +] |
| 49 | +sources = [ |
| 50 | + { kpar_path = "path/to/project.kpar" }, |
| 51 | +] |
| 52 | +``` |
| 53 | + |
| 54 | +to your `sysand.toml`. |
| 55 | + |
| 56 | +## Remote projects and KPARs |
| 57 | + |
| 58 | +To specify a remote project as a source, add |
| 59 | + |
| 60 | +```toml |
| 61 | +[[project]] |
| 62 | +identifiers = [ |
| 63 | + "urn:kpar:remote-project", |
| 64 | +] |
| 65 | +sources = [ |
| 66 | + { remote_src = "https://www.example.com/path/to/project" }, |
| 67 | +] |
| 68 | +``` |
| 69 | + |
| 70 | +to your `sysand.toml`, or for a remote KPAR you add |
| 71 | + |
| 72 | +```toml |
| 73 | +[[project]] |
| 74 | +identifiers = [ |
| 75 | + "urn:kpar:remote-kpar-project", |
| 76 | +] |
| 77 | +sources = [ |
| 78 | + { remote_kpar = "https://www.example.com/path/to/project.kpar" }, |
| 79 | +] |
| 80 | +``` |
0 commit comments