[TR-2] Use ant to build Terrier Created: 20/Jan/09  Updated: 19/Aug/10  Resolved: 08/Mar/10

Status: Resolved
Project: Terrier Core
Component/s: build
Affects Version/s: None
Fix Version/s: 3.0

Type: Improvement Priority: Major
Reporter: Craig Macdonald Assignee: Craig Macdonald
Resolution: Duplicate  
Labels: None

Attachments: File terrier_ant_build_components.zip    

 Description   
The current Makefile used to build Terrier are not usable on Windows, where many of our developers work. Consider an alternative building process, such as ant.

 Comments   
Comment by Giovanni Stilo [ 12/Feb/09 ]

You also consider Maven. That for a API like Terrier-Core is more indicated.

Comment by Craig Macdonald [ 12/Feb/09 ]

I guess I should enumerate our requirements for a build process:

  • Compile source files to jar(s)
  • Execute unit test (junit)
  • Execute end-to-end test (shell script)
  • Compile Javadoc
  • Build tar and zip files, optionally running files through unix2dos before zip

Stilo, Did you say that you have a Maven build script already for Terrier?

Comment by Giovanni Stilo [ 12/Feb/09 ]

>Yes i have it but if u want to use it u need a lib repository.
Then i think the only point that isn't yet covered by maven
is:

  • Build tar and zip files, optionally running files through unix2dos before zip

but really i don't know very well maven. But i know u can also invoke ant from it.

Comment by Craig Macdonald [ 13/Feb/09 ]

How difficult is it set up this lib repository? Would this let people download Terrier automatically?

I would prefer that people have to go through the Terrier download process for the moment.

Comment by Giovanni Stilo [ 13/Feb/09 ]

No people have to download by the web site; only dependency will be automaticcaly availabe.
The if u want to offer terrier as lib this is another problem.
The repos it's quite simple to setup is basiccally a directory structure that contain jar and descriptor available to the user by web server.
Basically doesn't change nothing because u have to download the terrier-core source and the maven descriptor in the same way u do now.
But then when u build maven automatically download the dependencies (lib).
In this way u don't have to put all the time the lib in the distribution but if u need to change some lib version there is'nt problem, so maven have
meccanism to manage different version of library so for one version of terrier u could specify a particular version of lib.
That's it.

Comment by Craig Macdonald [ 13/Feb/09 ]

Hmmm. I would prefer that Terrier is downloaded with all of its dependencies, as people have enough problems using Terrier, without trying to help them install Maven, and configure it to use a proxy server so it can download the dependencies and compile the jar file.

Does this mean that the main advantage of Maven is that it downloads the dependenies. But I'd rather ship Terrier pre-built with all the requisite jar files. Is there another advantage that I have missed?

Comment by Giovanni Stilo [ 15/Feb/09 ]

Probably u've right for end-users.
But i think that terrier its more oriented in developer-users.
the second class of users would appreciate maven to build their "custom" code.
At the end i think Terrier Team can provide two type of distribution the maven one and normal one
that is already builded (with maven) by the team.

Comment by Craig Macdonald [ 17/Feb/09 ]

What about if ant was configured to build packages, given a pre-determined layout for their source? That would nullify the need for maven to build custom code?

Comment by Giovanni Stilo [ 17/Feb/09 ]

Obvious.
The same if u still use make well preconfigured.

Comment by Alan Dunk [ 19/Dec/09 ]

Please find the attached terrier_ant_build_components.zip file for this issue, which contains an Ant build for Terrier to meet the build process requirements listed above.

Running unix2dos and the end to end tests currently requires bash to be executed, which is the reason for the additional shell scripts. The directory structure indicates where they should live based on a build of Terrier 2.2.1.

The build was developed using Apache Ant 1.7.1 which is a pre-requisite for running the build.

I've tested it for Unix and Windows platforms, and creating release builds worked in both cases.

One caveat is that running the end to end tests is dependent on running the build target within a Unix environment. If the end to end tests need to be run in a Windows environment, consider using Cygwin to run equivalent shell commands within a batch script rather than a shell script. (e.g. to run egrep within Cygwin, call <cygwin_home>\bin\grep -e.)

Comment by Craig Macdonald [ 21/Dec/09 ]

Thanks for the Alan, I'll check it out and leave some feedback. Regards!

Comment by Craig Macdonald [ 08/Mar/10 ]

Duplicate of TR-65

Comment by Richard Eckart de Castilho [ 19/Aug/10 ]

Even though this issue is already closed: one can use the Maven Assembly Plugin to create convenient distributions that include all dependencies and more.

Generated at Mon Oct 21 03:43:05 BST 2019 using JIRA 7.1.1#71004-sha1:d6b2c0d9b7051e9fb5e4eb8ce177ca56d91d7bd8.