I would recommend rolling your own converter.

First off, you should target your efforts towards the '.vcproj' files - as they are holding the actual files in the project. Refer to Microsoft for the full XML schema. (Hey, they actually documented this!).

Then use XML::Simple or whatever our preference is to parse, rinse, stir and output to a nmake/gmake/whatnot file.

The '.sln' file is not XML, but a pretty straight-forward text-file, most notably linking to the '.vcproj' files.

I haven't converted in this direction, but rather generated .vcproj files from other input.

Following code should get you started (assumes '.sln' file(s) as args):

use strict; use warnings; use XML::Simple; use Data::Dumper; my(%projs); while(<>) { # Extract project files linked into solution if(/^Project\(.+\)\s+=\s+\"([^"]+)\",\s+\"([^"]+)\"/) { $projs{$1} = $2; # Got one! } } # Process the project files - XML format my $xs = new XML::Simple(); for my $p (keys(%projs)) { my $file = $projs{$p}; print "Parsing $p, file $file\n"; my $ref = $xs->XMLin($file); # Print parsed XML - or output in another format? print Dumper($ref); }

Cheers,

---Lars

Update: Added code snippet


In reply to Re: Converting .NET .sln files to nmake/nant format by EverLast
in thread Converting .NET .sln files to nmake/nant format by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.