From c328f7a7602d2fbc875c7f5301bdfaee496da325 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 24 May 2014 16:25:55 -0700 Subject: Add scripts for converting VC10 to VC11 and VC11 to VC12 projects --- bin/vc11convert.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/vc12convert.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100755 bin/vc11convert.sh create mode 100755 bin/vc12convert.sh diff --git a/bin/vc11convert.sh b/bin/vc11convert.sh new file mode 100755 index 0000000..b0404b5 --- /dev/null +++ b/bin/vc11convert.sh @@ -0,0 +1,63 @@ +#! /usr/bin/env bash + +# Convert VC10 project files to VC11. +# +# -i encoded input VC version, '10.0' by default +# -o encoded output VC version, '11.0' by default +# + +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +wd=`pwd` +vi=10.0 +vo=11.0 + +while [ $# -gt 0 ]; do + case $1 in + -i) + shift + vi=$1 + shift + ;; + -o) + shift + vo=$1 + shift + ;; + *) + error "unknown option: $1" + exit 1 + ;; + esac +done + +files=`find . -name "*-$vi.vcxproj" -type f` + +for p in $files; do + + d=`dirname $p` + f=`basename $p -$vi.vcxproj` + + cd $d + + cp $f-$vi.vcxproj.filters $f-$vo.vcxproj.filters + + sed \ + -e "s##v110\n #" \ + $f-$vi.vcxproj >$f-$vo.vcxproj + + todos $f-$vo.vcxproj + + if [ `wc -c <$f-$vi.vcxproj` -eq `wc -c <$f-$vo.vcxproj` ]; then + error "no changes made in $d" + cd $wd + exit 1 + fi + + cd $wd +done diff --git a/bin/vc12convert.sh b/bin/vc12convert.sh new file mode 100755 index 0000000..752ed2a --- /dev/null +++ b/bin/vc12convert.sh @@ -0,0 +1,65 @@ +#! /usr/bin/env bash + +# Convert VC11 project files to VC12. +# +# -i encoded input VC version, '11.0' by default +# -o encoded output VC version, '12.0' by default +# + +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +wd=`pwd` +vi=11.0 +vo=12.0 + +while [ $# -gt 0 ]; do + case $1 in + -i) + shift + vi=$1 + shift + ;; + -o) + shift + vo=$1 + shift + ;; + *) + error "unknown option: $1" + exit 1 + ;; + esac +done + +files=`find . -name "*-$vi.vcxproj" -type f` + +for p in $files; do + + d=`dirname $p` + f=`basename $p -$vi.vcxproj` + + cd $d + + cp $f-$vi.vcxproj.filters $f-$vo.vcxproj.filters + + sed \ + -e "s#ToolsVersion=\"4.0\"#ToolsVersion=\"12.0\"#" \ + -e "s#v110#v120#" \ + -e "s## true\n #" \ + $f-$vi.vcxproj >$f-$vo.vcxproj + + todos $f-$vo.vcxproj + + if [ `wc -c <$f-$vi.vcxproj` -eq `wc -c <$f-$vo.vcxproj` ]; then + error "no changes made in $d" + cd $wd + exit 1 + fi + + cd $wd +done -- cgit v1.1