scala-2.13.0 & ant support

I could not find anymore ant scalac task definition in scala-2.13.0

In <=2.12.8 was in lib/scala-compiler.jar scala/tools/ant/ antlib.xml + Scalac.class
In 2.13.0 in lib/scala-compiler.jar scala/tools/ ant folder is gone
Is it somewhere else? 'looks it is not supported anymore: will it be added later?


1 Like

It was removed by

As the PR says,

it ought to be a separate project, if anyone still wants it to exist in 2.13+ world.

The removed code is open-source, so anyone reading this should feel free to revive it and make it available separately.

It had already been unmaintained for a long time. (Perhaps in a separate repo, it might actually attract more maintenance than it was getting before? For example, it could now be released on its own schedule, instead of having to wait for a Scala release to happen.)


so, it was removed … because we are all supposed to use only sbt ?

1 Like

SBT has improve a lot since then … why not you give it a try ?

In a personal note: I love Ant, I’ve used Ant a lot by 2001 and 2002 … you make me bring tons of nice memories :wink: :slight_smile:

1 Like

or Gradle, or Maven, or Bloop, or Mill, or CBT, or Fury, or…

or even Ant, if sufficient community interest and commitment exists. all of these things are community-based efforts, in whole or in part.


one can use ant, not for the sake of using old tech, but to “fit in” within a legacy java environment. removing such legacy support won’t help scala adoption into the real world

There are many projects out there sill using Ant for various reasons. I personally can’t move a few of them to Scala 2.13 as Ant support is dropped, as I don’t have an option to modify other aspects of those projects. It’s not like Ant is an obsolete tool. And supporting it in Scala does not seem to be a big deal. Showstopper for me :frowning:
Moreover, there is no mention of this change in Release notes found here: Is Ant negligible enough build tool that is not worth mentioning when you drop support for it?!!
Would it be possible at least to provide a separate library for transition? If the community wants to support it, they could start from that separate library. Just like the way XML was handled…

At least for scalac: to bypass that annoying removal, I created a scalac target that exec the scalac command e.g.

<target name="scalac">
    <echo message="Compiling source files to ${}" />
    <exec executable="scalac" failonerror="true">
        <arg line="-cp '${lib.dir}/*'" />
        <arg line="-d '${}'" />
        <arg line="@${basedir}/files2compile" />

<target name="compile">
    <pathconvert property="src2compile" pathsep=" ">
        <fileset dir="${src.dir}">
            <include name="**/*.scala"/>
            <exclude name="**/test*"/>
            <exclude name="**/*Tmp*"/>
            <exclude name="**/*Test.scala"/>
    <echo file="${basedir}/files2compile" message="${src2compile}" />
    <property name="" value="${build.production.dir}" />
    <antcall target="scalac" />

(needs SCALA_HOME env set, and scalac in PATH)

1 Like

this is now fixed

1 Like

It was removed because we would prefer that someone else maintained this. We’re a small team and we have to focus on what we do best. As Seth said, I hope someone will take the code from that PR and move it to a separate project, just like the maven plugin(s) that are maintained outside of scala/scala.


I can understand that. Yet, it was there up until M2, right? Scala community, thankfully, is not so small anymore. I think dropping the support without giving a transition library, or documenting how to replace scalac and scaladoc targets in an ant file, is not such a responsible behavior towards that community. dece is nice enough to list an option here with some assumptions about path and environment variable. But I think it is your responsibility to provide a standard example, and put it in release documentation.

or Gradle

where Scala plugin’s scaladoc task is broken, since it uses ‘scala/tools/ant/antlib.xml’…

1 Like

I see you’ve opened on the Gradle thing; linking it here so that interested users can subscribe to it.

I’ve extracted ant related code from 2.12.x source, changed some 2.13 issues and recompiled it using scala 2.13.0 to separate jar. It is working for me. I am pretty much sure that this is far from perfection, but maybe it could be used as start point for future improvements. Also, this can be used to solve scaladoc problem in gradle.
is there any “official” place where to put those source files or should I simply put that on my github space?

1 Like

Cool! I’d suggest starting under your own GitHub account, and we can worry later about whether it makes sense to transfer ownership to the Scala org.

I’d be interested in adding this to the Scala community build, once the repo exists.

I’d also be happy to do some publicity via once the project is up and running smoothly. (Or, if you feel such publicity might help attract interested contributors, we could do it sooner.)

Sorry for not replying earlier :frowning:
Code that I’ve extracted from Scala 12.7 and adapted to 2.13 is located on GitHub at . At the moment it can be compiled using 2.13.1 and it is working for me. Of course, it is possible (or even likely) thta it will not work generally. So, please, let me know if you have some problems using this, I will try to fix if I can. [I will be on vacation for next two weeks and unable to answer]

Unfortunately, contrary to most of other languages and packages that I’ve used where differences between two minor versions are (unsurprisingly?) minor, in Scala changes between tow (consecutive) versions can break thnigs. Latest example is ‘target’ compiler option which in 2.13.0 accepted as values ‘jvm-1.[5-8]’ (with everything except ‘jvm-1.8’ deprecated), in 2.13.1 accepted values are simple numbers 8-12.

1 Like

Kindly add the Ant support back into the project. Ant provides absolute transparency into the build activity. I personally prefer Ant over SBT. If nothing, it helps learning and adaption for the language. Thanks!