Skip to content

Commit

Permalink
Merge pull request #1178 from lwronski/dependency-update-docs
Browse files Browse the repository at this point in the history
Add docs depedency-update
  • Loading branch information
romanowski authored Jul 14, 2022
2 parents 5d0da51 + ec734ec commit 2e1ab04
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions website/docs/guides/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,39 @@ Lastly, you can also add simple JAR files as dependencies with `--jar`:
```bash
scala-cli compile Hello.scala --jar /path/to/library.jar
```

## Update dependencies

To check if dependencies in using directives are up to date use `dependency-update` command:

```scala title=Hello.scala
//> using lib "com.lihaoyi::os-lib:0.7.8"
//> using lib "com.lihaoyi::utest:0.7.10"
import $ivy.`com.lihaoyi::geny:0.6.5`
import $dep.`com.lihaoyi::pprint:0.6.6`

object Hello extends App {
println("Hello World")
}
```

```bash
scala-cli dependency-update Hello.scala
# Updates
# * com.lihaoyi::os-lib:0.7.8 -> 0.8.1
# * com.lihaoyi::utest:0.7.10 -> 0.8.0
# * com.lihaoyi::geny:0.6.5 -> 0.7.1
# * com.lihaoyi::pprint:0.6.6 -> 0.7.3
# To update all dependencies run:
# scala-cli dependency-update --all
```

Passing `--all` to the `dependency-update` sub-command updates all dependencies in your sources.

```bash
scala-cli dependency-update Hello.scala --all
# Updated dependency to: com.lihaoyi::os-lib:0.8.1
# Updated dependency to: com.lihaoyi::utest:0.8.0
# Updated dependency to: com.lihaoyi::geny:0.7.1
# Updated dependency to: com.lihaoyi::pprint:0.7.3
```

0 comments on commit 2e1ab04

Please sign in to comment.