WSPBuilder: Generate SharePoint Solution Files
There's a project on CodePlex called WSPBuilder. It's a console application that gets you from a given folder structure to a SharePoint Solution file. It would be nice if it was a NAnt / MSBuild task, but since it's an exe, calling it from your build script is trivial already.
Folder Structure
12
TEMPLATE
CONTROLTEMPLATES
FEATURES
LAYOUTS
XML
(anything you want to go in the 12 hive. just add any other folders)
GAC
(any assemblies you would like deployed to the GAC)
80
BIN
(anything you want to go in the web application's virtual directory)
solutionid.txt
Sample Console Call from NAnt
<exec program="C:\Path\to\WSPBuilder.exe" commandline="-DLLReferencePath GAC -WSPName OutputSolutionFileName.wsp -TraceLevel Verbose" workingdir="C:\Path\to\Solution\Folder\Structure" />