Skip to content

Commit

Permalink
appveyor: Build VC and msys2 binaries at the same time
Browse files Browse the repository at this point in the history
Build VC and msys2 binaries at the same time, and also test the VC
binary using msys2. (Don't test msys2 binary for now.)
  • Loading branch information
k-takata committed Jun 9, 2016
1 parent 98cea65 commit 787f95a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -19,7 +19,7 @@ If you want to try the latest universal-ctags without building it yourself...

### Windows
- Go to https://ci.appveyor.com/project/masatake/ctags
- Click the ```compiler=msvc, ARCH=x64``` (or ```compiler=msvc, ARCH=x86```) build.
- Click the ```compiler=msvc_msys2, ARCH=x64, ...``` (or ```compiler=msvc_msys2, ARCH=x86, ...```) build.
- View the *Artifacts* tab and download ```ctags-XXXXXX-x64.zip``` (or ```ctags-XXXXXX-x86.zip```). (```XXXXXX``` is a version number or a commit ID.)
- Add the binary folder to your PATH.

Expand Down
12 changes: 7 additions & 5 deletions appveyor.yml
Expand Up @@ -4,15 +4,17 @@ environment:
matrix:
- compiler: msbuild
CONFIGURATION: Release
- compiler: msvc
- compiler: msvc_msys2
ARCH: x64
- compiler: msvc
ARCH: x86
- compiler: mingw
- compiler: msys2
MSYS2_ARCH: x86_64
MSYS2_DIR: msys64
MSYSTEM: MINGW64
- compiler: msvc_msys2
ARCH: x86
MSYS2_ARCH: x86
MSYS2_DIR: msys64
MSYSTEM: MINGW32
- compiler: mingw
- compiler: cygwin

build_script:
Expand Down
87 changes: 42 additions & 45 deletions win32/appveyor.bat
Expand Up @@ -12,7 +12,7 @@ if "%1"=="" (
set target=%1
)

for %%i in (msbuild msvc mingw msys2 cygwin) do if "%compiler%"=="%%i" goto %compiler%_%target%
for %%i in (msbuild msvc_msys2 mingw cygwin) do if "%compiler%"=="%%i" goto %compiler%_%target%

echo Unknown build target.
exit 1
Expand Down Expand Up @@ -43,9 +43,10 @@ goto :eof
goto :eof


:msvc_build
:msvc_msys2_build
:: ----------------------------------------------------------------------
:: Using VC12 (VC2013) with nmake, iconv enabled
:: Also build with msys2 and test the VC binary on msys2.
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %ARCH%

:: Build libiconv (MSVC port)
Expand All @@ -68,21 +69,54 @@ copy %ICONV_BUILD_DIR%\msvc10\iconv.dll %APPVEYOR_BUILD_FOLDER% > nul
cd %APPVEYOR_BUILD_FOLDER%
nmake -f mk_mvc.mak WITH_ICONV=yes ICONV_DIR=%ICONV_DIR%

@echo off
goto :eof
:: Check filetype (VC binaries)
c:\cygwin\bin\file ctags.exe
c:\cygwin\bin\file readtags.exe
:: Check if it works
.\ctags --version || exit 1

:msvc_test
@echo on
:: Check filetype
:: Backup VC binaries
mkdir vc
move *.exe vc > nul

:: Build with msys2
PATH C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%
set CHERE_INVOKING=yes
:: Install and update necessary packages
rem bash -lc "for i in {1..3}; do update-core && break || sleep 15; done"
rem bash -lc "for i in {1..3}; do pacman --noconfirm -Su mingw-w64-%MSYS2_ARCH%-{gcc,libiconv} automake autoconf make dos2unix && break || sleep 15; done"

bash -lc "./autogen.sh"
:: Patching configure.
:: Workaround for "./configure: line 557: 0: Bad file descriptor"
perl -i".bak" -pe "s/^test -n \".DJDIR\"/#$&/" configure
bash -lc "./configure --enable-iconv && make"

:: Check filetype (msys2 binaries)
c:\cygwin\bin\file ctags.exe
c:\cygwin\bin\file readtags.exe
:: Check if it works
.\ctags --version || exit 1

:: Backup msys2 binaries (Currently not used.)
mkdir msys2
move *.exe msys2 > nul

:: Restore VC binaries
copy vc\*.exe . /y > nul

@echo off
goto :eof

:msvc_msys2_test
@echo on
:: Run tests
bash -lc "make check APPVEYOR=1"

@echo off
goto :eof

:msvc_package
:msvc_msys2_package
if "%APPVEYOR_REPO_TAG_NAME%"=="" (
for /f %%i in ('git rev-parse --short HEAD') do set ver=%%i
) else (
Expand Down Expand Up @@ -118,43 +152,6 @@ goto :eof
goto :eof


:msys2_build
:: ----------------------------------------------------------------------
:: Using MSYS2, iconv enabled
@echo on
PATH C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%
set CHERE_INVOKING=yes
:: Install and update necessary packages
rem bash -lc "for i in {1..3}; do update-core && break || sleep 15; done"
rem bash -lc "for i in {1..3}; do pacman --noconfirm -Su mingw-w64-%MSYS2_ARCH%-{gcc,libiconv} automake autoconf make dos2unix && break || sleep 15; done"

bash -lc "./autogen.sh"
:: Patching configure.
:: Workaround for "./configure: line 557: 0: Bad file descriptor"
perl -i".bak" -pe "s/^test -n \".DJDIR\"/#$&/" configure
bash -lc "./configure --enable-iconv && make"

@echo off
goto :eof

:msys2_test
@echo on
:: Check filetype
c:\cygwin\bin\file ctags.exe
c:\cygwin\bin\file readtags.exe
:: Check if it works
.\ctags --version || exit 1
:: Run tests
bash -lc "make check APPVEYOR=1"

@echo off
goto :eof

:msys2_package
:: Do nothing.
goto :eof


:cygwin_build
:: ----------------------------------------------------------------------
:: Using Cygwin, iconv enabled
Expand Down

0 comments on commit 787f95a

Please sign in to comment.