Need help getting started with ScalaFX+Mill

Hello, I’m a Scala/Mill beginner trying to get started with ScalaFX. The README on their Github repo gives a basic Mill build config example that doesn’t seem to work with the current version of Mill. Here’s what I have so far:

//| mill-version: 1.0.3

package build
import mill._, scalalib._

object scalafxProject extends ScalaModule {
    def scalaVersion = "3.7.2"

    // Customize coursier resolution to discover the OS-specific artifacts required by JavaFX
    // Note: this requires mill >= 0.9.7 (with pr/775 merged)
    def resolutionCustomizer = T.task {
        Some((r: coursier.core.Resolution) =>
        r.withOsInfo(coursier.core.Activation.Os.fromProperties(sys.props.toMap))
        )
    }

    // Add dependency on JavaFX libraries
    val javaFXVersion = "24"
    val scalaFXVersion = "24.0.2-R36"
    val javaFXModules = List("base", "controls", "fxml", "graphics", "media", "swing", "web")
    .map(m => ivy"org.openjfx:javafx-$m:$javaFXVersion")

    def ivyDeps = {
        Agg(
            ivy"org.scalafx::scalafx:$scalaFXVersion",
            //...
        ) ++ javaFXModules
    }
}

When I try to compile I get the following errors:

[build.mill-59] [error] -- [E8] /projectdir/build.mill:11:34
[build.mill-59] [error] 11 │    def resolutionCustomizer = T.task {
[build.mill-59] [error]    │                                 ^^^^
[build.mill-59] [error]    │value task is not a member of object mill.api.Task.Simple
[build.mill-59] [error] -- [E6] /projectdir/build.mill:25:9
[build.mill-59] [error] 25 │        Agg(
[build.mill-59] [error]    │        ^^^
[build.mill-59] [error]    │Not found: Agg
[build.mill-59] [error] two errors found

As a beginner I am not sure where to start with getting this to work. My best guess is that perhaps Task.t and Agg have been replaced with something else some time between Mill 0.9.7 and 1.0.3, especially since I can’t find any examples on the Mill docs site which have those.
Any suggestions for how I can get this to compile successfully?

Update: I received an answer via Discord from Li Haoyi. I will quote it here for posterity:

T.task has become Task.Anon, and Agg is now just Seq
also ivyDeps and ivy is now mvnDeps and mvn

2 Likes