= Scala Single-File Scripts

:language: Scala
:language-small: scala
:language-ext: scala

include::partial$Script_Header.adoc[]

Mill Scala scripts typically make use of their xref:#_bundled_libraries[Bundled Libraries]
to provide an easy-to-get-started experience writing Scala scripts.

== Script Use Cases

include::partial$example/scalalib/script/1-html-scraper.adoc[]
include::partial$example/scalalib/script/2-json-api-client.adoc[]
include::partial$example/scalalib/script/3-web-server.adoc[]
include::partial$example/scalalib/script/4-database.adoc[]
include::partial$example/scalalib/script/5-static-site.adoc[]

== Packaging Assemblies and Native Binaries

include::partial$example/scalalib/script/6-packaging.adoc[]

== Opening a Script REPL

To open a Scala REPL with your script loaded and available, you can use the following command.
This can be useful to interactively exercise and experiment with the code defined in
your script.

```scala
./mill Foo.scala:repl
```


== Script moduleDeps

include::partial$example/scalalib/script/7-script-deps.adoc[]

== Relative and Absolute Script moduleDeps

include::partial$example/scalalib/script/8-relative-deps.adoc[]


== Project `moduleDeps`

include::partial$example/scalalib/script/9-programmable-module-deps.adoc[]


== Custom Script Module Classes

include::partial$example/scalalib/script/10-custom-class.adoc[]


== Script Resources

include::partial$example/scalalib/script/11-resources.adoc[]


== Custom JVM Versions

include::partial$example/scalalib/script/12-jvm-version.adoc[]

== Bundled Libraries

include::partial$example/scalalib/script/13-raw.adoc[]

include::partial$Script_Footer.adoc[]