Fixed GUID scripts
[amule.git] / platforms / Windows / MSVC9 / fixwxGUIDs.pl
blobdea9156c147ec011cf2e772cf10cda7163b50549
1 #!perl
3 # This script is only useful if your source is in a SVN working copy!
5 # Problem: whenever you add a new wxWidgets version and convert the VC6 projects,
6 # they are converted to VC8 XML .vcproj . In the process, a new project GUID is created.
7 # When you then open your solution, all GUIDs are updated.
9 # To avoid this:
10 # 1) Open and close wx.dsw, creating the .vcproj
11 # 2) Run this script. It will replace the new GUIDs in the wx vcproj by the old ones from the aMule-MSVCE-ExtLibs.sln .
12 # 3) Now load aMule-MSVCE-ExtLibs.sln. It won't be changed anymore.
15 use strict;
17 open(sln, 'aMule-MSVCE-ExtLibs.sln');
18 #Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxregex", "..\..\wxWidgets\build\msw\wx_wxregex.vcproj", "{B4ACF599-824F-4806-8390-414B2DF64922}"
19 while (<sln>) {
20 if (/^Project.*, \"(.+)\", (\".+\")/) {
21 my ($path, $guid) = ($1, $2);
22 next unless $path =~ /\\wxWidgets/;
23 $path =~ s-\\-/-g;
24 print "fix $path\n";
25 open(prj, $path) or die "$path $!";
26 my @content = <prj>;
27 close prj;
28 foreach (@content) {
29 if (/ProjectGUID=/) {
30 $_ = "\tProjectGUID=$guid\n";
31 print $_;
32 last;
35 open(prj, ">$path") or die;
36 print prj @content;
37 close prj;