djb
djb

Reputation: 5008

How do I configure Ant to run (not just compile) Scala?

Is there an Ant taskdef somewhere that provides a <scala> task that will use my SCALA_HOME and which supports classname=, <classpath>, <arg>, <jvmarg>, etc., analogous to <java>?

Scala ant tasks only defines <scalac>, <fsc>, and <scaladoc> Ant tasks (and configure ant for scala discusses those tasks). However, there is no <scala> task for running Scala applications, which seems to be an oversight. I know I can cobble together a <java> task to run Scala, but that seems rather inconvenient and round-about.

Upvotes: 3

Views: 423

Answers (1)

Brian Smith
Brian Smith

Reputation: 3381

There doesn't seem to be an ant task for running scala yet. I think there are two reasons for that:

Firstly, the one you allude to in your question - you can cobble together a task to do it. In fact, the "scala" executable is just a batch/sh script to run java with the right classpath and options.

Second, I think most scala projects use sbt, and the majority of the remainder use maven, so I guess nobody has run across the need for a specialized ant task for execution yet.

Upvotes: 2

Related Questions