diff projects/generate @ 6097:0a7a812e54ea draft

(svn r8832) -Change: rewrite the solution file generator a little so it makes project files that look more like the ones generated by respectively MSVC2003 and MSVC2005. For some reason the internal formatting of the XML between MSVC2003 and MSVC2005 differs, so adding a file in MSVC2005 would result in basically adding the entire openttd_vs80.vcproj to the diff.
author rubidium <rubidium@openttd.org>
date Wed, 21 Feb 2007 17:59:34 +0000 (2007-02-21)
parents 5b541e0c8c93
children ed54dc50aeaf
line wrap: on
line diff
--- a/projects/generate
+++ b/projects/generate
@@ -111,8 +111,7 @@
 		i=`basename $i | sed s/.txt$//g`
 		RES="$RES
 		<File
-			RelativePath=\"..\\src\\lang\\"$i".txt\"
-			>
+			RelativePath=\"..\\src\\lang\\"$i".txt\">
 			<FileConfiguration
 				Name=\"Debug|Win32\">
 				<Tool
@@ -120,8 +119,7 @@
 					Description=\"Generating "$i" language file\"
 					CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang &quot;\$(InputPath)&quot;&#x0D;&#x0A;\"
 					AdditionalDependencies=\"\"
-					Outputs=\"..\\bin\\lang\\"$i".lng\"
-				/>
+					Outputs=\"..\\bin\\lang\\"$i".lng\"/>
 			</FileConfiguration>
 		</File>"
 	done
@@ -141,7 +139,15 @@
 	' > \"$ROOT_DIR/projects/$2\"`"
 
 	# The files-list
-	echo "$1" >> "$ROOT_DIR/projects/$2"
+	if [ "$3" = "msvc2003" ]; then
+		echo "$1" | sed 's@\&#x0D;\&#x0A;@\n@' >> "$ROOT_DIR/projects/$2"
+	else
+		echo "$1" | sed '
+			s@Filter="">@>@;
+			s@^\([	]*\)\([^	<].*[^/]\)>$@\1\2\n\1>@g;
+			s@^	\([	]*\)\([^	<].*\)/>$@	\1\2\n\1/>@g;
+		' >> "$ROOT_DIR/projects/$2"
+	fi
 
 	# Everything below the !!FILES!! marker
 	RES="`cat \"$ROOT_DIR/projects/$2\".in | tr '\r' '\n' | awk '
@@ -158,7 +164,7 @@
 load_main_data "$ROOT_DIR/source.list" openttd
 load_lang_data "$ROOT_DIR/src/lang/*.txt" lang
 
-generate "$openttd" "openttd.vcproj"
-generate "$openttd" "openttd_vs80.vcproj"
-generate "$lang" "langs_vs80.vcproj"
-generate "$lang" "langs.vcproj"
+generate "$openttd" "openttd.vcproj"      "msvc2003"
+generate "$openttd" "openttd_vs80.vcproj" "msvc2005"
+generate "$lang" "langs.vcproj"           "msvc2003"
+generate "$lang" "langs_vs80.vcproj"      "msvc2005"