forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.appveyor.yml
138 lines (109 loc) · 5.13 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: '{branch}-{build}'
build:
verbosity: minimal
environment:
matrix:
- BUILD: 'Release'
CONFIG: installer
ShadowBuildDir: C:\projects\qgroundcontrol\build_windows_install
QtBinPath: C:\Qt\5.9\msvc2015\bin
VisualStudio: "Microsoft Visual Studio 14.0"
install:
- git submodule update --init --recursive
- call "%ProgramFiles(x86)%\%VISUALSTUDIO%\VC\vcvarsall.bat" x86
- mkdir %LOCALAPPDATA%\QtProject && copy test\qtlogging.ini %LOCALAPPDATA%\QtProject\
- ps: |
# Set Path (Add Visual Studio and Qt)
$Env:Path = "C:\Qt\Tools\QtCreator\bin;${Env:QtBinPath};${Env:Path}"
# Set environment
function global:Print-Log { Write-Host "INFO: $args" -ForegroundColor Green }
$Downloader = New-Object Net.WebClient
$ToolsPath = "c:\DevTools"
$DownloadsPath = "c:\Downloads"
$VStudioPath = "${Env:ProgramFiles(x86)}\${Env:VisualStudio}\VC"
New-Item -ItemType directory -Path "${ToolsPath}" | out-null
New-Item -ItemType directory -Path "${DownloadsPath}" | out-null
$GStreamerCloudUrl = "https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies"
# Download and install GStreamer
Print-Log "- Installing GStreamer..."
$GStreamerMsiName = "gstreamer-1.0-x86-1.5.2.msi"
$msiPath = "$($env:USERPROFILE)\${GStreamerMsiName}"
Print-Log "+- Downloading GStreamer..."
$Downloader.DownloadFile("${GStreamerCloudUrl}/${GStreamerMsiName}", ${msiPath})
Print-Log "+- Installing GStreamer..."
cmd /c start /wait msiexec /package ${msiPath} /passive ADDLOCAL=ALL
Print-Log "- Installed`n"
# Download and install GStreamer dev
Print-Log "- Installing GStreamer dev..."
$GStreamerDevMsiName = "gstreamer-1.0-devel-x86-1.5.2.msi"
$msiPath = "$($env:USERPROFILE)\${GStreamerDevMsiName}"
Print-Log "+- Downloading GStreamer dev..."
$Downloader.DownloadFile("${GStreamerCloudUrl}/${GStreamerDevMsiName}", ${msiPath})
Print-Log "+- Installing GStreamer dev..."
cmd /c start /wait msiexec /package ${msiPath} /passive ADDLOCAL=ALL
Print-Log "- Installed`n"
# Download and install 7z
Print-Log "- Installing 7z"
$SevenZipUrl = "http://www.7-zip.org/a/7z1514-x64.exe"
$SevenZipInstallerDest = "${DownloadsPath}\7zip_installer.exe"
Print-Log "+- Downloading 7z..."
$Downloader.DownloadFile(${SevenZipUrl}, ${SevenZipInstallerDest})
Print-Log "+- Installing 7z..."
& "${SevenZipInstallerDest}" /S /D="${ToolsPath}\7zip_tool"
Print-Log "- Installed`n"
# Download and extract libusb
Print-Log "- Fetching libusb dev..."
$LibusbVersion = "1.0.21"
$LibusbUrl = "http://github.com/libusb/libusb/releases/download/v${LibusbVersion}"
$LibusbPkgName = "libusb-${LibusbVersion}.7z"
$LibusbPath = "C:\libusb"
Print-Log "+- Downloading..."
$Downloader.Downloadfile("${LibusbUrl}/${LibusbPkgName}", "${DownloadsPath}\${LibusbPkgName}")
New-Item -ItemType directory -Path "${LibusbPath}"
Write-Host "+- Extracting..."
& "${ToolsPath}\7zip_tool\7z" x -y "${DownloadsPath}\${LibusbPkgName}" -o"${LibusbPath}"
Print-Log "- Fetched`n"
# Download and extract liblzma
Print-Log "-Fetching liblzma dev..."
$LiblzmaPkgName = "xz-5.2.3-windows.zip"
$LiblzmaUrl = "https://tukaani.org/xz/$LiblzmaPkgName"
$LiblzmaDestPath = "C:\liblzma"
$LiblzmaPkgPath = "${DownloadsPath}\${LiblzmaPkgName}"
Print-Log "+- Downloading liblzma zip archive..."
$Downloader.Downloadfile(${LiblzmaUrl}, ${LiblzmaPkgPath})
Print-Log "+- Downloaded."
Print-Log "+- Extracting liblzma archive..."
New-Item -ItemType directory -Path "${LiblzmaDestPath}" | out-null
Expand-Archive "${LiblzmaPkgPath}" -DestinationPath "${LiblzmaDestPath}"
Print-Log "+- Extracted."
Print-Log "+- Create liblzma.lib from liblzma.def"
Set-Location "${LiblzmaDestPath}\doc"
& "${VStudioPath}\bin\lib.exe" "/def:liblzma.def" "/out:liblzma.lib" "/machine:ix86"
Copy-Item liblzma.lib -Destination ..\bin_i686\liblzma.lib
Print-Log "+- Created liblzma.lib"
Print-Log "- All Done. liblzma fetched.`n"
build_script:
# Get logical cores count
- ps: |
$Env:Cores = Get-WmiObject -class Win32_Processor | `
Select-Object -ExpandProperty NumberOfLogicalProcessors
Print-Log "Available threads count: ${Env:Cores}"
# Generate makefile
- mkdir "%SHADOWBUILDDIR%"
- cd "%SHADOWBUILDDIR%"
- qmake -r "%APPVEYOR_BUILD_FOLDER%\qgroundcontrol.pro" CONFIG-=debug_and_release CONFIG+=%CONFIG%
# Build
- jom -j%CORES%
# Copy QGC Installer
- ps: |
if (${Env:Config} -eq "installer") {
Copy-Item "${Env:ShadowBuildDir}\release\QGroundControl-installer.exe" `
-Destination "${Env:Appveyor_build_folder}\QGroundControl-installer.exe"
}
Set-Location ${Env:Appveyor_build_folder}
.\deploy\lowercaseify_symbolstore.ps1
test_script:
- if "%CONFIG%" EQU "debug" ( %SHADOW_BUILD_DIR%\debug\qgroundcontrol --unittest )
artifacts:
- path: QGroundControl-installer.exe
name: qgcinstaller