After wasting so much time by forgetting to add files to the ddf file (and just messing with the ddf file in general) I said to myself, there HAS to be a better way to do this DDF into WSP thing! So this morning I created a little program in an hour and a half that creates my ddf file and then packages everything up into a wsp for me. All I need to do is build my project. I figured I'd share this tool, so here it is...
Visit Codeplex site for source and executables
The most effective way to set up the Visual Studio environment for wsp development I've found is to set up your folder structure to mirror the Templates directory in the 12 hive, so this tool assumes that's what you're doing, too.
If you have your project set up this way, this tool will go through the Template directory of your project and pull out all the files that are not either a .CS or a .SSC (source safe file). If you get the source of this tool, you can see how the file exclusions are managed and add your own.
The one downfall right now is that this tool won't create the manifest.xml file for you. I'd like to get to that eventually, but there was just too much complexity in the way the manifest file works to do the whole thing in under two hours.
Install instructions:
1) Either get the executable or build the project
2) Put the CreateDDF.exe file in c:/CreateDDF
3) In your moss solution project in Visual Studio, right click on the project and choose 'Unload Project'
4) Once the project has been unloaded, right click it again, and choose 'Edit projectname.csproj'
5) Scroll all the way to the bottom of the .csproj file where you see the following code
<!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
6) Change the above code to:
<Target Name="BeforeBuild">
<Exec Command="$(MakeWSPPath) -n $(MSBuildProjectName)" />
</Target>
<Target Name="AfterBuild">
<Exec Command="$(MakeCabPath) /F $(MSBuildProjectName).ddf /D CabinetNameTemplate=$(MSBuildProjectName).wsp /D DiskDirectory1=wsp" />
</Target>
<PropertyGroup>
<MakeWSPPath>"C:\CreateDDF\CreateDDF.exe"</MakeWSPPath>
<MakeCabPath>"C:\Windows\System32\makecab.exe"</MakeCabPath>
</PropertyGroup>
7) Save the file and reload the project (click yes if you see a popup message)
8) Build the project, and a directory named 'wsp' will be created along side the /bin directory. The wsp file will be in there.
Enjoy...
(Thanks to Andrew Connell for the tweaking of the .csproj tip. Got that part from the Telerik integration guide he did)
Update(9/23/07): I've created a Visual Studio 2005 project tempate for wsp development. Check it out!