forked from Yadoms/yadoms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
111 lines (96 loc) · 5.79 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
# version format
version: 1.0.{build}
# Build worker image (VM template)
image: Visual Studio 2017
#---------------------------------#
# build configuration #
#---------------------------------#
# build platform, i.e. x86, x64, Any CPU. This setting is optional.
platform: Win32
# build Configuration, i.e. Debug, Release, etc.
configuration: Debug
# Add pre-compiled dependencies in cache
cache:
- extra_libs\boost_1_65_1 -> '.appveyor.yml'
- extra_libs\poco-1.8.1-all -> '.appveyor.yml'
- extra_libs\openssl-1.1.0g -> '.appveyor.yml'
- extra_libs\protobuf-3.4.1 -> '.appveyor.yml'
- extra_libs\swig-3.0.12 -> '.appveyor.yml'
#- extra_libs\pgsql-9.6.1 -> '.appveyor.yml'
- extra_libs\gammu-1.37.4 -> '.appveyor.yml'
# scripts that run after cloning repository
install:
# Remove not wanted PostgreSQL pre-installed versions from the Appveyor VM
- ps: echo "Remove not wanted PostgreSQL pre-installed versions from the Appveyor VM..."
- ps: |
$uninstall64 = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "PostgreSQL" } | select UninstallString
echo $uninstall64
foreach ( $uninstallString in $uninstall64.UninstallString ) {
if (Test-Path "$uninstallString") {
echo "Uninstall $uninstallString..."
start-process "$uninstallString" "--mode unattended" -Wait
} else {
$alternativeUninstallString = "$uninstallString" -replace "-postgis-", "-postgis-bundle-"
if (Test-Path "$alternativeUninstallString") {
echo "Uninstall $alternativeUninstallString..."
start-process "$alternativeUninstallString" "--mode unattended" -Wait
} else {
echo "Fail to uninstall $uninstallString"
}
}
}
# Download extra libs
- ps: echo "Download extra libs..."
- ps: if (!(Test-Path 'extra_libs')) { mkdir 'extra_libs' }
- ps: pushd extra_libs
- ps: if (!(Test-Path 'boost_1_65_1')) { Invoke-WebRequest http://yadoms.com/appveyor_build/boost_1_65_1-build.7z -OutFile boost.7z; 7z x boost.7z -bso0 }
- ps: if (!(Test-Path 'poco-1.8.1-all')) { Invoke-WebRequest http://yadoms.com/appveyor_build/poco-1.8.1-all-build.7z -OutFile poco.7z; 7z x poco.7z -bso0 }
- ps: if (!(Test-Path 'openssl-1.1.0g')) { Invoke-WebRequest http://yadoms.com/appveyor_build/openssl-1.1.0g-build.7z -OutFile openssl.7z; 7z x openssl.7z -bso0 }
- ps: if (!(Test-Path 'swig-3.0.12')) { Invoke-WebRequest http://yadoms.com/appveyor_build/swig-3.0.12-build.7z -OutFile swig.7z; 7z x swig.7z -bso0 }
- ps: if (!(Test-Path 'protobuf-3.4.1')) { Invoke-WebRequest http://yadoms.com/appveyor_build/protobuf-3.4.1-build.7z -OutFile protobuf.7z; 7z x protobuf.7z -bso0 }
- ps: if (!(Test-Path 'pgsql')) { Invoke-WebRequest http://yadoms.com/appveyor_build/postgresql-9.6.2-3-windows-binaries.zip -OutFile pgsql.zip; 7z x pgsql.zip -bso0 }
- ps: if (!(Test-Path 'gammu-1.37.4')) { Invoke-WebRequest http://yadoms.com/appveyor_build/gammu-1.37.4-build.7z -OutFile gammu.7z; 7z x gammu.7z -bso0 }
- ps: if (!(Test-Path 'cmake-3.10.2')) { Invoke-WebRequest http://yadoms.com/appveyor_build/cmake-3.10.2-build.7z -OutFile cmake.7z; 7z x cmake.7z -bso0 }
- ps: rm *.7z
- ps: popd
- ps: echo "[END] install"
# scripts to run before build
before_build:
# Yadoms configuration file
- ps: echo "Create Yadoms configuration file CMakeListsUserConfig.txt..."
- ps: $cd_for_cmake="$pwd".Replace("\", "/")
- ps: echo $cd_for_cmake
- ps: Set-Content 'sources/CMakeListsUserConfig.txt' ('set(ALTERNATIVE_CMAKE_ROOT "' + $cd_for_cmake + '/extra_libs/cmake-3.10.2-win32-x86")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(BOOST_ROOT "' + $cd_for_cmake + '/extra_libs/boost_1_65_1")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(POCO_ROOT "' + $cd_for_cmake + '/extra_libs/poco-1.8.1-all")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(OPENSSL_ROOT "' + $cd_for_cmake + '/extra_libs/openssl-1.1.0g")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(PROTOBUF_ROOT "' + $cd_for_cmake + '/extra_libs/protobuf-3.4.1")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(SWIG_ROOT "' + $cd_for_cmake + '/extra_libs/swig-3.0.12")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(PostgreSQL_ROOT "' + $cd_for_cmake + '/extra_libs/pgsql")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(PostgreSQL_INCLUDE_DIR "' + $cd_for_cmake + '/extra_libs/pgsql/include")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(PostgreSQL_LIBRARY_DIR "' + $cd_for_cmake + '/extra_libs/pgsql/lib")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(GAMMU_ROOT "' + $cd_for_cmake + '/extra_libs/gammu-1.37.4")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(PYTHON_ROOT "C:/Python27")')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(COTIRE_USE ON)')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(COTIRE_USE_UNITY ON)')
- ps: Add-Content 'sources/CMakeListsUserConfig.txt' ('set(PYTHON_USE_SOURCES OFF)')
- ps: cat 'sources/CMakeListsUserConfig.txt'
# Create solution
- ps: echo "Create solution..."
- cmd: cmake_windows.cmd
build:
parallel: false
project: projects/yadoms.sln # path to Visual Studio solution or project
# MSBuild verbosity level
verbosity: normal
notifications:
- provider: Email
subject: 'Build {{status}}: {{projectName}}, branch {{branch}}, {{buildVersion}}'
to:
- '{{commitAuthorEmail}}'
on_build_status_changed: true