steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
  displayName: Setup build environment
- script: |
    conda config --set always_yes yes --set changeps1 no
    conda info -a
    conda create --name rdkit_build $(compiler) cmake ^
        boost-cpp=$(boost_version) boost=$(boost_version) ^
        py-boost=$(boost_version) libboost=$(boost_version) ^
        numpy matplotlib cairo pillow eigen pandas
  displayName: Install dependencies
- script: |
    set Boost_ROOT=
    mkdir build && cd build
    call activate rdkit_build
    cmake .. ^
    -G "Visual Studio 15 2017 Win64" ^
    -DCMAKE_BUILD_TYPE=Release ^
    -DRDK_INSTALL_INTREE=ON ^
    -DRDK_INSTALL_STATIC_LIBS=OFF ^
    -DRDK_BUILD_CPP_TESTS=ON ^
    -DRDK_BUILD_PYTHON_WRAPPERS=ON ^
    -DRDK_USE_BOOST_REGEX=ON ^
    -DRDK_BUILD_COORDGEN_SUPPORT=ON ^
    -DRDK_OPTIMIZE_NATIVE=ON ^
    -DRDK_BUILD_TEST_GZIP=ON ^
    -DRDK_BUILD_FREESASA_SUPPORT=OFF ^
    -DRDK_BUILD_AVALON_SUPPORT=ON ^
    -DRDK_BUILD_INCHI_SUPPORT=ON ^
    -DRDK_BUILD_THREADSAFE_SSS=ON ^
    -DRDK_BUILD_SWIG_WRAPPERS=OFF ^
    -DRDK_SWIG_STATIC=OFF ^
    -DRDK_TEST_MULTITHREADED=ON ^
    -DRDK_BOOST_PYTHON3_NAME=$(python_name) ^
    -DCMAKE_INCLUDE_PATH=%CONDA_PREFIX%/Library/include ^
    -DCMAKE_LIBRARY_PATH="%CONDA_PREFIX%/Library/lib
  displayName: Configure build (Run CMake)
- script: |
    call activate rdkit_build
    cd build
    cmake --build . --config Release --target install -j $(number_of_cores)
  displayName: Build
- script: |
    call activate rdkit_build
    set RDBASE=%cd%
    set PYTHONPATH=%RDBASE%;%PYTHONPATH%
    set PATH=%RDBASE%\lib;%PATH%
    cd build
    ctest -j $(number_of_cores) --output-on-failure -T Test
  displayName: Run tests
- task: PublishTestResults@2
  inputs:
    testResultsFormat: 'CTest'
    testResultsFiles: 'build/Testing/*/Test.xml'
    testRunTitle: $(system.phasedisplayname)  CTest Test Run
