1version: 1.0.{build}
2environment:
3  matrix:
4  - COMPILER: "gcc"
5    PLATFORM: "mingw64"
6  - COMPILER: "gcc"
7    PLATFORM: "mingw32"
8  - COMPILER: "visual"
9    CONFIGURATION: "Debug"
10    PLATFORM: "x64"
11  - COMPILER: "visual"
12    CONFIGURATION: "Debug"
13    PLATFORM: "Win32"
14  - COMPILER: "visual"
15    CONFIGURATION: "Release"
16    PLATFORM: "x64"
17  - COMPILER: "visual"
18    CONFIGURATION: "Release"
19    PLATFORM: "Win32"
20  - COMPILER: "gcc"
21    PLATFORM: "clang"
22
23install:
24  - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
25  - MKDIR bin
26  - if [%COMPILER%]==[gcc] SET PATH_ORIGINAL=%PATH%
27  - if [%COMPILER%]==[gcc] (
28      SET "PATH_MINGW32=c:\MinGW\bin;c:\MinGW\usr\bin" &&
29      SET "PATH_MINGW64=c:\msys64\mingw64\bin;c:\msys64\usr\bin" &&
30      COPY C:\MinGW\bin\mingw32-make.exe C:\MinGW\bin\make.exe &&
31      COPY C:\MinGW\bin\gcc.exe C:\MinGW\bin\cc.exe
32    ) else (
33      IF [%PLATFORM%]==[x64] (SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;")
34    )
35
36build_script:
37  - if [%PLATFORM%]==[mingw32] SET PATH=%PATH_MINGW32%;%PATH_ORIGINAL%
38  - if [%PLATFORM%]==[mingw64] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
39  - if [%PLATFORM%]==[clang] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
40  - ECHO *** &&
41      ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION% &&
42      ECHO ***
43  - if [%PLATFORM%]==[clang] (clang -v)
44  - if [%COMPILER%]==[gcc] (gcc -v)
45  - if [%COMPILER%]==[gcc] (
46      echo ----- &&
47      make -v &&
48      echo ----- &&
49      if not [%PLATFORM%]==[clang] (
50        make -C programs lz4 &&
51        make -C tests fullbench &&
52        make -C tests fuzzer &&
53        make -C lib lib V=1
54      ) ELSE (
55        make -C programs lz4 CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
56        make -C tests fullbench CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
57        make -C tests fuzzer CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
58        make -C lib lib CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion"
59      )
60    )
61  - if [%COMPILER%]==[gcc] if not [%PLATFORM%]==[clang] (
62      MKDIR bin\dll bin\static bin\example bin\include &&
63      COPY tests\fullbench.c bin\example\ &&
64      COPY lib\xxhash.c bin\example\ &&
65      COPY lib\xxhash.h bin\example\ &&
66      COPY lib\lz4.h bin\include\ &&
67      COPY lib\lz4hc.h bin\include\ &&
68      COPY lib\lz4frame.h bin\include\ &&
69      COPY lib\liblz4.a bin\static\liblz4_static.lib &&
70      COPY lib\dll\* bin\dll\ &&
71      COPY lib\dll\example\Makefile bin\example\ &&
72      COPY lib\dll\example\fullbench-dll.* bin\example\ &&
73      COPY lib\dll\example\README.md bin\ &&
74      COPY programs\lz4.exe bin\lz4.exe
75    )
76  - if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw64] (
77      7z.exe a -bb1 bin\lz4_x64.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
78      appveyor PushArtifact bin\lz4_x64.zip
79    )
80  - if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw32] (
81      7z.exe a -bb1 bin\lz4_x86.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
82      appveyor PushArtifact bin\lz4_x86.zip
83    )
84  - if [%COMPILER%]==[gcc] (COPY tests\*.exe programs\)
85  - if [%COMPILER%]==[visual] (
86      ECHO *** &&
87      ECHO *** Building Visual Studio 2010 %PLATFORM%\%CONFIGURATION% &&
88      ECHO *** &&
89      msbuild "build\VS2010\lz4.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /p:EnableWholeProgramOptimization=true /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
90      ECHO *** &&
91      ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% &&
92      ECHO *** &&
93      msbuild "build\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
94      ECHO *** &&
95      ECHO *** Building Visual Studio 2013 %PLATFORM%\%CONFIGURATION% &&
96      ECHO *** &&
97      msbuild "build\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
98      ECHO *** &&
99      ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% &&
100      ECHO *** &&
101      msbuild "build\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
102      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe programs\
103    )
104
105test_script:
106  - ECHO *** &&
107      ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION% &&
108      ECHO ***
109  - if not [%COMPILER%]==[unknown] (
110      CD programs &&
111      lz4 -h &&
112      lz4 -i1b lz4.exe &&
113      lz4 -i1b5 lz4.exe &&
114      lz4 -i1b10 lz4.exe &&
115      lz4 -i1b15 lz4.exe &&
116      echo ------- lz4 tested ------- &&
117      fullbench.exe -i1 fullbench.exe &&
118      echo trying to launch fuzzer.exe &&
119      fuzzer.exe -v -T30s
120    )
121
122artifacts:
123  - path: bin\lz4_x64.zip
124  - path: bin\lz4_x86.zip
125
126deploy:
127- provider: GitHub
128  artifact: bin\lz4_x64.zip
129  auth_token:
130    secure: w6UJaGie0qbZvffr/fqyhO/Vj8rMiQWnv9a8qm3gxfngdHDTMT42wYupqJpIExId
131  force_update: true
132  prerelease: true
133  on:
134    COMPILER: gcc
135    PLATFORM: "mingw64"
136    appveyor_repo_tag: true
137
138- provider: GitHub
139  artifact: bin\lz4_x86.zip
140  auth_token:
141    secure: w6UJaGie0qbZvffr/fqyhO/Vj8rMiQWnv9a8qm3gxfngdHDTMT42wYupqJpIExId
142  force_update: true
143  prerelease: true
144  on:
145    COMPILER: gcc
146    PLATFORM: "mingw32"
147    appveyor_repo_tag: true
148