Ant wasn't around when I started my first Java project. We used Makefiles. We used elaborate Makefiles that are copied and tweaked from project to project. Cruft accumulates as time goes on. Until at one point, no one dared to touch the Makefile except between the lines:
# You can change these values
SOURCES=src/com/weiqi/client/*.java src/com/weiqi/server/*.java
CLASSES=classes
# You should not touch anything below this line
Then Ant came along. We threw away the Makefiles. I wrote my fair share of Ant build files. Some quite elaborate. The build files are in XML, which was cool new thing back then. It was also easier to read.
Then came the IDEs. They each has their own brand of project files that are generated when you start a new project, probably using the New Project Wizard.
The problem with project files is that they don't share that well. If you check them in to source control system and check them out on a different machine, it may not work. Even if it worked, they are prone to be modified while you are working on the project, which causes them to be checked back in, causing conflicts for everybody else.
Then there is Maven, which is a step forward from Ant build files. However its XML syntax is quite cumbersome and hard to remember.
Which brings me to MPC—The Makefile, Project and Workspace Creator. It generates Makefiles, Visual Studio solution files, and workspace files for other development environments from simple, human editable, comprehensible, and maintainable description files.
We use MPC for all of our C++ projects. And everyone loved it. You know the crowd, the C++ crowd. It's not easy for us to love anything. One benefit of using MPC is that one set of description files can be used to generate the files needed by multiple IDEs and environments: solution files for Visual Studio and Makefiles for GCC and Eclipse.
It saves time and hassle. That's why we love it.
Over the last two weeks, I've seen something similar in two different places, although on a smaller scale. The first place is Google Web Toolkit, where they provide tools to generate Ant build files and Eclipse project files. The second place is Celtix, where their wsdl2java tool has an option of generating an Ant build file.
What I would like to see is for this idea to spread to all Java projects in a generic way. I mean if you include in your tar ball an Ant build file, you surely have enough information to construct IDEA, Eclipse, NetBeans project files. That information, surely can be abstracted into something simple and easy:
// MPC file: myproject.mpc
project : hibernate_project, sprint_project {
Source_Files {
//list of sources
}
Mapping_Files {
//list of mapping files
}
// etc.
}
From this file, we would generate project files for all sorts of IDEs and maybe Ant build files (maybe even Makefiles now that we don't have to maintain them):
[weiqi@gao] $ mpc.pl -type idea5 myproject.mpc
Generating idea5 output using myproject.mpc
Generation Time: 5s
[weiqi@gao] $ mpc.pl -type eclipse32 myproject.mpc
Generating eclipse32 output using myproject.mpc
Generation Time: 6s
[weiqi@gao] $ mpc.pl -type ant myproject.mpc
Generating ant output using myproject.mpc
Generation Time: 3s
[weiqi@gao] $ mpc.pl -type gnumake myproject.mpc
Generating gnumake output using myproject.mpc
Generation Time: 3s