diff --git a/aqt/archives.py b/aqt/archives.py index 122c20a..80a004d 100644 --- a/aqt/archives.py +++ b/aqt/archives.py @@ -152,7 +152,7 @@ class ToolArchives(QtArchives): if full_version != self.version: continue if "-" in full_version: - split_version = full_version.split["-"] + split_version = full_version.split("-") named_version = split_version[0] + "-" + split_version[1] else: named_version = full_version diff --git a/aqt/installer.py b/aqt/installer.py index c00260b..aee2110 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -98,34 +98,41 @@ class QtInstaller: p = Pool(NUM_PROCESS) ret_arr = p.map(functools.partial(self.retrieve_archive, command=command, path=base_dir), archives) ret = functools.reduce(and_, ret_arr) - if ret: - if arch.startswith('win64_mingw'): - arch_dir = arch[6:] + '_64' - elif arch.startswith('win32_mingw'): - arch_dir = arch[6:] + '_32' - elif arch.startswith('win'): - arch_dir = arch[6:] - else: - arch_dir = arch - try: - # prepare qt.conf - with open(os.path.join(base_dir, qt_version, arch_dir, 'bin', 'qt.conf'), 'w') as f: - f.write("[Paths]\n") - f.write("Prefix=..\n") - # prepare qtconfig.pri - with open(os.path.join(base_dir, qt_version, arch_dir, 'mkspecs', 'qconfig.pri'), 'r+') as f: - lines = f.readlines() - f.seek(0) - f.truncate() - for line in lines: - if 'QT_EDITION' in line: - line = 'QT_EDITION = OpenSource' - f.write(line) - except IOError as e: - self.logger.error("Configuration file generation error: %s\n", e.args, exc_info=True) - raise e - else: + if not ret: # fails to install + self.logger.error("Failed to install.") exit(1) + if qt_version == "Tools": # tools installation + return + # finalize + if arch.startswith('win64_mingw'): + arch_dir = arch[6:] + '_64' + elif arch.startswith('win32_mingw'): + arch_dir = arch[6:] + '_32' + elif arch.startswith('win'): + arch_dir = arch[6:] + else: + arch_dir = arch + self.make_conf_files(base_dir, qt_version, arch_dir) + + def make_conf_files(self, base_dir, qt_version, arch_dir): + """Make Qt configuration files, qt.conf and qtconfig.pri""" + try: + # prepare qt.conf + with open(os.path.join(base_dir, qt_version, arch_dir, 'bin', 'qt.conf'), 'w') as f: + f.write("[Paths]\n") + f.write("Prefix=..\n") + # prepare qtconfig.pri + with open(os.path.join(base_dir, qt_version, arch_dir, 'mkspecs', 'qconfig.pri'), 'r+') as f: + lines = f.readlines() + f.seek(0) + f.truncate() + for line in lines: + if 'QT_EDITION' in line: + line = 'QT_EDITION = OpenSource' + f.write(line) + except IOError as e: + self.logger.error("Configuration file generation error: %s\n", e.args, exc_info=True) + raise e class Metalink: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2b4cc47..d643076 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,7 +45,7 @@ jobs: displayName: Linux (Specific Mirror) variables: PYTHON_VERSION: '3.7' - QT_VERSION: 5.13.0 + QT_VERSION: 5.13.1 HOST: linux TARGET: android ARCH: android_armv7 @@ -55,3 +55,18 @@ jobs: vmImage: 'ubuntu-16.04' steps: - template: ci/steps.yml + +- job: LinuxToolsOpenSSL + displayName: Tools(OpenSSL, Linux) + variables: + PYTHON_VERSION: '3.7' + HOST: linux + TOOL_NAME: tools_openssl_x64 + TOOL_VERSION: 1.1.1-0 + ARCH: qt.tools.openssl.gcc_64 + TEST_EXECUTABLE: OpenSSL/binary/bin/openssl + TEST_COMMAND: version + pool: + vmImage: 'ubuntu-16.04' + steps: + - template: ci/steps.yml diff --git a/ci/generate_azure_pipelines_matrices.py b/ci/generate_azure_pipelines_matrices.py index ee1f1ab..a9c087d 100644 --- a/ci/generate_azure_pipelines_matrices.py +++ b/ci/generate_azure_pipelines_matrices.py @@ -26,9 +26,9 @@ python_versions = [ ] qt_versions = [ - '5.11.3', - '5.12.3', - '5.13.0' + '5.12.5', + '5.13.1', + '5.14.0' ] linux_build_jobs = [] @@ -63,25 +63,25 @@ mac_build_jobs.append( # 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'), + BuildJob('5.12.5', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'), + BuildJob('5.12.5', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), ] ) windows_build_jobs.extend( [ - BuildJob('5.12.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'), - BuildJob('5.12.3', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), + BuildJob('5.13.1', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'), + BuildJob('5.13.1', 'windows', 'desktop', 'win64_msvc2015_64', 'msvc2015_64'), + BuildJob('5.13.1', 'windows', 'desktop', 'win64_mingw73', 'mingw73_64'), + BuildJob('5.13.1', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), + BuildJob('5.13.1', 'windows', 'desktop', 'win32_mingw73', 'mingw73_32'), ] ) 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_64'), - BuildJob('5.13.0', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), - BuildJob('5.13.0', 'windows', 'desktop', 'win32_mingw73', 'mingw73_32'), + BuildJob('5.14.0', 'windows', 'desktop', 'win64_msvc2015_64', 'msvc2015_64'), + BuildJob('5.14.0', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'), ] ) @@ -92,7 +92,7 @@ windows_build_jobs.extend( for android_arch in ['android_x86', 'android_armv7']: linux_build_jobs.append( - BuildJob('5.13.0', 'linux', 'android', android_arch, android_arch) + BuildJob('5.13.1', 'linux', 'android', android_arch, android_arch) ) matrices = {} diff --git a/ci/steps.yml b/ci/steps.yml index b1bbaf3..144f7c2 100644 --- a/ci/steps.yml +++ b/ci/steps.yml @@ -26,7 +26,7 @@ steps: scriptPath: $(Build.SourcesDirectory)/bin/aqt arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH) --internal workingDirectory: $(Build.BinariesDirectory) - condition: not(variables['QT_BASE_MIRROR']) + condition: and(not(variables['QT_BASE_MIRROR']), not(variables['TOOL_NAME'])) displayName: Run Aqt (No Base URL Set) - task: PythonScript@0 inputs: @@ -34,7 +34,7 @@ steps: scriptPath: $(Build.SourcesDirectory)/bin/aqt arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH) -b $(QT_BASE_MIRROR) workingDirectory: $(Build.BinariesDirectory) - condition: variables['QT_BASE_MIRROR'] + condition: and(variables['QT_BASE_MIRROR'], not(variables['TOOL_NAME'])) displayName: Run Aqt (Base URL Set) # # Test installation results @@ -95,3 +95,24 @@ steps: - script: echo Currently not implemented. condition: and(eq(variables['TARGET'], 'ios'), eq(variables['Agent.OS'], 'Darwin')) displayName: Build test with qmake for ios + # + # Install aqtinstall + - powershell: | + $aqtVersion = & python $(Build.SourcesDirectory)/setup.py --version | Out-String -Stream + pip install $(Build.SourcesDirectory)/dist/aqtinstall-$aqtVersion-py2.py3-none-any.whl + displayName: install package + - task: PythonScript@0 + inputs: + scriptSource: filePath + scriptPath: $(Build.SourcesDirectory)/bin/aqt + arguments: tool $(HOST) $(TOOL_NAME) $(TOOL_VERSION) $(ARCH) --internal + workingDirectory: $(Build.BinariesDirectory) + condition: variables['TOOL_NAME'] + displayName: Run Aqt (Tool) + # + # Test installation results + # for OpenSSL on linux + - script: | + $(Build.BinariesDirectory)/Qt/Tools/$(TEST_EXECUTABLE) $(TEST_COMMAND) + condition: variables['TOOL_NAME'] + displayName: Tool test