<commit_before># 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'))
<commit_msg>[appveyor] Workaround for MSVC Update 3 bug<commit_after># 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: Previous 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'))

{'fraction_non_alphanumeric': 0.10804575603191387, 'fraction_numerical': 0.018552340670960298, 'mean_word_length': 4.0309477756286265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '47502', 'n_tokens_mistral': 4016, 'n_tokens_neox': 3734, 'n_words': 905}