scala-2.13.0 & ant support

#1

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?

cheers

1 Like
#2

It was removed by https://github.com/scala/scala/pull/6255

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.)

1 Like
#3

so, it was removed … because we are all supposed to use only sbt ?
http://www.lihaoyi.com/post/SowhatswrongwithSBT.html

1 Like
#4

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:

#5

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.

#6

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

#7

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: https://github.com/scala/scala/releases/tag/v2.13.0. 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…

#9

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 ${build.target.dir}" />
    <exec executable="scalac" failonerror="true">
        <arg line="-cp '${lib.dir}/*'" />
        <arg line="-d '${build.target.dir}'" />
        <arg line="@${basedir}/files2compile" />
    </exec>
</target>


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

(needs SCALA_HOME env set, and scalac in PATH)

1 Like
#10

this is now fixed

1 Like
#11

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.

1 Like
#12

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.

#13

or Gradle

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

1 Like
#14

I see you’ve opened https://github.com/gradle/gradle/issues/9855 on the Gradle thing; linking it here so that interested users can subscribe to it.

#15

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