Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs - dependency parameters #2224

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions website/docs/guides/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ If you want to compile it with the `pprint` library but exclude its `sourcecode`
the `exclude` parameter as follows:

```scala title=Main.scala
//> using dep com.lihaoyi::pprint:0.8.1,exclude=com.lihaoyi%%sourcecode
//> using dep "com.lihaoyi::pprint:0.8.1,exclude=com.lihaoyi%%sourcecode"
object Main extends App {
println("Hello")
}
Expand All @@ -98,7 +98,7 @@ object Main extends App {
To exclude Scala modules, you can also use a single `%` but with the full name of the module name, like this:

```scala title=Main.scala
//> using dep com.lihaoyi::pprint:0.8.1,exclude=com.lihaoyi%sourcecode_3
//> using dep "com.lihaoyi::pprint:0.8.1,exclude=com.lihaoyi%sourcecode_3"
object Main extends App {
println("Hello")
}
Expand All @@ -114,12 +114,17 @@ If you want to use the `pytorch` dependency with the classifier `linux-x86_64`,
follows:

```scala title=Main.scala
//> using dep org.bytedeco:pytorch:1.12.1-1.5.8,classifier=linux-x86_64
//> using dep "org.bytedeco:pytorch:1.12.1-1.5.8,classifier=linux-x86_64"
object Main extends App {
println("Hello")
}
```

:::caution
When using the `classifier`, `exclude` or others parameters, it is necessary to wrap the value of dependency within double quotes `"`.
If this is omitted, Scala CLI treats these parameters as dependencies, resulting in a dependency parsing error.
:::

### Test dependencies

It is possible to declare dependencies limited to the test scope with the `using test.dep` directive.
Expand Down