forked from opensim-org/opensim-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
117 lines (96 loc) · 5.03 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Windows testing using Visual Studio.
# Syntax for this file:
# http://www.appveyor.com/docs/appveyor-yml
# See http://msdn.microsoft.com/en-us/library/ms164311.aspx for
# command-line options to MSBuild.
# Speeding up a Visual Studio build.
# http://blogs.msdn.com/b/vcblog/archive/2011/01/05/damn-my-vc-project-is-building-slower-in-vs2010-what-do-i-do-now-a-step-by-step-guide.aspx
# To treat warnings as errors: -DCMAKE_CXX_FLAGS="/WX /EHsc"
# "/EHsc" is to "unwind semantics" to get error messages when using "/WX" (C4530).
# However, this was causing some weird behavior. Not treating warnings
# as errors for now.
#
shallow_clone: true
os: Visual Studio 2015
platform: x64
environment:
matrix:
- CMAKE_GENERATOR: "Visual Studio 14 2015"
NUGET_PACKAGE_ID_SUFFIX: "-x86"
JAVA_DIR: "C:\\Program Files (x86)\\Java\\jdk1.8.0"
PYTHON_DIR: "C:\\Python27"
- CMAKE_GENERATOR: "Visual Studio 14 2015 Win64"
NUGET_PACKAGE_ID_SUFFIX: "-x64"
JAVA_DIR: "C:\\Program Files\\Java\\jdk1.8.0"
PYTHON_DIR: "C:\\Python27-x64"
init:
# Note: python 2.7 32bit is already on the path. We want v2.7 64bit,
# so we must add v2.7 64bit earlier on the PATH so that CMake finds it when
# configuring.
# The Scripts directory is for putting nosetests on the path.
# http://www.appveyor.com/docs/installed-software
- SET PATH=%PYTHON_DIR%;%PATH%
- SET OPENSIM_SOURCE_DIR=C:\projects\opensim-core
- SET OPENSIM_BUILD_DIR=C:\projects\opensim_build
- SET OPENSIM_INSTALL_DIR=C:\projects\opensim_install
- SET OPENSIM_DEPENDENCIES_SOURCE_DIR=%OPENSIM_SOURCE_DIR%\dependencies
- SET OPENSIM_DEPENDENCIES_BUILD_DIR=C:\projects\opensim_dependencies_build
- SET OPENSIM_DEPENDENCIES_INSTALL_DIR=C:\projects\opensim_dependencies_install
# The CMake variable JAVA_HOME tells CMake where to look for Java.
- SET JAVA_HOME=%JAVA_DIR%
- SET PATH=%JAVA_HOME%\bin;%PATH%
nuget:
account_feed: true
install:
## Use Chocolatey to install SWIG.
- choco install swig --version 3.0.6 --yes > $null
## Install python-nose for python testing.
- "%PYTHON_DIR%\\Scripts\\pip install nose"
## Simbody.
# Simbody's installation is pushed to our Appveyor NuGet account feed.
# Must use version 0.0.0, otherwise, nuget will use nuget.org, where
# chrisdembia once uploaded a simbody 3.5.0 nupkg.
# Output directory must match how Simbody was packaged, otherwise
# SimbodyConfig.cmake will have all the wrong paths.
- nuget install simbody%NUGET_PACKAGE_ID_SUFFIX% -Version 0.0.0 -ExcludeVersion -OutputDirectory C:\
build_script:
## Superbuild dependencies.
- mkdir %OPENSIM_DEPENDENCIES_BUILD_DIR%
- cd %OPENSIM_DEPENDENCIES_BUILD_DIR%
- cmake %OPENSIM_DEPENDENCIES_SOURCE_DIR% -G"%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%OPENSIM_DEPENDENCIES_INSTALL_DIR% -DSUPERBUILD_simbody=OFF
- cmake --build . --config Release -- /maxcpucount:4 /verbosity:quiet
- mkdir %OPENSIM_BUILD_DIR%
## Configure and build OpenSim.
# Must create separate build dir, otherwise can't read test files
# for some reason.
- cd %OPENSIM_BUILD_DIR%
# Configure. # TODO -DBUILD_SIMM_TRANSLATOR=ON
- cmake %OPENSIM_SOURCE_DIR% -G"%CMAKE_GENERATOR%" -DSIMBODY_HOME=C:\simbody%NUGET_PACKAGE_ID_SUFFIX% -DOPENSIM_DEPENDENCIES_DIR=%OPENSIM_DEPENDENCIES_INSTALL_DIR% -DCMAKE_INSTALL_PREFIX=%OPENSIM_INSTALL_DIR% -DBUILD_JAVA_WRAPPING=ON -DBUILD_PYTHON_WRAPPING=ON -DWITH_BTK:BOOL=ON
# Build.
# Hack to avoid error MSB3191: Unable to create directory "C:\projects\opensim_build\Release\"
# which may result from parallel jobs trying to create this directory.
- cmake --build . --target SimbodyFiles --config Release
- cmake --build . --config Release -- /maxcpucount:4 /verbosity:quiet #/p:TreatWarningsAsErrors="true"
test_script:
## Run tests.
- ctest --parallel 4 --build-config Release --output-on-failure #--exclude-regex "%OPENSIM_TESTS_TO_EXCLUDE%"
## Ensure we have no trouble installing.
- cmake --build . --target install --config Release -- /maxcpucount:4 /verbosity:quiet
## Test python wrapping.
- set PATH=%OPENSIM_INSTALL_DIR%\bin;%PATH%
# Move to the installed location of the python package.
- cd %OPENSIM_INSTALL_DIR%\sdk\python
# Run python tests.
- "%PYTHON_DIR%\\Scripts\\nosetests -v" #--exclude=%PYTHON_TESTS_TO_EXCLUDE%"
after_test:
- ## On master branch, create NuGet package for OpenSim.
- # Detect if we are on the master branch.
- IF %APPVEYOR_REPO_BRANCH% EQU master IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER SET DISTR=TRUE
- # Create and upload NuGet package.
- IF DEFINED DISTR cd %APPVEYOR_BUILD_FOLDER%
- IF DEFINED DISTR nuget pack .opensim-core.nuspec -Properties "packageIdSuffix=%NUGET_PACKAGE_ID_SUFFIX%" -BasePath %OPENSIM_INSTALL_DIR%
- IF DEFINED DISTR appveyor PushArtifact opensim-core%NUGET_PACKAGE_ID_SUFFIX%.0.0.0.nupkg
# The following, if uncommented, should allow you to remote-desktop into
# the Appveyor build machine.
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))