From e35d6bf39259e4327d881ba2997a0ce71605ad3b Mon Sep 17 00:00:00 2001 From: AeroXuk Date: Wed, 29 Nov 2017 22:53:44 +0000 Subject: [PATCH] Setup AppVeyor Build Matrix for 32 & 64 bit builds. --- .appveyor.yml | 80 ++++++++++++++++++++++++++++++++++----------------- win_build.bat | 24 ---------------- 2 files changed, 54 insertions(+), 50 deletions(-) delete mode 100644 win_build.bat diff --git a/.appveyor.yml b/.appveyor.yml index eac7a36c..d2261e5f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,26 +1,54 @@ -version: 1.0.{build} - -image: Visual Studio 2015 -platform: x64 - -environment: - matrix: - - COMPILER: msys2 - PLATFORM: x64 - MSYS2_ARCH: x86_64 - MSYS2_DIR: msys64 - MSYSTEM: MINGW64 - BIT: 64 - -build_script: - - '%APPVEYOR_BUILD_FOLDER%\win_build.bat' - -test_script: - - '%APPVEYOR_BUILD_FOLDER%\test\test_libpostal.exe' - -after_build: - - 7z a libpostal.zip %APPVEYOR_BUILD_FOLDER%\libpostal.dll %APPVEYOR_BUILD_FOLDER%\libpostal.def %APPVEYOR_BUILD_FOLDER%\libpostal.exp %APPVEYOR_BUILD_FOLDER%\libpostal.lib %APPVEYOR_BUILD_FOLDER%\src\libpostal.h - -artifacts: - - path: libpostal.zip - name: libpostal +version: 1.0.{build} +image: Visual Studio 2015 + +environment: + matrix: + - COMPILER: msys2 + PLATFORM: x86 + MSYS2_ARCH: x86 + MSYS2_DIR: msys64 + MSYSTEM: MINGW32 + BIT: 32 + - COMPILER: msys2 + PLATFORM: x64 + MSYS2_ARCH: x86_64 + MSYS2_DIR: msys64 + MSYSTEM: MINGW64 + BIT: 64 + +build_script: +- cmd: cd %APPVEYOR_BUILD_FOLDER% +- ps: | + Write-Host "Compiler: $Env:COMPILER" + Write-Host "Architecture: $Env:MSYS2_ARCH" + Write-Host "Platform: $Env:PLATFORM" + Write-Host "MSYS2 Directory: $Env:MSYS2_DIR" + Write-Host "MSYS2 System: $Env:MSYSTEM" + + if ($Env:COMPILER -eq "msys2") { + $Env:Path = "C:\$Env:MSYS2_DIR\$Env:MSYSTEM\bin;C:\$Env:MSYS2_DIR\usr\bin;$Env:Path" + $Env:WDIR = $Env:APPVEYOR_BUILD_FOLDER -replace "\\", "/" + bash -lc "cd $Env:WDIR && cp -rf ./windows/* ./" + bash -lc "cd $Env:WDIR && ./bootstrap.sh" + bash -lc "cd $Env:WDIR && ./configure --datadir=/c" + bash -lc "cd $Env:WDIR && make" + bash -lc "cd $Env:WDIR && make install" + bash -lc "cd $Env:WDIR && cp src/.libs/libpostal-*.dll libpostal.dll" + & 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\lib.exe' /def:libpostal.def /out:libpostal.lib /machine:$Env:PLATFORM + 7z a libpostal.zip $Env:APPVEYOR_BUILD_FOLDER\libpostal.dll $Env:APPVEYOR_BUILD_FOLDER\libpostal.def $Env:APPVEYOR_BUILD_FOLDER\libpostal.exp $Env:APPVEYOR_BUILD_FOLDER\libpostal.lib $Env:APPVEYOR_BUILD_FOLDER\src\libpostal.h + if ($Env:BIT -eq "32") { + $Paths = @( + (Join-Path $Env:APPVEYOR_BUILD_FOLDER "src"), + (Join-Path $Env:APPVEYOR_BUILD_FOLDER "src\.libs"), + (Join-Path $Env:APPVEYOR_BUILD_FOLDER "test"), + (Join-Path $Env:APPVEYOR_BUILD_FOLDER "test\.libs")) + Get-ChildItem -Path $Paths | ?{ $_.Name -Match '\.(exe|dll)$' } | % { & 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\editbin.exe' /NOLOGO /LARGEADDRESSAWARE $_.FullName } + } + } + +test_script: +- '%APPVEYOR_BUILD_FOLDER%\test\test_libpostal.exe' + +artifacts: +- path: libpostal.zip + name: libpostal diff --git a/win_build.bat b/win_build.bat deleted file mode 100644 index 8b0db748..00000000 --- a/win_build.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off - -cd %APPVEYOR_BUILD_FOLDER% - -echo Compiler: %COMPILER% -echo Architecture: %MSYS2_ARCH% -echo Platform: %PLATFORM% -echo MSYS2 directory: %MSYS2_DIR% -echo MSYS2 system: %MSYSTEM% -echo Configuration: %CONFIGURATION% -echo Bits: %BIT% - -IF %COMPILER%==msys2 ( - @echo on - SET "PATH=C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%" - - bash -lc "cd $APPVEYOR_BUILD_FOLDER && cp -rf windows/* ./" - bash -lc "cd $APPVEYOR_BUILD_FOLDER && ./bootstrap.sh" - bash -lc "cd $APPVEYOR_BUILD_FOLDER && ./configure --datadir=/c" - bash -lc "cd $APPVEYOR_BUILD_FOLDER && make" - bash -lc "cd $APPVEYOR_BUILD_FOLDER && make install" - bash -lc "cd $APPVEYOR_BUILD_FOLDER && cp src/.libs/libpostal-*.dll libpostal.dll" - "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\lib.exe" /def:libpostal.def /out:libpostal.lib /machine:x64 -)