diff options
-rw-r--r-- | src/app/qbs-setup-qt/setupqt.cpp | 1 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/msvcprobe.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/api/languageinfo.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/jsextensions/utilitiesextension.cpp | 6 | ||||
-rw-r--r-- | src/lib/corelib/language/astimportshandler.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/tools/version.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/tools/version.h | 2 | ||||
-rw-r--r-- | src/lib/qtprofilesetup/qtenvironment.h | 2 | ||||
-rw-r--r-- | src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 16 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackboxapple.cpp | 30 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackboxapple.h | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_clangdb.cpp | 9 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_clangdb.h | 2 |
14 files changed, 37 insertions, 45 deletions
diff --git a/src/app/qbs-setup-qt/setupqt.cpp b/src/app/qbs-setup-qt/setupqt.cpp index 66efcc022..9cd5be283 100644 --- a/src/app/qbs-setup-qt/setupqt.cpp +++ b/src/app/qbs-setup-qt/setupqt.cpp @@ -64,7 +64,6 @@ namespace qbs { using Internal::contains; using Internal::HostOsInfo; using Internal::Tr; -using Internal::Version; static QStringList qmakeExecutableNames() { diff --git a/src/app/qbs-setup-toolchains/msvcprobe.cpp b/src/app/qbs-setup-toolchains/msvcprobe.cpp index 0b3f460b5..294523c1c 100644 --- a/src/app/qbs-setup-toolchains/msvcprobe.cpp +++ b/src/app/qbs-setup-toolchains/msvcprobe.cpp @@ -220,7 +220,7 @@ static std::vector<MSVC> installedMSVCs() } msvc.version = QString::number(Internal::VisualStudioVersionInfo( - Internal::Version::fromString(registryEntry.version)).marketingVersion()); + Version::fromString(registryEntry.version)).marketingVersion()); if (msvc.version.isEmpty()) { qbsWarning() << Tr::tr("Unknown MSVC version %1 found.").arg(registryEntry.version); continue; diff --git a/src/lib/corelib/api/languageinfo.cpp b/src/lib/corelib/api/languageinfo.cpp index 33f128b9f..df8d62ca0 100644 --- a/src/lib/corelib/api/languageinfo.cpp +++ b/src/lib/corelib/api/languageinfo.cpp @@ -128,7 +128,7 @@ QByteArray LanguageInfo::qmlTypeInfo() QString LanguageInfo::qbsVersion() { - return Internal::Version::qbsVersion().toString(); + return Version::qbsVersion().toString(); } } // namespace qbs diff --git a/src/lib/corelib/jsextensions/utilitiesextension.cpp b/src/lib/corelib/jsextensions/utilitiesextension.cpp index 1541b8d06..e1d9d383f 100644 --- a/src/lib/corelib/jsextensions/utilitiesextension.cpp +++ b/src/lib/corelib/jsextensions/utilitiesextension.cpp @@ -528,9 +528,9 @@ QScriptValue UtilitiesExtension::js_versionCompare(QScriptContext *context, QScr const QScriptValue value1 = context->argument(0); const QScriptValue value2 = context->argument(1); if (value1.isString() && value2.isString()) { - const auto a = Internal::Version::fromString(value1.toString()); - const auto b = Internal::Version::fromString(value2.toString()); - return engine->toScriptValue(Internal::compare(a, b)); + const auto a = Version::fromString(value1.toString()); + const auto b = Version::fromString(value2.toString()); + return engine->toScriptValue(compare(a, b)); } } diff --git a/src/lib/corelib/language/astimportshandler.h b/src/lib/corelib/language/astimportshandler.h index 548020b94..b69a8fab7 100644 --- a/src/lib/corelib/language/astimportshandler.h +++ b/src/lib/corelib/language/astimportshandler.h @@ -49,12 +49,12 @@ namespace qbs { class CodeLocation; +class Version; namespace Internal { class ItemReaderVisitorState; class JsImport; class Logger; -class Version; class ASTImportsHandler { diff --git a/src/lib/corelib/tools/version.cpp b/src/lib/corelib/tools/version.cpp index 4ae73386b..f9c7a540f 100644 --- a/src/lib/corelib/tools/version.cpp +++ b/src/lib/corelib/tools/version.cpp @@ -43,7 +43,6 @@ #include <QtCore/qstring.h> namespace qbs { -namespace Internal { Version::Version(int major, int minor, int patch, int buildNr) : m_major(major), m_minor(minor), m_patch(patch), m_build(buildNr) @@ -157,5 +156,4 @@ VersionRange &VersionRange::narrowDown(const VersionRange &other) return *this; } -} // namespace Internal } // namespace qbs diff --git a/src/lib/corelib/tools/version.h b/src/lib/corelib/tools/version.h index 50aa69759..81bfe1f5b 100644 --- a/src/lib/corelib/tools/version.h +++ b/src/lib/corelib/tools/version.h @@ -49,7 +49,6 @@ class QString; QT_END_NAMESPACE namespace qbs { -namespace Internal { class QBS_EXPORT Version { @@ -103,7 +102,6 @@ inline bool operator>(const Version &lhs, const Version &rhs) { return compare(l inline bool operator<=(const Version &lhs, const Version &rhs) { return !operator>(lhs, rhs); } inline bool operator>=(const Version &lhs, const Version &rhs) { return !operator<(lhs, rhs); } -} // namespace Internal } // namespace qbs #endif // QBS_VERSION_H diff --git a/src/lib/qtprofilesetup/qtenvironment.h b/src/lib/qtprofilesetup/qtenvironment.h index 4747bb364..19b27871b 100644 --- a/src/lib/qtprofilesetup/qtenvironment.h +++ b/src/lib/qtprofilesetup/qtenvironment.h @@ -78,7 +78,7 @@ public: int qtMajorVersion; int qtMinorVersion; int qtPatchVersion; - Internal::Version msvcVersion; + Version msvcVersion; bool staticBuild = false; bool frameworkBuild = false; bool hasQtQuickCompiler = false; diff --git a/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp b/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp index e1ebaa4d9..3402b07d5 100644 --- a/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp +++ b/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp @@ -238,7 +238,7 @@ void MSBuildQbsProductProject::addConfiguration(const GeneratableProject &projec static QString subsystemVersion(const QString &version) { - const auto v = Internal::Version::fromString(version); + const auto v = Version::fromString(version); return QStringLiteral("%1.%2").arg( QString::number(v.majorVersion()), QString::number(v.minorVersion()).rightJustified(2, QLatin1Char('0'))); diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 8f5f73dc6..f51267a6b 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -5157,21 +5157,21 @@ void TestBlackbox::minimumSystemVersion() QVERIFY(m_qbsStdout.contains(output.toUtf8())); } -static qbs::Internal::Version fromMinimumDeploymentTargetValue(int v, bool isMacOS) +static qbs::Version fromMinimumDeploymentTargetValue(int v, bool isMacOS) { if (isMacOS && v < 100000) - return qbs::Internal::Version(v / 100, v / 10 % 10, v % 10); - return qbs::Internal::Version(v / 10000, v / 100 % 100, v % 100); + return qbs::Version(v / 100, v / 10 % 10, v % 10); + return qbs::Version(v / 10000, v / 100 % 100, v % 100); } -static int toMinimumDeploymentTargetValue(const qbs::Internal::Version &v, bool isMacOS) +static int toMinimumDeploymentTargetValue(const qbs::Version &v, bool isMacOS) { - if (isMacOS && v < qbs::Internal::Version(10, 10)) + if (isMacOS && v < qbs::Version(10, 10)) return (v.majorVersion() * 100) + (v.minorVersion() * 10) + v.patchLevel(); return (v.majorVersion() * 10000) + (v.minorVersion() * 100) + v.patchLevel(); } -static qbs::Internal::Version defaultClangMinimumDeploymentTarget() +static qbs::Version defaultClangMinimumDeploymentTarget() { QProcess process; process.start("/usr/bin/xcrun", {"-sdk", "macosx", "clang++", @@ -5192,7 +5192,7 @@ static qbs::Internal::Version defaultClangMinimumDeploymentTarget() } } - return qbs::Internal::Version(); + return qbs::Version(); } void TestBlackbox::minimumSystemVersion_data() @@ -5355,7 +5355,7 @@ void TestBlackbox::badInterpreter() void TestBlackbox::qbsVersion() { - const qbs::Internal::Version v = qbs::Internal::Version::qbsVersion(); + const qbs::Version v = qbs::Version::qbsVersion(); QDir::setCurrent(testDataDir + QLatin1String("/qbsVersion")); QbsRunParameters params; params.arguments = QStringList() diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp index 9925265e8..6fc526cd8 100644 --- a/tests/auto/blackbox/tst_blackboxapple.cpp +++ b/tests/auto/blackbox/tst_blackboxapple.cpp @@ -171,13 +171,13 @@ void TestBlackboxApple::assetCatalog() QCOMPARE(runQbs(params), 0); // empty asset catalogs must still produce output - if (xcodeVersion >= qbs::Internal::Version(5)) + if (xcodeVersion >= qbs::Version(5)) QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets")); // should additionally produce raw assets since deployment target will be < 10.9 // older versions of ibtool generated either raw assets OR .car files; // newer versions always generate the .car file regardless of the deployment target - if (v < qbs::Internal::Version(10, 9)) { + if (v < qbs::Version(10, 9)) { QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") + "/assetcatalogempty.app/Contents/Resources/other.png")); QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") @@ -189,10 +189,10 @@ void TestBlackboxApple::assetCatalog() QCOMPARE(runQbs(params), 0); // empty asset catalogs must still produce output - if (xcodeVersion >= qbs::Internal::Version(5)) { + if (xcodeVersion >= qbs::Version(5)) { QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets")); // No matter what, we need a 10.9 host to build CAR files - if (HostOsInfo::hostOsVersion() >= qbs::Internal::Version(10, 9)) { + if (HostOsInfo::hostOsVersion() >= qbs::Version(10, 9)) { QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty") + "/assetcatalogempty.app/Contents/Resources/Assets.car")); } else { @@ -228,7 +228,7 @@ void TestBlackboxApple::assetCatalog() QString storyboardc = relativeProductBuildDir("assetcatalogempty") + "/assetcatalogempty.app/Contents/Resources/Storyboard.storyboardc"; QStringList storyboardcFiles; - if (HostOsInfo::hostOsVersion() >= qbs::Internal::Version(10, 10)) { + if (HostOsInfo::hostOsVersion() >= qbs::Version(10, 10)) { QVERIFY(directoryExists(storyboardc)); storyboardcFiles = QStringList() @@ -261,7 +261,7 @@ void TestBlackboxApple::assetCatalog_data() } void TestBlackboxApple::assetCatalogsEmpty() { - if (findXcodeVersion() < qbs::Internal::Version(5)) + if (findXcodeVersion() < qbs::Version(5)) QSKIP("requires Xcode 5 or above"); QDir::setCurrent(testDataDir + QLatin1String("/ib/empty-asset-catalogs")); QCOMPARE(runQbs(), 0); @@ -270,7 +270,7 @@ void TestBlackboxApple::assetCatalogsEmpty() { } void TestBlackboxApple::assetCatalogsMultiple() { - if (findXcodeVersion() < qbs::Internal::Version(5)) + if (findXcodeVersion() < qbs::Version(5)) QSKIP("requires Xcode 5 or above"); QDir::setCurrent(testDataDir + QLatin1String("/ib/multiple-asset-catalogs")); QCOMPARE(runQbs(), 0); @@ -290,7 +290,7 @@ void TestBlackboxApple::bundleStructure() if (isShallow) { // Coerce shallow bundles - don't set bundle.isShallow directly because we want to test the // automatic detection - const auto xcode5 = findXcodeVersion() >= qbs::Internal::Version(5); + const auto xcode5 = findXcodeVersion() >= qbs::Version(5); params.arguments << "modules.qbs.targetPlatform:ios" << (xcode5 ? "qbs.architectures:arm64" : "qbs.architectures:armv7a"); @@ -572,7 +572,7 @@ void TestBlackboxApple::deploymentTarget_data() << "-macosx_version_min 10.4"; const auto xcodeVersion = findXcodeVersion(); - if (xcodeVersion >= qbs::Internal::Version(6)) + if (xcodeVersion >= qbs::Version(6)) QTest::newRow("macos x86_64h") << "macosx" << macos << "x86_64h" << "-triple x86_64h-apple-macosx10.12" << "-macosx_version_min 10.12"; @@ -583,20 +583,20 @@ void TestBlackboxApple::deploymentTarget_data() QTest::newRow("ios armv7s") << "iphoneos" <<ios << "armv7s" << "-triple thumbv7s-apple-ios7.0" << "-iphoneos_version_min 7.0"; - if (xcodeVersion >= qbs::Internal::Version(5)) + if (xcodeVersion >= qbs::Version(5)) QTest::newRow("ios arm64") << "iphoneos" <<ios << "arm64" << "-triple arm64-apple-ios7.0" << "-iphoneos_version_min 7.0"; QTest::newRow("ios-simulator x86") << "iphonesimulator" << ios_sim << "x86" << "-triple i386-apple-ios6.0" << "-ios_simulator_version_min 6.0"; - if (xcodeVersion >= qbs::Internal::Version(5)) + if (xcodeVersion >= qbs::Version(5)) QTest::newRow("ios-simulator x86_64") << "iphonesimulator" << ios_sim << "x86_64" << "-triple x86_64-apple-ios7.0" << "-ios_simulator_version_min 7.0"; - if (xcodeVersion >= qbs::Internal::Version(7)) { - if (xcodeVersion >= qbs::Internal::Version(7, 1)) { + if (xcodeVersion >= qbs::Version(7)) { + if (xcodeVersion >= qbs::Version(7, 1)) { QTest::newRow("tvos arm64") << "appletvos" << tvos << "arm64" << "-triple arm64-apple-tvos9.0" << "-tvos_version_min 9.0"; @@ -768,7 +768,7 @@ QVariantMap TestBlackboxApple::findXcode(int *status) return QJsonDocument::fromJson(file.readAll()).toVariant().toMap(); } -qbs::Internal::Version TestBlackboxApple::findXcodeVersion() +qbs::Version TestBlackboxApple::findXcodeVersion() { - return qbs::Internal::Version::fromString(findXcode().value("version").toString()); + return qbs::Version::fromString(findXcode().value("version").toString()); } diff --git a/tests/auto/blackbox/tst_blackboxapple.h b/tests/auto/blackbox/tst_blackboxapple.h index b9bb64104..05e0d8acd 100644 --- a/tests/auto/blackbox/tst_blackboxapple.h +++ b/tests/auto/blackbox/tst_blackboxapple.h @@ -32,9 +32,7 @@ #include "tst_blackboxbase.h" namespace qbs { -namespace Internal { class Version; -} // namespace Internal } // namespace qbs class TestBlackboxApple : public TestBlackboxBase @@ -68,7 +66,7 @@ private slots: private: QVariantMap findXcode(int *status = nullptr); - qbs::Internal::Version findXcodeVersion(); + qbs::Version findXcodeVersion(); }; #endif // TST_BLACKBOXAPPLE_H diff --git a/tests/auto/blackbox/tst_clangdb.cpp b/tests/auto/blackbox/tst_clangdb.cpp index b1b03dbc3..566082211 100644 --- a/tests/auto/blackbox/tst_clangdb.cpp +++ b/tests/auto/blackbox/tst_clangdb.cpp @@ -46,7 +46,6 @@ using qbs::InstallOptions; using qbs::Internal::HostOsInfo; -using qbs::Internal::Version; int TestClangDb::runProcess(const QString &exec, const QStringList &args, QByteArray &stdErr, QByteArray &stdOut) @@ -78,15 +77,15 @@ int TestClangDb::runProcess(const QString &exec, const QStringList &args, QByteA return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1; } -Version TestClangDb::clangVersion() +qbs::Version TestClangDb::clangVersion() { QByteArray stdErr; QByteArray stdOut; if (runProcess("clang-check", QStringList("--version"), stdErr, stdOut) != 0) - return Version(); + return qbs::Version(); stdOut.remove(0, stdOut.indexOf("LLVM version ") + 13); stdOut.truncate(stdOut.indexOf('\n')); - return Version::fromString(QString::fromLocal8Bit(stdOut)); + return qbs::Version::fromString(QString::fromLocal8Bit(stdOut)); } @@ -195,7 +194,7 @@ void TestClangDb::checkClangDetectsSourceCodeProblems() // Older clang versions do not support the "arguments" array in the compilation database. // Should we really want to support them, we would have to fall back to "command" instead. - if (clangVersion() < Version(3, 7)) + if (clangVersion() < qbs::Version(3, 7)) QSKIP("This test requires clang-check to be based on at least LLVM 3.7.0."); // clang-check.exe does not understand MSVC command-line syntax diff --git a/tests/auto/blackbox/tst_clangdb.h b/tests/auto/blackbox/tst_clangdb.h index 16da83414..6122e636d 100644 --- a/tests/auto/blackbox/tst_clangdb.h +++ b/tests/auto/blackbox/tst_clangdb.h @@ -51,7 +51,7 @@ private slots: private: int runProcess(const QString &exec, const QStringList &args, QByteArray &stdErr, QByteArray &stdOut); - qbs::Internal::Version clangVersion(); + qbs::Version clangVersion(); const QString projectDir; const QString projectFileName; |