Skip to content

Commit 2e1ab04

Browse files
authored
Merge pull request #1178 from lwronski/dependency-update-docs
Add docs depedency-update
2 parents 5d0da51 + ec734ec commit 2e1ab04

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

website/docs/guides/dependencies.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,39 @@ Lastly, you can also add simple JAR files as dependencies with `--jar`:
3232
```bash
3333
scala-cli compile Hello.scala --jar /path/to/library.jar
3434
```
35+
36+
## Update dependencies
37+
38+
To check if dependencies in using directives are up to date use `dependency-update` command:
39+
40+
```scala title=Hello.scala
41+
//> using lib "com.lihaoyi::os-lib:0.7.8"
42+
//> using lib "com.lihaoyi::utest:0.7.10"
43+
import $ivy.`com.lihaoyi::geny:0.6.5`
44+
import $dep.`com.lihaoyi::pprint:0.6.6`
45+
46+
object Hello extends App {
47+
println("Hello World")
48+
}
49+
```
50+
51+
```bash
52+
scala-cli dependency-update Hello.scala
53+
# Updates
54+
# * com.lihaoyi::os-lib:0.7.8 -> 0.8.1
55+
# * com.lihaoyi::utest:0.7.10 -> 0.8.0
56+
# * com.lihaoyi::geny:0.6.5 -> 0.7.1
57+
# * com.lihaoyi::pprint:0.6.6 -> 0.7.3
58+
# To update all dependencies run:
59+
# scala-cli dependency-update --all
60+
```
61+
62+
Passing `--all` to the `dependency-update` sub-command updates all dependencies in your sources.
63+
64+
```bash
65+
scala-cli dependency-update Hello.scala --all
66+
# Updated dependency to: com.lihaoyi::os-lib:0.8.1
67+
# Updated dependency to: com.lihaoyi::utest:0.8.0
68+
# Updated dependency to: com.lihaoyi::geny:0.7.1
69+
# Updated dependency to: com.lihaoyi::pprint:0.7.3
70+
```

0 commit comments

Comments
 (0)