Jump to content
  • Advertisement
Sign in to follow this  
kanato

[.net] Multiple solutions in dotnet prebuild

This topic is 3505 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone here familiar with dotnet prebuild? I want to be able to have it create multiple solutions and have some projects shared between solutions. Is there any way to do that without duplicating the <project /> section in Prebuild.xml for each solution that includes the same project?

Share this post


Link to post
Share on other sites
Advertisement
Been a while since I looked at prebuild, but you might be able to do something with changing the path of the <Project> node to go up a level, but I don't think there is specific code for including another XML file into one file (though, Preprocessor.cs is where you would do that).

Share this post


Link to post
Share on other sites
Most of my work on prebuild was with the nant building and some processing instruction stuff. There isn't explictly a <?link?> PI or something like that from what I remember, nor an xlink. So, unless I missed something browsing the code again, you'll have to make some changes to include.

I would go with either a <?PI?> or a xlink version, if you want to add it. And I'm sure someone will appreciate it if you do, mainly because its a useful feature.

I could be wrong though, I just didn't see anything when I went through the subversion repository.

Share this post


Link to post
Share on other sites
I thought about adding onto it but it looks like from the forums that the project is not very active. But then I notice that you are one of the developers so maybe I don't have to be as concerned about trying to make a submission to a project that none of the developers are paying attention to.

Well, if I don't get that far I may just create a preprocessing utility to generate dnpb files the way I want.

Edit: Actually it was easy to add support for an include node in dnpb. I will test it some more and then submit a patch.

[Edited by - kanato on November 18, 2008 2:55:25 PM]

Share this post


Link to post
Share on other sites
Ok, I created a patch which add support for include files in a prebuild.xml file. To use it, one adds a preprocessor command like:

<?include file="some_other_file.xml" ?>

Please let me know what you think.

http://agate.sourceforge.net/download/dnpb.patch

Share this post


Link to post
Share on other sites
Cool. I found some other issues with making visual studio project files. Designer generated files and resx files aren't linked with Forms and UserControls correctly. I've fixed some of those issues myself, but I don't have quite the understanding of the whole code well enough to know if the fixes I've done are the way they should be.

Share this post


Link to post
Share on other sites
So, this is an issue that I've been struggling with and I have had to fix several parts of the prebuild code to get this to work. First I have to ask the question, if I have a WinForms app where I have a settings file and resx files that are associatd with UserControls or Forms, what is the proper way to write my prebuild file so that these are included? This is the sort of approach I've been trying to use:

<Files>
<File buildAction="None">Properties/Settings.settings</File>
<Match pattern="*.cs" recurse="true"/>
<Match pattern="*.resx" recurse="true"/>
</Files>


When creating VS2008 project files though, the resx files are not correctly marked as dependent on any associated forms (for instance, if a form has an embedded icon). If the match line for resx files is left off, the resx files are not included in the project and not compiled.

When creating nant build files, the above approach causes resx files to be included as resources, and then again as source files, which causes the build to fail when nant is run.

So if I'm using Prebuild wrong, I need to understand how to setup a basic winforms application with a settings file and resx files which may or may not be attached to a form or usercontrol. Otherwise, I can submit patches for these issues to correct the output for VS2008 and nant. (I've checked in my fixes for Prebuild to the AgateLib SVN on source forge, if you want to take a look. I am not yet satisfied with my testing to submit as a patch, but if you want to give me preemptive feedback on it, feel free to take a look.)

Share this post


Link to post
Share on other sites
I remember encountering the same problem with the VS2005 target. This was fixed at some point, but I'm not sure how.

In OpenTK, I simply include the .cs files and prebuild automatically handles the dependent resources.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!