Skip to content

Commit

Permalink
Add swig.rule
Browse files Browse the repository at this point in the history
  • Loading branch information
rhcad committed Nov 8, 2011
1 parent 9512eaf commit f19f8ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
17 changes: 17 additions & 0 deletions projects/msvc/vcproj/swig.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="Swig Convertor"
>
<Rules>
<CustomBuildRule
Name="swig -c++"
DisplayName="swig generating"
CommandLine="swig.exe -c++ -python $(InputPath) -outdir $(IntDir)"
Outputs="$(IntDir)\$(InputName)._swig"
FileExtensions="*.i"
>
<Properties>
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>
14 changes: 6 additions & 8 deletions tools/makeplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def xlat(match):
return rx.sub(xlat, text)

def copyfiles(srcdir, destdir, pairs, callback=None):
if srcdir.find(".svn") > 0 or srcdir.find(".user") > 0:
if srcdir.find(".svn") > 0:
return
if not os.path.exists(destdir):
os.makedirs(destdir)
Expand Down Expand Up @@ -71,19 +71,17 @@ def matchfile(filename, pairs):
copyfiles(basepath, destdir, pairs, matchfile)

def matchproj(filename, pairs):
if filename.find(".user") > 0: return False
for key in pairs.keys():
if filename.startswith(key):
return True
if filename.startswith(key): return True
return False
projects = os.path.abspath('../projects/msvc/vcproj')
copyfiles(projects, projects, pairs, matchproj)

if __name__=="__main__":
def inputparam(index, prompt, the default=''):
if len(sys.argv) > index:
ret = sys.argv[index]
else:
ret = raw_input(prompt)
def inputparam(index, prompt, default=''):
if len(sys.argv) > index: ret = sys.argv[index]
else: ret = raw_input(prompt)
if ret == '': ret = default
return ret

Expand Down

0 comments on commit f19f8ba

Please sign in to comment.