This has been posted by a few others, but I wanted to make sure people knew about it. It is pretty simple to have Visual Studio create a WSP file for you every time you compile using MSBuild. Start by creating an XML file called Solution.build (or whatever). I typically put this in my Solution folder. This is going to simply execute the makecab.exe file with a path to your solution.ddf file (also typically in the Solution folder). It should look like this.
<?xml version="1.0" encoding="utf-8" ?>
<Exec Command="makecab.exe /F solution/cab.ddf"></Exec>
The target name can be anything, just make a note of it because you will reference it when editing your .csproj file (your are using C# right?). This is the part that kind of sucks. Go edit your .csproj file with the text editor of your choice (i.e. notepad). Go to the end and look for the import statements and you'll see some post build type things commented out. That is where you want to paste the following.
<Import Project="Solution\Solution.build" />
<CallTarget Targets="BuildSolutionPackage" />
This is where the Target name has to match up. Once you do that, reload the project in Visual Studio. You'll get prompted for security or something because you customized the file. Just ignore it and move on. Now when you compile, it will make the .wsp file for you.
Eventually my goal is to figure out how to make some Team Build scripts for our MOSS solution. I think this is a step in the right direction. When I figure that out, I will post more on it. I also think there are some guidance packages out now that help with this but I have yet to find anything I really like yet. Maybe I will create my own someday.
Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=382