Hacking Scala Using Ant

It would be nice to finish this one day, but it is just a sketch so far. Additionally, maybe people should use maven instead of ant....

Ant (LINK) is a tool for managing the conversion of source code into built programs that is particularly popular among those who work with Java. This file describes how to use Ant with Scala code.

Approach to Dependencies

Scala Bazaars allows distributing both complete applications and individual libraries. It helps you obtain and manage packages from world-wide shared repositories, from others in your organization, and from code on your own machine. You may as well use it to handle dependencies between portions of your own project.

The general approach, then, is that when you build something and are ready to use it, you should install it in your own sbaz directory for use by other tools. If you want others in your organization or around the world to also use the package, then post your package on an appropriate sbaz index server. If you are compiling something that has a dependency, find that dependency in your sbaz directory. This way, components can be developed independently and then inter-component dependencies can be managed by sbaz.

Preliminaries

To locate your sbaz directory, your build.xml file should start with a definition of the scala.home property:

  
  
It is also convenient to define a current version number for the code being built:
  
Finally, it is important to include the standard Ant header supplied along with the Scala compiler.
  
    
      
      
    
  
Documentation on these tasks can be found at: (LINK)

Directory layout

There is no one right way to lay out a directory tree. A common layout for Scala programmers, assumed for the rest of this article, goes like this:

Targets

The following are some targets it makes sense to define in your build.xml:

These targets are described one by one below with an example given of each.

build

dist

install

clean

toolScripts

tests

api