Adds multiple artifact downloader
This commit is contained in:
parent
d98a46df5c
commit
2ba2de7da4
@ -1,38 +1,62 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const setupDir = path.resolve(__dirname, '..', 'miniqt');
|
||||
const SETUP_DIR = path.resolve(__dirname, '..', 'miniqt');
|
||||
const QT_VERSION = '5.15.0';
|
||||
|
||||
const miniQt = {
|
||||
downloadLink: null,
|
||||
qtHome: null,
|
||||
version: '5.15.0',
|
||||
setupDir,
|
||||
};
|
||||
|
||||
switch (os.platform()) {
|
||||
case 'darwin': {
|
||||
miniQt.qtHome = path.resolve(setupDir, miniQt.version, 'clang_64');
|
||||
miniQt.downloadLink = `https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5150/qt.qt5.5150.clang_64/5.15.0-0-202002122005qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z`;
|
||||
break;
|
||||
}
|
||||
case 'win32': {
|
||||
miniQt.qtHome = path.resolve(setupDir, miniQt.version, 'msvc2017_64');
|
||||
miniQt.downloadLink = `https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win64_msvc2017_64/5.15.0-0-202002122017qtbase-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z`;
|
||||
break;
|
||||
}
|
||||
case 'linux': {
|
||||
miniQt.qtHome = path.resolve(setupDir, miniQt.version, 'gcc_64');
|
||||
miniQt.downloadLink = `https://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt5_5150/qt.qt5.5150.gcc_64/5.15.0-0-202002122009qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z`;
|
||||
break;
|
||||
function getMiniQtConfig() {
|
||||
switch (os.platform()) {
|
||||
case 'darwin': {
|
||||
return {
|
||||
qtHome: path.resolve(SETUP_DIR, QT_VERSION, 'clang_64'),
|
||||
version: QT_VERSION,
|
||||
artifacts: [
|
||||
{
|
||||
name: 'Qt Base',
|
||||
link: `https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5150/qt.qt5.5150.clang_64/5.15.0-0-202002122005qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z`,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
case 'win32': {
|
||||
return {
|
||||
qtHome: path.resolve(SETUP_DIR, QT_VERSION, 'msvc2017_64'),
|
||||
version: QT_VERSION,
|
||||
artifacts: [
|
||||
{
|
||||
name: 'Qt Base',
|
||||
link: `https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5150/qt.qt5.5150.win64_msvc2017_64/5.15.0-0-202002122017qtbase-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z`,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
case 'linux': {
|
||||
return {
|
||||
qtHome: path.resolve(SETUP_DIR, QT_VERSION, 'gcc_64'),
|
||||
version: QT_VERSION,
|
||||
artifacts: [
|
||||
{
|
||||
name: 'Qt Base',
|
||||
link: `https://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt5_5150/qt.qt5.5150.gcc_64/5.15.0-0-202002122009qtbase-Linux-RHEL_7_6-GCC-Linux-RHEL_7_6-X86_64.7z`,
|
||||
},
|
||||
{
|
||||
name: 'Qt ICU',
|
||||
link: `https://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt5_5150/qt.qt5.5150.gcc_64/5.15.0-0-202002122009icu-linux-Rhel7.2-x64.7z`,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const qtHome = process.env.QT_INSTALL_DIR ? process.env.QT_INSTALL_DIR : miniQt.qtHome;
|
||||
const miniQt = getMiniQtConfig();
|
||||
const useCustomQt = Boolean(process.env.QT_INSTALL_DIR);
|
||||
const qtHome = useCustomQt ? process.env.QT_INSTALL_DIR : miniQt.qtHome;
|
||||
const qtCmakeDir = path.resolve(qtHome, 'lib', 'cmake', 'Qt5');
|
||||
|
||||
module.exports = {
|
||||
qtHome,
|
||||
qtCmakeDir: path.resolve(qtHome, 'lib', 'cmake', 'Qt5'),
|
||||
miniQt,
|
||||
useCustomQt: Boolean(process.env.QT_INSTALL_DIR),
|
||||
qtCmakeDir,
|
||||
useCustomQt,
|
||||
};
|
||||
|
||||
@ -5,16 +5,24 @@ const { miniQt, useCustomQt, qtHome } = require('../config/qtConfig');
|
||||
|
||||
if (!useCustomQt) {
|
||||
console.log(`Minimal Qt ${miniQt.version} setup:`);
|
||||
|
||||
setupArtifact({
|
||||
outDir: miniQt.setupDir,
|
||||
id: 'nodegui-mini-qt',
|
||||
displayName: `Minimal Qt ${miniQt.version} installation`,
|
||||
downloadLink: miniQt.downloadLink,
|
||||
}).catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
} else {
|
||||
console.log(`CustomQt detected at ${qtHome} . Hence, skipping Mini Qt installation...`);
|
||||
}
|
||||
|
||||
async function setupQt() {
|
||||
return Promise.all(
|
||||
miniQt.artifacts.map(async artifact =>
|
||||
setupArtifact({
|
||||
outDir: miniQt.setupDir,
|
||||
id: 'nodegui-mini-qt',
|
||||
displayName: `${artifact.name} for Minimal Qt: ${miniQt.version} installation`,
|
||||
downloadLink: artifact.link,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
setupQt().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user