When I create a new project, I often start by creating the following folder/file structure:
This is a bit of a pain, and I would like to automate it. It wouldn't be too difficult to write a shell script that can basically do this, but I was wondering if I could save some time by using an existing script that is robust, mature, and tested.
I know that a lot of tools like Eclipse can do something like this for you automatically, but I work on a lot of projects that don't use Eclipse (or some similar IDE).
Any help would be greatly appreciated. Thanks in advance for the help!
This is exactly the problem that I have been attempting to solve over the last few weeks. The problem with your solution is that you have unnecessary duplication - that is, if you find a mistake in build.xml, you must update the file for each project.
The optimal solution involves an independent expression of project dependencies. That is, you'd express that your project is a "jar" project - and therefore, requires the resources to "build" a jar, etc. These resources would be resolved by the dependency manager. The problem with that is there are no decent tools out there for expression of dependency. The best I've found is Ivy by Jayasoft, but that is quite inflexible in terms of the different types of dependencies - for example, I write DocBook articles that depend on the DocBook DTD and DocBook XSL for "building" (transforming into presentation formats). There are other problems with Ivy that have caused me to abandon it.
I keep all project dependencies in a SCM repository (Subversion). There are some great articles that answer the question "should I keep dependencies in SCM or on the file system?". I confidentally conclude the former (in fact, I don't see the point of using the file system for non-static content much anymore).
I believe that this problem should be solved in a manner that is as flawless as possible, otherwise, what's the point of bothering about it? I have concluded that the only reasonable way to solve this issue is to write a decent (emphasis: flexible) project dependency manager. This, of course, costs time. Until that time comes around, I've merely conceded to what you suggest yourself - cringing every time I have to use it.