Skip to content

Commit e6d0a57

Browse files
committed
Moving swig wrapper generation to before-build.bat
1 parent 550ae64 commit e6d0a57

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build: off
2222

2323

2424
test_script:
25-
- before_build.bat %APPVEYOR_BUILD_FOLDER%
25+
- before_build.bat
2626
- "%PYTHON%\\python.exe -m tox -v"
2727

2828
after_test:

before_build.bat

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@
66
:: Author: Michael E. Tryby
77
:: US EPA - ORD/NRMRL
88
::
9+
:: Requires:
10+
:: CMake
11+
:: Visual Studio 2015
12+
:: SWIG
13+
::
14+
:: Note:
15+
:: This script must be located at the root of the project folder
16+
: in order to work correctly.
17+
::
918

10-
set PROJECT_PATH=%~1
19+
20+
:: Determine project path and strip trailing \ from path
21+
set "PROJECT_PATH=%~dp0"
22+
IF %PROJECT_PATH:~-1%==\ set "PROJECT_PATH=%PROJECT_PATH:~0,-1%"
1123

1224
set TOOLKIT_PATH=\epanet_python\toolkit\epanet\toolkit
1325
set OUTPUT_PATH=\epanet_python\output\epanet\output
@@ -32,3 +44,14 @@ copy /Y ..\include\*.h %PROJECT_PATH%\%TOOLKIT_PATH%
3244
copy /Y .\bin\Release\epanet-output.dll %PROJECT_PATH%\%OUTPUT_PATH%
3345
copy /Y .\lib\Release\epanet-output.lib %PROJECT_PATH%\%OUTPUT_PATH%
3446
copy /Y ..\tools\epanet-output\include\*.h %PROJECT_PATH%\%OUTPUT_PATH%
47+
48+
49+
:: Generate swig wrappers
50+
cd %PROJECT_PATH%\%TOOLKIT_PATH%
51+
swig -python -py3 toolkit.i
52+
cd %PROJECT_PATH%\%OUTPUT_PATH%
53+
swig -python -py3 output.i
54+
55+
56+
:: Return to project root
57+
cd %PROJECT_PATH%

0 commit comments

Comments
 (0)