Skip to content

Commit

Permalink
Line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
wbhart committed Nov 25, 2012
1 parent a373abb commit f608007
Show file tree
Hide file tree
Showing 743 changed files with 142,339 additions and 142,317 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
130 changes: 65 additions & 65 deletions build.vc10/add.express.py
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
# Convert project files between Visual Studio 2010 and
# Visual C++ 2010 Express (use Python 2.6 or later).
#
# Copyright 2010, Dr B R Gladman

from __future__ import print_function

import os
import shutil
import string
import fileinput, sys

express = True

mkr = r''' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />''' + '\n'
pg1 = r''' <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">''' '\n'
pg2 = r''' <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">''' '\n'
pgc = r''' <ConfigurationType>Application</ConfigurationType>''' '\n'
pgt = r''' <PlatformToolset>Windows7.1SDK</PlatformToolset>''' '\n'
pgf = r''' </PropertyGroup>''' '\n'

def find_lines(l):
i = i0 = i1 = i2 = 0
while i < len(l):
if l[i].strip() == mkr.strip():
i0 = i + 1
if (l[i].strip() == pg1.strip() and l[i + 1].strip() == pgc.strip() and
l[i + 2].strip() == pgt.strip() and l[i + 3].strip() == pgf.strip()):
i1 = i
if (l[i].strip() == pg2.strip() and l[i + 1].strip() == pgc.strip() and
l[i + 2].strip() == pgt.strip() and l[i + 3].strip() == pgf.strip()):
i2 = i
i = i + 1
return (i0, i1, i2)

def add_it(fn):
with open(fn, 'r') as f:
l = f.readlines()
t = find_lines(l)
if t[0] and not t[1] and not t[2]:
print("Adding Express: ", fn)
l[t[0] : t[0]] = [pg1, pgc, pgt, pgf, pg2, pgc, pgt, pgf]
with open(fn, 'w') as f:
f.writelines(l)

def remove_it(fn):
with open(fn, 'r') as f:
l = f.readlines()
t = find_lines(l)
if t[1] and t[2]:
print("Removing Express: ", fn)
l[t[2] : t[2] + 4] = []
l[t[1] : t[1] + 4] = []
with open(fn, 'w') as f:
f.writelines(l)

if not os.getcwd().endswith("build.vc10"):
print("This script must be run in the 'build.vc10' directory")
else:
for root, dirs, files in os.walk("./") :
for file in files :
if not (root.endswith("_p0") or root.endswith("_p3") or root.endswith("_p4")):
if file.endswith(".vcxproj") :
t = os.path.join(root, file)
add_it(t) if express else remove_it(t)
# Convert project files between Visual Studio 2010 and
# Visual C++ 2010 Express (use Python 2.6 or later).
#
# Copyright 2010, Dr B R Gladman

from __future__ import print_function

import os
import shutil
import string
import fileinput, sys

express = True

mkr = r''' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />''' + '\n'
pg1 = r''' <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">''' '\n'
pg2 = r''' <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">''' '\n'
pgc = r''' <ConfigurationType>Application</ConfigurationType>''' '\n'
pgt = r''' <PlatformToolset>Windows7.1SDK</PlatformToolset>''' '\n'
pgf = r''' </PropertyGroup>''' '\n'

def find_lines(l):
i = i0 = i1 = i2 = 0
while i < len(l):
if l[i].strip() == mkr.strip():
i0 = i + 1
if (l[i].strip() == pg1.strip() and l[i + 1].strip() == pgc.strip() and
l[i + 2].strip() == pgt.strip() and l[i + 3].strip() == pgf.strip()):
i1 = i
if (l[i].strip() == pg2.strip() and l[i + 1].strip() == pgc.strip() and
l[i + 2].strip() == pgt.strip() and l[i + 3].strip() == pgf.strip()):
i2 = i
i = i + 1
return (i0, i1, i2)

def add_it(fn):
with open(fn, 'r') as f:
l = f.readlines()
t = find_lines(l)
if t[0] and not t[1] and not t[2]:
print("Adding Express: ", fn)
l[t[0] : t[0]] = [pg1, pgc, pgt, pgf, pg2, pgc, pgt, pgf]
with open(fn, 'w') as f:
f.writelines(l)

def remove_it(fn):
with open(fn, 'r') as f:
l = f.readlines()
t = find_lines(l)
if t[1] and t[2]:
print("Removing Express: ", fn)
l[t[2] : t[2] + 4] = []
l[t[1] : t[1] + 4] = []
with open(fn, 'w') as f:
f.writelines(l)

if not os.getcwd().endswith("build.vc10"):
print("This script must be run in the 'build.vc10' directory")
else:
for root, dirs, files in os.walk("./") :
for file in files :
if not (root.endswith("_p0") or root.endswith("_p3") or root.endswith("_p4")):
if file.endswith(".vcxproj") :
t = os.path.join(root, file)
add_it(t) if express else remove_it(t)
Loading

0 comments on commit f608007

Please sign in to comment.