appveyor.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. version: '{build}'
  2. clone_folder: c:\projects\open62541
  3. clone_depth: 20
  4. environment:
  5. global:
  6. APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
  7. CYG_ARCH: x86
  8. CYG_ROOT: C:/cygwin
  9. CYG_SETUP_URL: http://cygwin.com/setup-x86.exe
  10. CYG_MIRROR: http://cygwin.mirror.constant.com
  11. CYG_CACHE: C:\cygwin\var\cache\setup
  12. CYG_BASH: C:/cygwin/bin/bash
  13. matrix:
  14. - CC_NAME: MinGW Makefiles
  15. CC_SHORTNAME: mingw
  16. MAKE: mingw32-make -j
  17. FORCE_CXX: OFF
  18. OUT_DIR_LIB: bin
  19. OUT_DIR_EXAMPLES: bin\examples
  20. - CC_NAME: Visual Studio 9 2008
  21. CC_SHORTNAME: vs2008
  22. MAKE: msbuild /m open62541.sln
  23. FORCE_CXX: ON
  24. OUT_DIR_LIB: bin\Debug
  25. OUT_DIR_EXAMPLES: bin\examples\Debug
  26. - CC_NAME: Visual Studio 12 2013
  27. CC_SHORTNAME: vs2013
  28. MAKE: msbuild /m open62541.sln
  29. FORCE_CXX: OFF
  30. OUT_DIR_LIB: bin\Debug
  31. OUT_DIR_EXAMPLES: bin\examples\Debug
  32. - CC_NAME: Visual Studio 12 2013 Win64
  33. CC_SHORTNAME: vs2013-x64
  34. MAKE: msbuild /m open62541.sln
  35. FORCE_CXX: OFF
  36. OUT_DIR_LIB: bin\Debug
  37. OUT_DIR_EXAMPLES: bin\examples\Debug
  38. cache:
  39. - '%CYG_CACHE%'
  40. - 'c:\miktex'
  41. #- 'c:\python27'
  42. init:
  43. - git config --global core.autocrlf input # Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
  44. # Install needed build dependencies
  45. install:
  46. - git submodule update --init --recursive
  47. - if not exist "%CYG_ROOT%" mkdir "%CYG_ROOT%"
  48. - ps: echo Installing Cygwin from $env:CYG_SETUP_URL to $env:CYG_ROOT/setup-x86.exe
  49. - appveyor DownloadFile %CYG_SETUP_URL% -FileName %CYG_ROOT%/setup-x86.exe
  50. - ps: echo Downloaded. Now ready to install.
  51. - cmd: '"%CYG_ROOT%/setup-x86.exe" --quiet-mode --no-shortcuts --only-site -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" --packages cmake,python'
  52. - cmd: '%CYG_BASH% -lc "cygcheck -dc cygwin"'
  53. # Install miktex to get pdflatex, if we don't get it from the cache
  54. - if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe appveyor DownloadFile http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable.exe
  55. - if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe 7z x miktex-portable.exe -oc:\miktex >NUL
  56. # Remove some big files to reduce size to be cached
  57. - if exist c:\miktex\texmfs\install\doc rd /s /q c:\miktex\texmfs\install\doc
  58. - if exist c:\miktex\texmfs\install\internal rd /s /q c:\miktex\texmfs\install\internal
  59. - if exist c:\miktex\texmfs\install\miktex\bin\biber.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\biber.exe
  60. - if exist c:\miktex\texmfs\install\miktex\bin\icudt58.dll rd /s /q c:\miktex\texmfs\install\miktex\bin\icudt58.dll
  61. - if exist c:\miktex\texmfs\install\miktex\bin\a5toa4.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\a5toa4.exe
  62. - pip install --user sphinx sphinx_rtd_theme
  63. before_build:
  64. # use MinGW64
  65. - set PATH=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
  66. # Workaround for CMake not wanting sh.exe on PATH for MinGW
  67. - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  68. # Miktex
  69. - set "PATH=%PATH%;c:\miktex\texmfs\install\miktex\bin;%APPDATA%\Python\Scripts"
  70. # autoinstall latex packages (0=no, 1=autoinstall, 2=ask)
  71. # this adds this to the registry!
  72. - initexmf --set-config-value [MPM]AutoInstall=1
  73. - initexmf --update-fndb
  74. build_script:
  75. # log is loaded from cache, so we strip it here
  76. - rd /s /q c:\miktex\texmfs\data\miktex\log
  77. - cd c:\projects\open62541
  78. # Collect files for .zip packing
  79. - md pack
  80. - copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" pack\
  81. - copy "%APPVEYOR_BUILD_FOLDER%\AUTHORS" pack\
  82. - copy "%APPVEYOR_BUILD_FOLDER%\README.md" pack\
  83. # now start build
  84. - md build
  85. - cd build
  86. - echo. && echo ##### Building Documentation on %CC_NAME% ##### && echo.
  87. - cmake -DMIKTEX_BINARY_PATH=c:\miktex\texmfs\install\miktex\bin -DCMAKE_BUILD_TYPE=Release -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DUA_BUILD_EXAMPLES:BOOL=OFF -G"%CC_NAME%" ..
  88. - cmake --build . --target doc_latex & cmake --build . --target doc_pdf
  89. - move "%APPVEYOR_BUILD_FOLDER%\build\doc_latex\open62541.pdf" %APPVEYOR_BUILD_FOLDER%\pack\
  90. - cd ..
  91. - rd /s /q build
  92. - md build
  93. - cd build
  94. - echo. && echo ##### Testing %CC_NAME% ##### && echo.
  95. - cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
  96. - '%MAKE%'
  97. - cd ..
  98. - rd /s /q build
  99. - md build
  100. - cd build
  101. - echo. && echo ##### Testing %CC_NAME% with amalgamation ##### && echo.
  102. - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=OFF -G"%CC_NAME%" ..
  103. - '%MAKE%'
  104. - md %APPVEYOR_BUILD_FOLDER%\pack_tmp
  105. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.c" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  106. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.h" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  107. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\server.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  108. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\client.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  109. - if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.a" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  110. - if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.lib" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  111. - cd ..
  112. - 7z a -tzip open62541-%CC_SHORTNAME%-static.zip "%APPVEYOR_BUILD_FOLDER%\pack\*" "%APPVEYOR_BUILD_FOLDER%\pack_tmp\*"
  113. - rd /s /q pack_tmp
  114. - rd /s /q build
  115. - md build
  116. - cd build
  117. - echo. && echo ##### Testing %CC_NAME% with amalgamation and .dll ##### && echo.
  118. - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=ON -G"%CC_NAME%" ..
  119. - '%MAKE%'
  120. - md %APPVEYOR_BUILD_FOLDER%\pack_tmp
  121. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.c" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  122. - move "%APPVEYOR_BUILD_FOLDER%\build\open62541.h" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  123. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\server.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  124. - move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\client.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  125. - if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.dll" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  126. - if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.dll.a" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  127. - if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.dll" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  128. - if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.pdb" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
  129. - cd ..
  130. - 7z a -tzip open62541-%CC_SHORTNAME%-dynamic.zip "%APPVEYOR_BUILD_FOLDER%\pack\*" "%APPVEYOR_BUILD_FOLDER%\pack_tmp\*"
  131. # do not cache log
  132. - rd /s /q c:\miktex\texmfs\data\miktex\log
  133. after_build:
  134. - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-static.zip
  135. - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip