windowsscalaammonitescala-repl

Is there any way to install Scala Ammonite-REPL in Windows 8.1


I'm looking for how to install Scala Ammonite-REPL in Windows 8.1 but I didn't find anything in the web.

does anyone know something related about this?

Is there any way to do this?


Solution

  • I finally found out an answer to my own question.

    It seems to be that Ammonite-REPL doesn't work on Windows 8.1

    However, it still can be possible via SBT.

    You can run Ammonite on Windows 8.1 if you have an existing SBT project. To do so, add the following to your build.sbt

    libraryDependencies += {
      val version = scalaBinaryVersion.value match {
        case "2.10" => "1.0.3"
        case _ => "2.2.0"
      }
      "com.lihaoyi" % "ammonite" % version % "test" cross CrossVersion.full
    }
    
    sourceGenerators in Test += Def.task {
      val file = (sourceManaged in Test).value / "amm.scala"
      IO.write(file, """object amm extends App { ammonite.Main.main(args) }""")
      Seq(file)
    }.taskValue
    
    // Optional, required for the `source` command to work
    (fullClasspath in Test) ++= {
      (updateClassifiers in Test).value
        .configurations
        .find(_.configuration.name == Test.name)
        .get
        .modules
        .flatMap(_.artifacts)
        .collect{case (a, f) if a.classifier == Some("sources") => f}
    }
    

    After that, simply hit

    C:\Dir\...\projectName> sbt projectName/test:run

    In my case as you can see in the picture below it works fine

    enter image description here