diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2021-03-02 17:42:50 +0300 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2021-07-27 14:02:06 +0000 |
commit | 0d19ce31ef01e1884fd7ef8d1b5945e5b082d10e (patch) | |
tree | f899df1b6c94672838c8356e2c140d7a9de96741 | |
parent | e1f27a9773853c60c9dcefe44d5a6f056e32633b (diff) | |
download | qbs-0d19ce31ef01e1884fd7ef8d1b5945e5b082d10e.tar.gz |
Always build with project file updates support
Since QtGui dependency was removed, there is no reason not to
Change-Id: Ib8975451f3c36a77e22a077bba18b5659f414767
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r-- | .github/workflows/release.yml | 3 | ||||
-rw-r--r-- | cmake/QbsBuildConfig.cmake | 7 | ||||
-rw-r--r-- | doc/qbs.qdoc | 9 | ||||
-rwxr-xr-x | scripts/build-qbs-with-cmake.sh | 1 | ||||
-rwxr-xr-x | scripts/build-qbs-with-qbs.sh | 1 | ||||
-rwxr-xr-x | scripts/build-qbs-with-qmake.sh | 1 | ||||
-rwxr-xr-x | scripts/run-analyzer.sh | 1 | ||||
-rw-r--r-- | src/app/qbs/session.cpp | 7 | ||||
-rw-r--r-- | src/lib/corelib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/lib/corelib/api/api.pri | 19 | ||||
-rw-r--r-- | src/lib/corelib/api/project.cpp | 9 | ||||
-rw-r--r-- | src/lib/corelib/api/project.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/corelib.qbs | 10 | ||||
-rw-r--r-- | src/lib/corelib/use_corelib.pri | 1 | ||||
-rw-r--r-- | src/lib/corelib/use_installed_corelib.pri | 1 | ||||
-rw-r--r-- | tests/auto/api/api.pro | 1 | ||||
-rw-r--r-- | tests/auto/api/api.qbs | 2 | ||||
-rw-r--r-- | tests/auto/api/tst_api.cpp | 4 | ||||
-rw-r--r-- | tests/auto/api/tst_api.h | 2 |
19 files changed, 11 insertions, 72 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2eb5fbe7f..41b1ae88d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,6 @@ jobs: options: 'qbs.installPrefix:"" modules.cpp.compilerWrapper:ccache modules.qbsbuildconfig.enableAddressSanitizer:false - modules.qbsbuildconfig.enableProjectFileUpdates:false modules.qbsbuildconfig.enableUnitTests:false modules.qbsbuildconfig.enableBundledQt:true', script: './scripts/build-qbs-with-qbs.sh', @@ -71,7 +70,6 @@ jobs: qbs.installPrefix:"" modules.cpp.compilerWrapper:ccache modules.qbsbuildconfig.enableUnitTests:false - modules.qbsbuildconfig.enableProjectFileUpdates:false modules.qbsbuildconfig.enableAddressSanitizer:false modules.qbsbuildconfig.enableBundledQt:true WITH_TESTS: 0 @@ -156,7 +154,6 @@ jobs: qbs.buildVariant:release modules.cpp.compilerWrapper:clcache modules.qbsbuildconfig.enableBundledQt:true - modules.qbsbuildconfig.enableProjectFileUpdates:false modules.qbsbuildconfig.enableUnitTests:false modules.cpp.treatWarningsAsErrors:true project.withDocumentation:true diff --git a/cmake/QbsBuildConfig.cmake b/cmake/QbsBuildConfig.cmake index 8bdfec77e..f0861010a 100644 --- a/cmake/QbsBuildConfig.cmake +++ b/cmake/QbsBuildConfig.cmake @@ -1,6 +1,5 @@ option(WITH_TESTS "Build Tests" ON) option(WITH_UNIT_TESTS "Build Unit Tests" OFF) -option(WITH_PROJECT_FILE_UPDATES "Enable project file updates support" ON) option(INSTALL_PUBLIC_HEADERS "Whether to install public headers" ON) option(QBS_ENABLE_RPATH "Whether to enable RPATH" ON) option(QBS_USE_BUNDLED_QT_SCRIPT "Whether to use bundled QtScript module" OFF) @@ -74,12 +73,6 @@ else() set(QBS_UNIT_TESTS_DEFINES "") endif() -if(WITH_PROJECT_FILE_UPDATES) - set(QBS_PROJECT_FILE_UPDATES_DEFINES "QBS_ENABLE_PROJECT_FILE_UPDATES") -else() - set(QBS_PROJECT_FILE_UPDATES_DEFINES "") -endif() - file(RELATIVE_PATH QBS_RELATIVE_LIBEXEC_PATH "/${QBS_APP_INSTALL_DIR}" "/${QBS_LIBEXEC_INSTALL_DIR}") file(RELATIVE_PATH QBS_RELATIVE_SEARCH_PATH "/${QBS_APP_INSTALL_DIR}" "/${QBS_RESOURCES_INSTALL_BASE}") file(RELATIVE_PATH QBS_RELATIVE_PLUGINS_PATH "/${QBS_APP_INSTALL_DIR}" "/${QBS_PLUGINS_INSTALL_BASE}") diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 656a1245d..2e14e8572 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -513,8 +513,6 @@ \header \li Option \li Notes \li Default value \row \li WITH_TESTS \li Enable autotests. \li \c ON \row \li WITH_UNIT_TESTS \li Enable additional autotests. \li \c OFF - \row \li WITH_PROJECT_FILE_UPDATES \li Enable API for updating project files. This - implies a dependency to the QtGui module. \li \c OFF \row \li INSTALL_PUBLIC_HEADERS \li Whether to install public headers. \li \c ON \endtable @@ -558,8 +556,6 @@ \row \li qbs_no_dev_install \li Exclude header files from installation, that is, perform a non-developer build. \row \li qbs_no_man_install \li Exclude the man page from installation. - \row \li qbs_enable_project_file_updates \li Enable API for updating project files. This - implies a dependency to the Qt GUI module. \row \li qbs_use_bundled_qtscript \li Use the bundled QtScript library. \endtable @@ -632,11 +628,6 @@ \li Enable additional autotests. Enabling this option will export some symbols that would otherwise be private. \row - \li enableProjectFileUpdates - \li \c false - \li Enable API for updating project files. This is required for an IDE and implies a - dependency to the Qt GUI module that would not be needed for the \QBS command-line tool. - \row \li enableRPath \li \c true \li Use this property to disable the use of rpath. This can be used when packaging \QBS diff --git a/scripts/build-qbs-with-cmake.sh b/scripts/build-qbs-with-cmake.sh index c4c954fd6..820f30303 100755 --- a/scripts/build-qbs-with-cmake.sh +++ b/scripts/build-qbs-with-cmake.sh @@ -47,7 +47,6 @@ export QBS_AUTOTEST_SETTINGS_DIR="${QBS_AUTOTEST_SETTINGS_DIR:-/tmp/qbs-settings BUILD_OPTIONS="\ -DWITH_UNIT_TESTS=1 \ - -DWITH_PROJECT_FILE_UPDATES=1 \ -DQBS_INSTALL_HTML_DOCS=1 \ -DQBS_INSTALL_QCH_DOCS=1 \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ diff --git a/scripts/build-qbs-with-qbs.sh b/scripts/build-qbs-with-qbs.sh index 32241a3a2..42d02c3cc 100755 --- a/scripts/build-qbs-with-qbs.sh +++ b/scripts/build-qbs-with-qbs.sh @@ -59,7 +59,6 @@ fi BUILD_OPTIONS="\ profile:${QBS_BUILD_PROFILE} \ modules.qbsbuildconfig.enableAddressSanitizer:true \ - modules.qbsbuildconfig.enableProjectFileUpdates:true \ modules.qbsbuildconfig.enableUnitTests:true \ modules.cpp.treatWarningsAsErrors:true \ modules.cpp.separateDebugInformation:true \ diff --git a/scripts/build-qbs-with-qmake.sh b/scripts/build-qbs-with-qmake.sh index 1e97d7695..69ea75a21 100755 --- a/scripts/build-qbs-with-qmake.sh +++ b/scripts/build-qbs-with-qmake.sh @@ -50,7 +50,6 @@ export QBS_AUTOTEST_SETTINGS_DIR="${QBS_AUTOTEST_SETTINGS_DIR:-/tmp/qbs-settings # qmake -r qbs.pro \ CONFIG+=qbs_enable_unit_tests \ - CONFIG+=qbs_enable_project_file_updates \ ${BUILD_OPTIONS} make -j $(nproc --all) make docs diff --git a/scripts/run-analyzer.sh b/scripts/run-analyzer.sh index 49f21c402..4293883a1 100755 --- a/scripts/run-analyzer.sh +++ b/scripts/run-analyzer.sh @@ -61,7 +61,6 @@ CPU_COUNT=$("$(dirname "$0")"/cpu-count.sh) BUILD_OPTIONS="\ ${QBS_BUILD_PROFILE:+profile:${QBS_BUILD_PROFILE}} \ - modules.qbsbuildconfig.enableProjectFileUpdates:true \ modules.cpp.treatWarningsAsErrors:true \ modules.qbs.buildVariant:release \ project.withTests:false \ diff --git a/src/app/qbs/session.cpp b/src/app/qbs/session.cpp index 9272ce231..5a1fe145d 100644 --- a/src/app/qbs/session.cpp +++ b/src/app/qbs/session.cpp @@ -399,7 +399,6 @@ void Session::addFiles(const QJsonObject &request) } ErrorInfo error; QStringList failedFiles; -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES for (const QString &filePath : data.filePaths) { const ErrorInfo e = m_project.addFiles(data.product, data.group, {filePath}); if (e.hasError()) { @@ -408,7 +407,6 @@ void Session::addFiles(const QJsonObject &request) failedFiles.push_back(filePath); } } -#endif QJsonObject reply; reply.insert(StringConstants::type(), QLatin1String("files-added")); insertErrorInfoIfNecessary(reply, error); @@ -435,7 +433,6 @@ void Session::removeFiles(const QJsonObject &request) } ErrorInfo error; QStringList failedFiles; -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES for (const QString &filePath : data.filePaths) { const ErrorInfo e = m_project.removeFiles(data.product, data.group, {filePath}); if (e.hasError()) { @@ -444,7 +441,6 @@ void Session::removeFiles(const QJsonObject &request) failedFiles.push_back(filePath); } } -#endif QJsonObject reply; reply.insert(StringConstants::type(), QLatin1String("files-removed")); insertErrorInfoIfNecessary(reply, error); @@ -656,9 +652,6 @@ Session::FileUpdateData Session::prepareFileUpdate(const QJsonObject &request) data.error = tr("Cannot update the list of source files while a job is running."); if (!m_project.isValid()) data.error = tr("No valid project. You need to resolve first."); -#ifndef QBS_ENABLE_PROJECT_FILE_UPDATES - data.error = ErrorInfo(tr("Project file updates are not enabled in this build of qbs.")); -#endif return data; } diff --git a/src/lib/corelib/CMakeLists.txt b/src/lib/corelib/CMakeLists.txt index 06e725ab4..2a38a4943 100644 --- a/src/lib/corelib/CMakeLists.txt +++ b/src/lib/corelib/CMakeLists.txt @@ -421,8 +421,6 @@ add_qbs_library(qbscore "QBS_RELATIVE_LIBEXEC_PATH=\"${QBS_RELATIVE_LIBEXEC_PATH}\"" "QBS_LIBRARY" ${QBS_UNIT_TESTS_DEFINES} - PUBLIC_DEFINES - ${QBS_PROJECT_FILE_UPDATES_DEFINES} DEPENDS Qt${QT_VERSION_MAJOR}::CorePrivate Qt${QT_VERSION_MAJOR}::Network diff --git a/src/lib/corelib/api/api.pri b/src/lib/corelib/api/api.pri index ddb1171d4..69443dffc 100644 --- a/src/lib/corelib/api/api.pri +++ b/src/lib/corelib/api/api.pri @@ -38,15 +38,12 @@ SOURCES += \ INSTALLS += api_headers } -qbs_enable_project_file_updates { - HEADERS += \ - $$PWD/changeset.h \ - $$PWD/projectfileupdater.h \ - $$PWD/qmljsrewriter.h +HEADERS += \ + $$PWD/changeset.h \ + $$PWD/projectfileupdater.h \ + $$PWD/qmljsrewriter.h - SOURCES += \ - $$PWD/changeset.cpp \ - $$PWD/projectfileupdater.cpp \ - $$PWD/qmljsrewriter.cpp - DEFINES += QBS_ENABLE_PROJECT_FILE_UPDATES -} +SOURCES += \ + $$PWD/changeset.cpp \ + $$PWD/projectfileupdater.cpp \ + $$PWD/qmljsrewriter.cpp diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp index 65b9b4efa..23513564b 100644 --- a/src/lib/corelib/api/project.cpp +++ b/src/lib/corelib/api/project.cpp @@ -39,13 +39,10 @@ #include "project.h" #include "project_p.h" -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES -#include "projectfileupdater.h" -#endif - #include "internaljobs.h" #include "jobs.h" #include "projectdata_p.h" +#include "projectfileupdater.h" #include "propertymap_p.h" #include "rulecommand_p.h" #include "runenvironment.h" @@ -343,7 +340,6 @@ void ProjectPrivate::setupInstallData(ArtifactData &artifact, } } -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES void ProjectPrivate::addGroup(const ProductData &product, const QString &groupName) { if (groupName.isEmpty()) @@ -520,7 +516,6 @@ void ProjectPrivate::removeGroup(const ProductData &product, const GroupData &gr remover.apply(); } -#endif // QBS_ENABLE_PROJECT_FILE_UPDATES void ProjectPrivate::prepareChangeToProject() { @@ -1057,7 +1052,6 @@ Project::BuildGraphInfo Project::getBuildGraphInfo() const return info; } -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES /*! * \brief Adds a new empty group to the given product. * Returns an \c ErrorInfo object for which \c hasError() is false in case of a success @@ -1155,6 +1149,5 @@ ErrorInfo Project::removeGroup(const ProductData &product, const GroupData &grou return errorInfo; } } -#endif // QBS_ENABLE_PROJECT_FILE_UPDATES } // namespace qbs diff --git a/src/lib/corelib/api/project.h b/src/lib/corelib/api/project.h index 9000d6548..380806f3a 100644 --- a/src/lib/corelib/api/project.h +++ b/src/lib/corelib/api/project.h @@ -159,14 +159,12 @@ public: BuildGraphInfo getBuildGraphInfo() const; -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES ErrorInfo addGroup(const ProductData &product, const QString &groupName); ErrorInfo addFiles(const ProductData &product, const GroupData &group, const QStringList &filePaths); ErrorInfo removeFiles(const ProductData &product, const GroupData &group, const QStringList &filePaths); ErrorInfo removeGroup(const ProductData &product, const GroupData &group); -#endif // QBS_ENABLE_PROJECT_FILE_UPDATES private: Project(const Internal::TopLevelProjectPtr &internalProject, const Internal::Logger &logger); diff --git a/src/lib/corelib/corelib.qbs b/src/lib/corelib/corelib.qbs index 65644ea32..cece18126 100644 --- a/src/lib/corelib/corelib.qbs +++ b/src/lib/corelib/corelib.qbs @@ -24,8 +24,6 @@ QbsLibrary { ".", "../.." // for the plugin headers ]) - property stringList projectFileUpdateDefines: - qbsbuildconfig.enableProjectFileUpdates ? ["QBS_ENABLE_PROJECT_FILE_UPDATES"] : [] property stringList enableUnitTestsDefines: qbsbuildconfig.enableUnitTests ? ["QBS_ENABLE_UNIT_TESTS"] : [] property stringList systemSettingsDirDefines: qbsbuildconfig.systemSettingsDir @@ -33,8 +31,7 @@ QbsLibrary { cpp.defines: base.concat([ "QBS_RELATIVE_LIBEXEC_PATH=" + Utilities.cStringQuote(qbsbuildconfig.relativeLibexecPath), "QBS_VERSION=" + Utilities.cStringQuote(version), - ]).concat(projectFileUpdateDefines).concat(enableUnitTestsDefines) - .concat(systemSettingsDirDefines) + ]).concat(enableUnitTestsDefines).concat(systemSettingsDirDefines) Properties { condition: qbs.targetOS.contains("windows") @@ -55,7 +52,6 @@ QbsLibrary { } Group { name: "project file updating" - condition: qbsbuildconfig.enableProjectFileUpdates prefix: "api/" files: [ "changeset.cpp", @@ -530,8 +526,4 @@ QbsLibrary { qbs.install: qbsbuildconfig.installApiHeaders qbs.installDir: headerInstallPrefix } - Export { - Depends { name: "cpp" } - cpp.defines: base.concat(exportingProduct.projectFileUpdateDefines) - } } diff --git a/src/lib/corelib/use_corelib.pri b/src/lib/corelib/use_corelib.pri index c674ee664..a0bb90e8b 100644 --- a/src/lib/corelib/use_corelib.pri +++ b/src/lib/corelib/use_corelib.pri @@ -43,5 +43,4 @@ INCLUDEPATH += \ CONFIG(static, static|shared) { DEFINES += QBS_STATIC_LIB } -qbs_enable_project_file_updates:DEFINES += QBS_ENABLE_PROJECT_FILE_UPDATES qbs_enable_unit_tests:DEFINES += QBS_ENABLE_UNIT_TESTS diff --git a/src/lib/corelib/use_installed_corelib.pri b/src/lib/corelib/use_installed_corelib.pri index 4ff72414d..48e020c7b 100644 --- a/src/lib/corelib/use_installed_corelib.pri +++ b/src/lib/corelib/use_installed_corelib.pri @@ -34,5 +34,4 @@ INCLUDEPATH += $${PWD} CONFIG(static, static|shared) { DEFINES += QBS_STATIC_LIB } -qbs_enable_project_file_updates:DEFINES += QBS_ENABLE_PROJECT_FILE_UPDATES qbs_enable_unit_tests:DEFINES += QBS_ENABLE_UNIT_TESTS diff --git a/tests/auto/api/api.pro b/tests/auto/api/api.pro index d9c42e7bb..36dcec237 100644 --- a/tests/auto/api/api.pro +++ b/tests/auto/api/api.pro @@ -13,7 +13,6 @@ isEmpty(QBS_RELATIVE_SEARCH_PATH):QBS_RELATIVE_SEARCH_PATH=.. DEFINES += QBS_RELATIVE_LIBEXEC_PATH=\\\"$${QBS_RELATIVE_LIBEXEC_PATH}\\\" DEFINES += QBS_RELATIVE_PLUGINS_PATH=\\\"$${QBS_RELATIVE_PLUGINS_PATH}\\\" DEFINES += QBS_RELATIVE_SEARCH_PATH=\\\"$${QBS_RELATIVE_SEARCH_PATH}\\\" -qbs_enable_project_file_updates:DEFINES += QBS_ENABLE_PROJECT_FILE_UPDATES include(../auto.pri) diff --git a/tests/auto/api/api.qbs b/tests/auto/api/api.qbs index 09e0af7dc..21ff86a90 100644 --- a/tests/auto/api/api.qbs +++ b/tests/auto/api/api.qbs @@ -9,7 +9,7 @@ QbsAutotest { "QBS_RELATIVE_LIBEXEC_PATH=" + Utilities.cStringQuote(qbsbuildconfig.relativeLibexecPath), "QBS_RELATIVE_SEARCH_PATH=" + Utilities.cStringQuote(qbsbuildconfig.relativeSearchPath), "QBS_RELATIVE_PLUGINS_PATH=" + Utilities.cStringQuote(qbsbuildconfig.relativePluginsPath) - ]).concat(qbsbuildconfig.enableProjectFileUpdates ? ["QBS_ENABLE_PROJECT_FILE_UPDATES"] : []) + ]) Group { name: "testdata" diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp index a51eb3e0c..ac37139a3 100644 --- a/tests/auto/api/tst_api.cpp +++ b/tests/auto/api/tst_api.cpp @@ -620,8 +620,6 @@ qbs::GroupData findGroup(const qbs::ProductData &product, const QString &name) return qbs::GroupData(); } -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES - static qbs::Project::ProductSelection defaultProducts() { return qbs::Project::ProductSelectionDefaultOnly; @@ -852,8 +850,6 @@ void TestApi::changeContent() QVERIFY2(!job->error().hasError(), qPrintable(job->error().toString())); } -#endif // QBS_ENABLE_PROJECT_FILE_UPDATES - void TestApi::commandExtraction() { qbs::SetupProjectParameters setupParams = defaultSetupParameters("/command-extraction"); diff --git a/tests/auto/api/tst_api.h b/tests/auto/api/tst_api.h index d6514e17c..cca6d4970 100644 --- a/tests/auto/api/tst_api.h +++ b/tests/auto/api/tst_api.h @@ -69,9 +69,7 @@ private slots: void buildProjectDryRun_data(); void buildSingleFile(); void canonicalToolchainList(); -#ifdef QBS_ENABLE_PROJECT_FILE_UPDATES void changeContent(); -#endif void changeDependentLib(); void checkOutputs(); void checkOutputs_data(); |