Azure: Add ci script generator (#20)

thanks @nelsonjchen

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2019-05-24 11:00:40 +09:00
parent 3ee691be74
commit ec2031ffa9
16 changed files with 1063 additions and 134 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ __pycache__
.tox
.venv
_build
ci/*.matrix.gen.yml

View File

@@ -12,9 +12,7 @@ Another Qt installer(aqt)
.. |macos| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=macOS
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
.. |ubuntu3| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Ubuntu_1604_py3
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
.. |ubuntu2| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Ubuntu_1604_py2
.. |ubuntu3| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Linux
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
.. |windows| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Windows
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
@@ -26,8 +24,6 @@ Another Qt installer(aqt)
+-------------+-----------+
| Ubuntu | |ubuntu3| |
+-------------+-----------+
| Python2 | |ubuntu2| |
+-------------+-----------+
| Windows | |windows| |
+-------------+-----------+
@@ -126,7 +122,7 @@ For details see `Qt licensing`_ and `Licenses used in Qt5`_
History
-------
This program is originally shown in `Kaidan`_ project
This program is originally shown in `Kaidan`_ project as a name `qli-installer`.
A project `aqtinstall` extend the original to run with standard python features with Linux, Mac and Windows,
to be tested on CI platform, and to improve performance with a concurrent downloading.

View File

@@ -1,135 +1,335 @@
variables:
aqt_version: 0.3.1
qtversion: 5.12.1
pydepends: requests six flake8 wheel twine
# Generated by `generate_azure_pipelines_yml.py`
# Please edit template in `ci/`
jobs:
- job: Ubuntu_1604_py3
- job: Mac
pool:
vmImage: 'ubuntu-16.04'
vmImage: macOS-10.14
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
python -m pip install $(pydepends)
flake8 aqt bin
displayName: 'Run lint tests'
- script: |
sudo apt-get update
sudo apt-get -y install p7zip
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/setup.py
arguments: sdist bdist_wheel
workingDirectory: $(Build.SourcesDirectory)
displayName: build package
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
displayName: install package
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(qtversion) linux desktop
workingDirectory: $(Build.BinariesDirectory)
displayName: install qt
- script: |
$(Build.BinariesDirectory)/Qt$(qtversion)/$(qtversion)/gcc_64/bin/qmake $(Build.SourcesDirectory)/tests
make
- job: Ubuntu_1604_py2
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7'
architecture: 'x64'
- script: |
sudo apt-get update
sudo apt-get -y install p7zip
python -m pip install $(pydepends)
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/setup.py
arguments: sdist bdist_wheel
workingDirectory: $(Build.SourcesDirectory)
displayName: build package
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
displayName: install package
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(qtversion) linux desktop
workingDirectory: $(Build.BinariesDirectory)
displayName: install qt
- script: |
$(Build.BinariesDirectory)/Qt$(qtversion)/$(qtversion)/gcc_64/bin/qmake $(Build.SourcesDirectory)/tests
make
- script: ls -lR $(Build.BinariesDirectory)
- job: macOS
pool:
vmImage: 'macOS-10.13'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
brew install p7zip
python -m pip install $(pydepends)
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/setup.py
arguments: sdist bdist_wheel
workingDirectory: $(Build.SourcesDirectory)
displayName: build package
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
displayName: install package
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(qtversion) mac desktop
workingDirectory: $(Build.BinariesDirectory)
displayName: install qt
- script: |
$(Build.BinariesDirectory)/Qt$(qtversion)/$(qtversion)/clang_64/bin/qmake $(Build.SourcesDirectory)/tests
make
- script: ls -lR $(Build.BinariesDirectory)
- script: brew install p7zip
displayName: Install 7zip
- template: ci/steps.yml
strategy:
matrix:
Python 3.6 QT 5.12.3 mac desktop clang_64:
TARGET: desktop
ARCHDIR: clang_64
QT_VERSION: 5.12.3
HOST: mac
PYTHON_VERSION: '3.6'
ARCH: clang_64
Python 3.6 QT 5.13.0 mac ios ios:
TARGET: ios
ARCHDIR: ios
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.6'
ARCH: ios
Python 3.6 QT 5.13.0 mac android android_x86:
TARGET: android
ARCHDIR: android_x86
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.6'
ARCH: android_x86
Python 3.6 QT 5.13.0 mac android android_armv7:
TARGET: android
ARCHDIR: android_armv7
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.6'
ARCH: android_armv7
Python 3.7 QT 5.13.0 mac ios ios:
TARGET: ios
ARCHDIR: ios
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.7'
ARCH: ios
Python 3.7 QT 5.13.0 mac android android_armv7:
TARGET: android
ARCHDIR: android_armv7
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.7'
ARCH: android_armv7
Python 3.6 QT 5.11.3 mac desktop clang_64:
TARGET: desktop
ARCHDIR: clang_64
QT_VERSION: 5.11.3
HOST: mac
PYTHON_VERSION: '3.6'
ARCH: clang_64
Python 3.7 QT 5.12.3 mac desktop clang_64:
TARGET: desktop
ARCHDIR: clang_64
QT_VERSION: 5.12.3
HOST: mac
PYTHON_VERSION: '3.7'
ARCH: clang_64
Python 3.6 QT 5.13.0 mac desktop clang_64:
TARGET: desktop
ARCHDIR: clang_64
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.6'
ARCH: clang_64
Python 3.7 QT 5.13.0 mac android android_x86:
TARGET: android
ARCHDIR: android_x86
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.7'
ARCH: android_x86
Python 3.7 QT 5.13.0 mac desktop clang_64:
TARGET: desktop
ARCHDIR: clang_64
QT_VERSION: 5.13.0
HOST: mac
PYTHON_VERSION: '3.7'
ARCH: clang_64
Python 3.7 QT 5.11.3 mac desktop clang_64:
TARGET: desktop
ARCHDIR: clang_64
QT_VERSION: 5.11.3
HOST: mac
PYTHON_VERSION: '3.7'
ARCH: clang_64
- job: Windows
pool:
vmImage: 'vs2017-win2016'
vmImage: vs2017-win2016
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
cinst -y 7zip
python -m pip install $(pydepends)
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/setup.py
arguments: sdist bdist_wheel
workingDirectory: $(Build.SourcesDirectory)
displayName: build package
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
displayName: install package
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(qtversion) windows desktop win64_msvc2017_64
workingDirectory: $(Build.BinariesDirectory)
displayName: install qt
- script: ls -lR $(Build.BinariesDirectory)
- template: ci/steps.yml
strategy:
matrix:
Python 3.7 QT 5.11.3 windows desktop win64_msvc2017_64:
TARGET: desktop
ARCHDIR: msvc2017_64
QT_VERSION: 5.11.3
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win64_msvc2017_64
Python 3.6 QT 5.13.0 windows desktop win64_msvc2015_64:
TARGET: desktop
ARCHDIR: msvc2015_64
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win64_msvc2015_64
Python 3.6 QT 5.13.0 windows desktop win64_msvc2017_64:
TARGET: desktop
ARCHDIR: msvc2017_64
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win64_msvc2017_64
Python 3.7 QT 5.13.0 windows android android_x86:
TARGET: android
ARCHDIR: android_x86
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: android_x86
Python 3.6 QT 5.11.3 windows desktop win32_msvc2015:
TARGET: desktop
ARCHDIR: msvc2015
QT_VERSION: 5.11.3
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win32_msvc2015
Python 3.7 QT 5.13.0 windows desktop win64_msvc2015_64:
TARGET: desktop
ARCHDIR: msvc2015_64
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win64_msvc2015_64
Python 3.6 QT 5.13.0 windows desktop win32_msvc2017:
TARGET: desktop
ARCHDIR: msvc2017
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win32_msvc2017
Python 3.6 QT 5.13.0 windows android android_x86:
TARGET: android
ARCHDIR: android_x86
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: android_x86
Python 3.7 QT 5.13.0 windows desktop win32_msvc2017:
TARGET: desktop
ARCHDIR: msvc2017
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win32_msvc2017
Python 3.7 QT 5.13.0 windows desktop win32_mingw73:
TARGET: desktop
ARCHDIR: mingw73
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win32_mingw73
Python 3.6 QT 5.13.0 windows android android_armv7:
TARGET: android
ARCHDIR: android_armv7
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: android_armv7
Python 3.7 QT 5.12.3 windows desktop win64_msvc2017_64:
TARGET: desktop
ARCHDIR: msvc2017_64
QT_VERSION: 5.12.3
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win64_msvc2017_64
Python 3.6 QT 5.12.3 windows desktop win32_msvc2017:
TARGET: desktop
ARCHDIR: msvc2017
QT_VERSION: 5.12.3
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win32_msvc2017
Python 3.7 QT 5.13.0 windows android android_armv7:
TARGET: android
ARCHDIR: android_armv7
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: android_armv7
Python 3.6 QT 5.11.3 windows desktop win64_msvc2017_64:
TARGET: desktop
ARCHDIR: msvc2017_64
QT_VERSION: 5.11.3
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win64_msvc2017_64
Python 3.7 QT 5.11.3 windows desktop win32_msvc2015:
TARGET: desktop
ARCHDIR: msvc2015
QT_VERSION: 5.11.3
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win32_msvc2015
Python 3.7 QT 5.13.0 windows desktop win64_mingw73:
TARGET: desktop
ARCHDIR: mingw73
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win64_mingw73
Python 3.6 QT 5.12.3 windows desktop win64_msvc2017_64:
TARGET: desktop
ARCHDIR: msvc2017_64
QT_VERSION: 5.12.3
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win64_msvc2017_64
Python 3.6 QT 5.13.0 windows desktop win32_mingw73:
TARGET: desktop
ARCHDIR: mingw73
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win32_mingw73
Python 3.7 QT 5.13.0 windows desktop win64_msvc2017_64:
TARGET: desktop
ARCHDIR: msvc2017_64
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win64_msvc2017_64
Python 3.6 QT 5.13.0 windows desktop win64_mingw73:
TARGET: desktop
ARCHDIR: mingw73
QT_VERSION: 5.13.0
HOST: windows
PYTHON_VERSION: '3.6'
ARCH: win64_mingw73
Python 3.7 QT 5.12.3 windows desktop win32_msvc2017:
TARGET: desktop
ARCHDIR: msvc2017
QT_VERSION: 5.12.3
HOST: windows
PYTHON_VERSION: '3.7'
ARCH: win32_msvc2017
- job: Linux
pool:
vmImage: ubuntu-16.04
steps:
- template: ci/steps.yml
strategy:
matrix:
Python 3.7 QT 5.13.0 linux android android_x86:
TARGET: android
ARCHDIR: android_x86
QT_VERSION: 5.13.0
HOST: linux
PYTHON_VERSION: '3.7'
ARCH: android_x86
Python 3.6 QT 5.11.3 linux desktop gcc_64:
TARGET: desktop
ARCHDIR: gcc_64
QT_VERSION: 5.11.3
HOST: linux
PYTHON_VERSION: '3.6'
ARCH: gcc_64
Python 3.7 QT 5.13.0 linux android android_armv7:
TARGET: android
ARCHDIR: android_armv7
QT_VERSION: 5.13.0
HOST: linux
PYTHON_VERSION: '3.7'
ARCH: android_armv7
Python 3.7 QT 5.12.3 linux desktop gcc_64:
TARGET: desktop
ARCHDIR: gcc_64
QT_VERSION: 5.12.3
HOST: linux
PYTHON_VERSION: '3.7'
ARCH: gcc_64
Python 3.6 QT 5.13.0 linux android android_x86:
TARGET: android
ARCHDIR: android_x86
QT_VERSION: 5.13.0
HOST: linux
PYTHON_VERSION: '3.6'
ARCH: android_x86
Python 3.6 QT 5.13.0 linux desktop gcc_64:
TARGET: desktop
ARCHDIR: gcc_64
QT_VERSION: 5.13.0
HOST: linux
PYTHON_VERSION: '3.6'
ARCH: gcc_64
Python 3.6 QT 5.12.3 linux desktop gcc_64:
TARGET: desktop
ARCHDIR: gcc_64
QT_VERSION: 5.12.3
HOST: linux
PYTHON_VERSION: '3.6'
ARCH: gcc_64
Python 3.7 QT 5.13.0 linux desktop gcc_64:
TARGET: desktop
ARCHDIR: gcc_64
QT_VERSION: 5.13.0
HOST: linux
PYTHON_VERSION: '3.7'
ARCH: gcc_64
Python 3.6 QT 5.13.0 linux android android_armv7:
TARGET: android
ARCHDIR: android_armv7
QT_VERSION: 5.13.0
HOST: linux
PYTHON_VERSION: '3.6'
ARCH: android_armv7
Python 3.7 QT 5.11.3 linux desktop gcc_64:
TARGET: desktop
ARCHDIR: gcc_64
QT_VERSION: 5.11.3
HOST: linux
PYTHON_VERSION: '3.7'
ARCH: gcc_64

View File

@@ -0,0 +1,21 @@
# Generated by `generate_azure_pipelines_yml.py`
# Please edit template in `ci/`
jobs:
- job: Mac
pool:
vmImage: 'macOS-10.14'
steps:
- script: brew install p7zip
displayName: Install 7zip
- template: ci/steps.yml
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- template: ci/steps.yml
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: ci/steps.yml

99
ci/steps.yml Normal file
View File

@@ -0,0 +1,99 @@
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
cd $(Build.SourcesDirectory)
python -m pip install -rrequirements.txt
displayName: 'Install dependency'
- script: flake8 aqt bin
displayName: 'Run lint tests'
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/setup.py
arguments: sdist bdist_wheel
workingDirectory: $(Build.SourcesDirectory)
displayName: build package
#
# Install aqtinstall
- bash: |
export AQT_VERSION=$(python $(Build.SourcesDirectory)/setup.py --version)
pip install $(Build.SourcesDirectory)/dist/aqtinstall-${AQT_VERSION}-py2.py3-none-any.whl
condition: or( eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
displayName: install package on MacOS and Linux
- powershell: |
$aqtVersion = & python $(Build.SourcesDirectory)/setup.py --version | Out-String -Stream
pip install $(Build.SourcesDirectory)/dist/aqtinstall-$aqtVersion-py2.py3-none-any.whl
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: install package on Windows
#
# Run Aqt
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: $(Build.SourcesDirectory)/bin/aqt
arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH)
workingDirectory: $(Build.BinariesDirectory)
displayName: Install Qt
#
# Test installation result
# for Android on linux
- script: |
wget https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip
unzip android-ndk-r19c-linux-x86_64.zip
condition: and(eq(variables['TARGET'], 'android'), eq(variables['Agent.OS'], 'Linux'))
displayName: Download and extract Android NDK
# for Android on mac
- script: |
wget https://dl.google.com/android/repository/android-ndk-r19c-darwin-x86_64.zip
unzip android-ndk-r19c-darwin-x86_64.zip
condition: and(eq(variables['TARGET'], 'android'), eq(variables['Agent.OS'], 'Darwin'))
displayName: Download and extract Android NDK
# for Android on windows
- script: |
cinst -y --no-progress wget
wget https://dl.google.com/android/repository/android-ndk-r19c-windows-x86_64.zip
unzip android-ndk-r19c-windows-x86_64.zip
condition: and(eq(variables['TARGET'], 'android'), eq(variables['Agent.OS'], 'Windows_NT'))
displayName: Download and extract Android NDK
- script: |
export ANDROID_NDK_ROOT=$(Build.SourcesDirectory)/android-ndk-r19c
$(Build.BinariesDirectory)/Qt$(QT_VERSION)/$(QT_VERSION)/$(ARCHDIR)/bin/qmake $(Build.SourcesDirectory)/tests/accelbubble/ && make
condition: and(eq(variables['TARGET'], 'android'), or(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OS'], 'Darwin')))
displayName: Build accelbubble example application to test for android
# for desktop application
- powershell: |
if ('$(ARCH)' like '*msvc*') {
echo '##vso[task.setvariable variable=RUNTEST]true'
if ($(ARCH) like 'win64_msvc*') {
echo '##vso[task.setvariable variable=ARCHITECTURE]amd64'
} else {
echo '##vso[task.setvariable variable=ARCHITECTURE]x86'
}
if ('$(ARCH)' like '*msvc2017*') {
echo '##vso[task.setvariable variable=VS_VER]2017'
} else {
echo '##vso[task.setvariable variable=VS_VER]2015'
}
Install-PackageProvider NuGet -Force
Import-PackageProvider NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module Pscx -AllowClobber
Install-Module VSSetup -Scope CurrentUser
Import-VisualStudioVars -VisualStudioVersion $(VS_VER) -Architecture $(ARCHITECTURE)
$(Build.BinariesDirectory)/Qt$(QT_VERSION)/$(QT_VERSION)/$(ARCHDIR)/bin/qmake $(Build.SourcesDirectory)/tests
nmake
}
condition: and(eq( variables['Agent.OS'], 'Windows_NT'), eq(variables['TARGET'], 'desktop'))
displayName: build test with qmake for windows
- script: |
$(Build.BinariesDirectory)/Qt$(QT_VERSION)/$(QT_VERSION)/$(ARCHDIR)/bin/qmake $(Build.SourcesDirectory)/tests
make
condition: and(eq( variables['TARGET'], 'desktop' ), or(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OS'], 'Darwin')))
displayName: Build test with qmake for Linux and macOS
# for ios
- script: echo Currently not implemented.
condition: and(eq(variables['TARGET'], 'ios'), eq(variables['Agent.OS'], 'Darwin'))
displayName: Build test with qmake for ios

View File

@@ -0,0 +1,132 @@
"""
This generates a matrix of QT versions to test downloading against
"""
from itertools import product
import os
from ruamel.yaml import YAML
class BuildJob:
def __init__(self, qt_version, host, target, arch, archdir):
self.qt_version = qt_version
self.host = host
self.target = target
self.arch = arch
self.archdir = archdir
class PlatformBuildJobs:
def __init__(self, platform, build_jobs):
self.platform = platform
self.build_jobs = build_jobs
python_versions = [
'3.6',
'3.7',
]
qt_versions = [
'5.11.3',
'5.12.3',
'5.13.0'
]
linux_build_jobs = []
mac_build_jobs = []
windows_build_jobs = []
all_platform_build_jobs = [
PlatformBuildJobs('linux', linux_build_jobs),
PlatformBuildJobs('mac', mac_build_jobs),
PlatformBuildJobs('windows', windows_build_jobs),
]
# Linux Desktop
for qt_version in qt_versions:
linux_build_jobs.append(
BuildJob(qt_version, 'linux', 'desktop', 'gcc_64', 'gcc_64')
)
# Mac Desktop
for qt_version in qt_versions:
mac_build_jobs.append(
BuildJob(qt_version, 'mac', 'desktop', 'clang_64', "clang_64")
)
# Mac iOS
mac_build_jobs.append(
BuildJob('5.13.0', 'mac', 'ios', 'ios', 'ios')
)
# Windows Desktop
windows_build_jobs.extend(
[
BuildJob('5.11.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'),
BuildJob('5.11.3', 'windows', 'desktop', 'win32_msvc2015', 'msvc2015'),
]
)
windows_build_jobs.extend(
[
BuildJob('5.12.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'),
BuildJob('5.12.3', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'),
]
)
windows_build_jobs.extend(
[
BuildJob('5.13.0', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'),
BuildJob('5.13.0', 'windows', 'desktop', 'win64_msvc2015_64', 'msvc2015_64'),
BuildJob('5.13.0', 'windows', 'desktop', 'win64_mingw73', 'mingw73'),
BuildJob('5.13.0', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'),
BuildJob('5.13.0', 'windows', 'desktop', 'win32_mingw73', 'mingw73'),
]
)
# All Androids for all platforms
for android_arch in [ 'android_x86', 'android_armv7', ]:
for platform_build_jobs in all_platform_build_jobs:
platform_build_jobs.build_jobs.append(
BuildJob('5.13.0', platform_build_jobs.platform, 'android', android_arch, android_arch)
)
matrices = {}
for platform_build_job in all_platform_build_jobs:
yaml_dictionary = {
'matrix': {}
}
for build_job, python_version in product(platform_build_job.build_jobs, python_versions):
key = 'Python {} QT {} {} {} {}'.format(python_version, build_job.qt_version, build_job.host, build_job.target,
build_job.arch)
yaml_dictionary['matrix'][key] = \
{
'PYTHON_VERSION': python_version,
'QT_VERSION': build_job.qt_version,
'HOST': build_job.host,
'TARGET': build_job.target,
'ARCH': build_job.arch,
'ARCHDIR': build_job.archdir,
}
matrices[platform_build_job.platform.capitalize()] = yaml_dictionary
root_dir = os.path.abspath(os.path.dirname(__file__))
# Load azure-pipelines.tmpl.yml
with open(os.path.join(root_dir, 'ci', 'azure-pipelines.tmpl.yml'), 'r') as f:
azure_pipelines_yaml = YAML().load(f.read())
# Attach strategies to their respective jobs
for job_yaml in azure_pipelines_yaml['jobs']:
if job_yaml['job'] in matrices:
job_yaml['strategy'] = matrices[job_yaml['job']]
with open(os.path.join(root_dir, 'azure-pipelines.yml'), 'w') as f:
YAML().dump(azure_pipelines_yaml, f)
pass

9
requirements.txt Normal file
View File

@@ -0,0 +1,9 @@
six
requests
pytest
pytest-pep8
pytest-cov
flake8
ruamel.yaml==0.15.94
wheel
twine

View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny">
<defs>
<radialGradient id="grad1" cx="0.5" cy="0.7" r="0.7" fx="0.5" fy="0.4">
<stop offset="0" style="stop-color:rgb(255,255,255)" />
<stop offset="1.5" style="stop-color:rgb(0,102,153)" />
</radialGradient>
</defs>
<circle cx="100" cy="80" r="42" fill="url(#grad1)"/>
</svg>

After

Width:  |  Height:  |  Size: 399 B

View File

@@ -0,0 +1,60 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.9
import QtQuick.Controls 2.2
Image {
source: "Bluebubble.svg"
smooth: true
property real centerX
property real centerY
property real bubbleCenter
}

View File

@@ -0,0 +1,74 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.9
import QtQuick.Controls 2.2
Page {
width: 600
height: 400
property alias bubble: bubble
property alias mainWindow: mainWindow
header: Label {
text: qsTr("Page 1")
font.pixelSize: Qt.application.font.pixelSize * 2
padding: 10
}
Rectangle {
id: mainWindow
color: "#ffffff"
anchors.fill: parent
Bubble {
id: bubble
}
}
}

View File

@@ -0,0 +1,67 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.9
import QtQuick.Controls 2.2
Page {
width: 600
height: 400
header: Label {
text: qsTr("Page 2")
font.pixelSize: Qt.application.font.pixelSize * 2
padding: 10
}
Label {
text: qsTr("You are on Page 2.")
anchors.centerIn: parent
}
}

View File

@@ -0,0 +1,37 @@
QT += quick sensors svg xml
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
ios {
QTPLUGIN += qsvg qsvgicon qtsensors_ios
QMAKE_INFO_PLIST = Info.plist
}
DISTFILES += \
Bluebubble.svg

View File

@@ -0,0 +1,66 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}

141
tests/accelbubble/main.qml Normal file
View File

@@ -0,0 +1,141 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtSensors 5.9
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Accelerate Bubble")
SwipeView {
id: swipeView
anchors.fill: parent
currentIndex: tabBar.currentIndex
Page1Form {
bubble {
id: bubble
centerX: mainWindow.width / 2
centerY: mainWindow.height / 2
bubbleCenter: bubble.width / 2
x: bubble.centerX - bubble.bubbleCenter
y: bubble.centerY - bubble.bubbleCenter
Behavior on y {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
Behavior on x {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
}
}
Page2Form {
}
}
footer: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: qsTr("Page 1")
}
TabButton {
text: qsTr("Page 2")
}
}
Accelerometer {
id: accel
dataRate: 100
active: true
onReadingChanged: {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
if (isNaN(newX) || isNaN(newY))
return;
if (newX < 0)
newX = 0
if (newX > mainWindow.width - bubble.width)
newX = mainWindow.width - bubble.width
if (newY < 18)
newY = 18
if (newY > mainWindow.height - bubble.height)
newY = mainWindow.height - bubble.height
bubble.x = newX
bubble.y = newY
}
}
function calcPitch(x, y, z) {
return -(Math.atan(y / Math.sqrt(x * x + z * z)) * 57.2957795);
}
function calcRoll(x, y, z) {
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
}
}

10
tests/accelbubble/qml.qrc Normal file
View File

@@ -0,0 +1,10 @@
<RCC>
<qresource prefix="/">
<file>Page1Form.ui.qml</file>
<file>Page2Form.ui.qml</file>
<file>qtquickcontrols2.conf</file>
<file>Bubble.qml</file>
<file>Bluebubble.svg</file>
<file>main.qml</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,6 @@
; This file can be edited to change the style of the application
; Read "Qt Quick Controls 2 Configuration File" for details:
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
[Controls]
Style=Default