1version: 1.0.{build}
2environment:
3  fast_finish: true
4install:
5- ps: >-
6    # Make sure building libsweep works
7
8    pushd libsweep
9
10    mkdir build
11
12    cd build
13
14    cmake .. -G "Visual Studio 14 2015"
15
16    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
17
18    cmake --build . --config Release
19
20    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
21
22
23    # Then build and install dummy library to test bindings against without device attached
24
25    cmake ..  -DDUMMY=On -G "Visual Studio 14 2015"
26
27    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
28
29    cmake --build . --config Release
30
31    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
32
33    cmake --build . --target install --config Release
34
35    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
36
37    popd
38
39
40    # Add the installation dir to the environment variable PATH
41
42    $env:path += ";C:\Program Files (x86)\sweep\lib;C:\Program Files (x86)\sweep\include;C:\Program Files (x86)\sweep\include\sweep"
43
44    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
45
46
47    # Install node bindings
48
49    pushd sweepjs
50
51    npm install
52
53    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
54
55    popd
56
57
58
59    # Install python bindings
60
61    pushd sweeppy
62
63    python setup.py install
64
65    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
66
67    popd
68build_script:
69- ps: >-
70    # Test libsweep examples against the dummy library
71
72    pushd libsweep/examples
73
74    mkdir build
75
76    cd build
77
78    cmake .. -G "Visual Studio 14 2015"
79
80    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
81
82    cmake --build . --config Release
83
84    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
85
86    cd Release
87
88    ./example-c PLACEHOLDER
89
90    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
91
92    ./example-c++ PLACEHOLDER
93
94    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
95
96    popd
97
98
99    # Test SweepPy bindings against the dummy library
100
101    pushd sweeppy
102
103    python -m sweeppy COM0
104
105    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
106
107    popd
108
109
110    # Test SweepJs bindings against the dummy library
111
112    pushd sweepjs
113
114    node index.js COM0
115
116    if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode)  }
117
118    popd