diff options
58 files changed, 470 insertions, 130 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..eeef3e0a2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/.gitignore export-ignore +/.gitattributes export-ignore diff --git a/doc/reference/items/artifact.qdoc b/doc/reference/items/artifact.qdoc new file mode 100644 index 000000000..f136e2201 --- /dev/null +++ b/doc/reference/items/artifact.qdoc @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +/*! + \contentspage list-of-items.html + \page artifact-item.html + \nextpage depends-item.html + \ingroup list-of-items + + \title Artifact Item + \brief Describes a file produced by a \c Rule or \c Transformer. + + An \c Artifact represents a single file produced by a \c Rule or \c Transformer. + + For example, if a rule produces three files, it needs to contain three Artifact items. + + \section1 Artifact Properties + + \table + \header + \li Property + \li Type + \li Default + \li Description + \row + \li condition + \li bool + \li true + \li Determines whether the target file will actually be produced. + \row + \li fileName + \li string + \li undefined + \li The file path of the target artifact. + \row + \li fileTags + \li list + \li empty list + \li The tags to attach to the target file. These can then be matched by a rule. + \endtable + +*/ diff --git a/doc/reference/items/depends.qdoc b/doc/reference/items/depends.qdoc new file mode 100644 index 000000000..2e60eed47 --- /dev/null +++ b/doc/reference/items/depends.qdoc @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +/*! + \contentspage list-of-items.html + \previouspage artifact-item.html + \page depends-item.html + \nextpage export-item.html + \ingroup list-of-items + + \title Depends Item + \brief Represents dependencies between between products and modules. + + A \c Depends item can appear inside a \l{Product Item} or \l{Module Item}. + + \section1 Depends Properties + + \table + \header + \li Property + \li Type + \li Default + \li Description + \row + \li condition + \li bool + \li true + \li Determines whether the dependency will actually be applied. + \row + \li name + \li string + \li undefined + \li The name of the dependent product or module. + \row + \li submodules + \li stringList + \li undefined + \li The submodules of \c module to depend on, if applicable. + \endtable + +*/ diff --git a/doc/reference/items/export.qdoc b/doc/reference/items/export.qdoc index 7e3f46b88..2c714c129 100644 --- a/doc/reference/items/export.qdoc +++ b/doc/reference/items/export.qdoc @@ -28,6 +28,7 @@ ****************************************************************************/ /*! \contentspage list-of-items.html + \previouspage depends-item.html \page export-item.html \nextpage filetagger-item.html \ingroup list-of-items diff --git a/doc/reference/items/module.qdoc b/doc/reference/items/module.qdoc index 864ce2b97..5a28266b4 100644 --- a/doc/reference/items/module.qdoc +++ b/doc/reference/items/module.qdoc @@ -30,7 +30,7 @@ \contentspage list-of-items.html \previouspage group-item.html \page module-item.html - \nextpage product-item.html + \nextpage probe-item.html \ingroup list-of-items \title Module Item diff --git a/doc/reference/items/probe.qdoc b/doc/reference/items/probe.qdoc new file mode 100644 index 000000000..17fdfac42 --- /dev/null +++ b/doc/reference/items/probe.qdoc @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +/*! + \contentspage list-of-items.html + \previouspage module-item.html + \page probe-item.html + \nextpage product-item.html + \ingroup list-of-items + + \title Probe Item + \brief Locates files outside the project. + + A \c Probe item can appear inside a \l{Product Item} and is run prior to building products in + order to locate dependent headers, libraries, and other files outside the project directory + whose locations are not known ahead of time. \c Probes are similar to configure scripts. + + \section1 Probe Properties + + \table + \header + \li Property + \li Type + \li Default + \li Description + \row + \li condition + \li bool + \li true + \li Determines whether the probe will actually be run. + \row + \li found + \li bool + \li undefined + \li Indicates whether the probe was run successfully. Set by \c configure. + \row + \li configure + \li script + \li undefined + \li Script that is executed when the probe is run. + \endtable + +*/ diff --git a/doc/reference/items/product.qdoc b/doc/reference/items/product.qdoc index 8015f0269..f5203f70c 100644 --- a/doc/reference/items/product.qdoc +++ b/doc/reference/items/product.qdoc @@ -28,7 +28,7 @@ ****************************************************************************/ /*! \contentspage list-of-items.html - \previouspage module-item.html + \previouspage probe-item.html \page product-item.html \nextpage project-item.html \ingroup list-of-items @@ -124,6 +124,12 @@ \li See the documentation of the \l {Project Item} property of the same name. Setting this property here will overwrite the default value inherited from the project, so use the \c concat() function if you want to add something. + \row + \li version + \li string + \li undefined + \li The version number of the product. Used in shared library filenames and generated + Info.plist files in OS X and iOS application and framework bundles, for example. \endtable The following properties are automatically set by qbs and usually are not changed by the user: diff --git a/doc/reference/items/project.qdoc b/doc/reference/items/project.qdoc index 5d8ca35cc..e05bc37f2 100644 --- a/doc/reference/items/project.qdoc +++ b/doc/reference/items/project.qdoc @@ -30,7 +30,7 @@ \contentspage list-of-items.html \previouspage product-item.html \page project-item.html - \nextpage subproject-item.html + \nextpage properties-item.html \ingroup list-of-items \title Project Item @@ -77,7 +77,7 @@ \li stringList \li empty \li These paths are searched for imports and modules in addition to the ones listed - in \c{preferences.qbsPath}. + in \c{preferences.qbsSearchPaths}. All products in the project inherit this value by default. \row \li references diff --git a/doc/reference/items/properties.qdoc b/doc/reference/items/properties.qdoc index ba3f0ae06..c10134e9e 100644 --- a/doc/reference/items/properties.qdoc +++ b/doc/reference/items/properties.qdoc @@ -28,9 +28,9 @@ ****************************************************************************/ /*! \contentspage list-of-items.html - \previouspage subproject-item.html + \previouspage project-item.html \page properties-item.html - \nextpage rule-item.html + \nextpage propertyoptions-item.html \ingroup list-of-items \title Properties Item diff --git a/doc/reference/items/propertyoptions.qdoc b/doc/reference/items/propertyoptions.qdoc new file mode 100644 index 000000000..5dbb94df8 --- /dev/null +++ b/doc/reference/items/propertyoptions.qdoc @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +/*! + \contentspage list-of-items.html + \previouspage properties-item.html + \page propertyoptions-item.html + \nextpage rule-item.html + \ingroup list-of-items + + \title PropertyOptions Item + \brief Provides inline documentation for properties within product and module items. + + A \c PropertyOptions item can appear inside a \l{Product Item} or \l{Module Item} to provide + inline documentation for properties. + + \section1 PropertyOptions Properties + + \table + \header + \li Property + \li Type + \li Default + \li Description + \row + \li allowedValues + \li stringList + \li undefined + \li A list of the values permitted by the property. \c{undefined} indicates that any value + is permitted. + \row + \li description + \li string + \li undefined + \li A brief description of the property. + \row + \li name + \li string + \li undefined + \li The name of the property to document. + \endtable + +*/ diff --git a/doc/reference/items/rule.qdoc b/doc/reference/items/rule.qdoc index 56244ced6..aca2acbb9 100644 --- a/doc/reference/items/rule.qdoc +++ b/doc/reference/items/rule.qdoc @@ -28,9 +28,9 @@ ****************************************************************************/ /*! \contentspage list-of-items.html - \previouspage properties-item.html + \previouspage propertyoptions-item.html \page rule-item.html - \nextpage transformer-item.html + \nextpage subproject-item.html \ingroup list-of-items \title Rule Item @@ -131,6 +131,11 @@ script. Also, each output artifact of this rule will be dependent on those artifacts. \row + \li condition + \li bool + \li true + \li If true, the rule is enabled, otherwise it does nothing. + \row \li explicitlyDependsOn \li string list \li undefined diff --git a/doc/reference/items/subproject.qdoc b/doc/reference/items/subproject.qdoc index 64aaa86fe..c89807ded 100644 --- a/doc/reference/items/subproject.qdoc +++ b/doc/reference/items/subproject.qdoc @@ -28,9 +28,9 @@ ****************************************************************************/ /*! \contentspage list-of-items.html - \previouspage project-item.html + \previouspage rule-item.html \page subproject-item.html - \nextpage properties-item.html + \nextpage transformer-item.html \ingroup list-of-items \title SubProject Item diff --git a/doc/reference/items/transformer.qdoc b/doc/reference/items/transformer.qdoc index 4320a2cb4..17939d80f 100644 --- a/doc/reference/items/transformer.qdoc +++ b/doc/reference/items/transformer.qdoc @@ -28,7 +28,7 @@ ****************************************************************************/ /*! \contentspage list-of-items.html - \previouspage rule-item.html + \previouspage subproject-item.html \page transformer-item.html \ingroup list-of-items diff --git a/doc/reference/jsextensions/jsextensions-general.qdoc b/doc/reference/jsextensions/jsextensions-general.qdoc new file mode 100644 index 000000000..d503f6c8c --- /dev/null +++ b/doc/reference/jsextensions/jsextensions-general.qdoc @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +/*! + \contentspage index.html + \page jsextensions-general.html + \ingroup list-of-builtin-services + + \title General Services + \brief Provides various operations. + + These are operations that do not fit into any of the other categories. + They are automatically available in any qbs project file. + + \section1 Available Operations + + \section2 getenv + \code + qbs.getenv(name) + \endcode + Tries to find a variable with the given name in the build environment and returns its value. If + no such variable could be found, \c undefined is returned. + + \section2 getHostOS + \code + qbs.getHostOS(name) + \endcode + Returns the name of the operating system on which qbs is running. + \note Do not confuse this with the \c{qbs.targetOS} property, which represents the operating + system on which the binaries produced by qbs will run. +*/ diff --git a/tests/manual/lib_subdir/app/app.qbs b/examples/app-and-lib/app/app.qbs index b4e5bf529..01800e744 100644 --- a/tests/manual/lib_subdir/app/app.qbs +++ b/examples/app-and-lib/app/app.qbs @@ -2,9 +2,9 @@ import qbs 1.0 Product { type: "application" - name : "HelloWorld" + name : "app-and-lib-app" files : [ "main.cpp" ] Depends { name: "cpp" } - Depends { name: "lol" } + Depends { name: "app-and-lib-lib" } } diff --git a/tests/manual/lib_subdir/app/main.cpp b/examples/app-and-lib/app/main.cpp index e7d24bdc3..e7d24bdc3 100644 --- a/tests/manual/lib_subdir/app/main.cpp +++ b/examples/app-and-lib/app/main.cpp diff --git a/tests/manual/lib_subdir/lib_subdir.qbs b/examples/app-and-lib/app_and_lib.qbs index 56edf28a4..56edf28a4 100644 --- a/tests/manual/lib_subdir/lib_subdir.qbs +++ b/examples/app-and-lib/app_and_lib.qbs diff --git a/tests/manual/lib_subdir/lib/lib.cpp b/examples/app-and-lib/lib/lib.cpp index 01c397614..fed239535 100644 --- a/tests/manual/lib_subdir/lib/lib.cpp +++ b/examples/app-and-lib/lib/lib.cpp @@ -35,6 +35,6 @@ int bla() { - puts("Hello WOrld!"); + puts("Hello World!"); return 2; } diff --git a/tests/manual/lib_subdir/lib/lib.qbs b/examples/app-and-lib/lib/lib.qbs index 036746692..32d985294 100644 --- a/tests/manual/lib_subdir/lib/lib.qbs +++ b/examples/app-and-lib/lib/lib.qbs @@ -2,7 +2,7 @@ import qbs 1.0 Product { type: "staticlibrary" - name: "lol" + name: "app-and-lib-lib" files: [ "lib.cpp" ] cpp.defines: ['CRUCIAL_DEFINE'] Depends { name: 'cpp' } diff --git a/examples/examples.qbs b/examples/examples.qbs index 7eb5f70f8..567d51b9a 100644 --- a/examples/examples.qbs +++ b/examples/examples.qbs @@ -2,6 +2,7 @@ import qbs Project { references: [ + "app-and-lib/app_and_lib.qbs", "cocoa-application/CocoaApplication.qbs", "collidingmice/collidingmice.qbs", "helloworld-complex/hello.qbs", @@ -5,8 +5,8 @@ Project { property bool enableRPath: true property bool installApiHeaders: true property bool withExamples: true - property path libInstallDir: qbs.targetOS.contains("windows") ? "bin" : "lib" - property path libRPaths: { + property string libInstallDir: qbs.targetOS.contains("windows") ? "bin" : "lib" + property string libRPaths: { if (!project.enableRPath) return undefined; if (qbs.targetOS.contains("linux")) @@ -14,7 +14,7 @@ Project { if (qbs.targetOS.contains("osx")) return ["@loader_path/../lib"] } - property path resourcesInstallDir: "" + property string resourcesInstallDir: "" references: [ "doc/doc.qbs", diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index 4b6ec8870..e6841e499 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -185,7 +185,7 @@ Module { FileTagger { pattern: "*.C" - fileTags: ["c"] + fileTags: ["cpp"] } FileTagger { diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index d07c6e69d..6186d90eb 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -148,6 +148,9 @@ CppModule { for (var i = 0; i < symlinkCount; ++i) { cmd = new Command("ln", ["-sf", FileInfo.fileName(libFilePath), links[i].fileName]); + cmd.description = "filegen"; + cmd.description = "creating symbolic link '" + + FileInfo.fileName(links[i].fileName) + "'"; cmd.workingDirectory = FileInfo.path(libFilePath); commands.push(cmd); } diff --git a/src/app/config-ui/config-ui.pro b/src/app/config-ui/config-ui.pro index 0d69b7ea9..3581ef42a 100644 --- a/src/app/config-ui/config-ui.pro +++ b/src/app/config-ui/config-ui.pro @@ -1,5 +1,6 @@ include(../app.pri) +CONFIG -= console QT += gui greaterThan(QT_MAJOR_VERSION, 4):QT += widgets diff --git a/src/app/config-ui/config-ui.qbs b/src/app/config-ui/config-ui.qbs index b37ae7865..b8856d795 100644 --- a/src/app/config-ui/config-ui.qbs +++ b/src/app/config-ui/config-ui.qbs @@ -4,6 +4,7 @@ import "../apptemplate.qbs" as QbsApp QbsApp { Depends { name: "Qt.widgets" } name: "qbs-config-ui" + consoleApplication: false files: [ "main.cpp", "mainwindow.cpp", diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp index bc9b9762e..001754615 100644 --- a/src/app/qbs/commandlinefrontend.cpp +++ b/src/app/qbs/commandlinefrontend.cpp @@ -130,8 +130,17 @@ void CommandLineFrontend::start() if (!m_parser.buildBeforeInstalling()) params.setRestoreBehavior(SetupProjectParameters::RestoreOnly); foreach (const QVariantMap &buildConfig, m_parser.buildConfigurations()) { - params.setOverriddenValues(buildConfig); - params.setBuildConfiguration(buildConfig); + QVariantMap baseConfig; + QVariantMap userConfig = buildConfig; + QString buildVariantKey = QLatin1String("qbs.buildVariant"); + baseConfig.insert(buildVariantKey, userConfig.take(buildVariantKey)); + const QVariantMap::Iterator it = userConfig.find(QLatin1String("qbs.profile")); + if (it != userConfig.end()) { + baseConfig.insert(it.key(), it.value()); + userConfig.erase(it); + } + params.setBuildConfiguration(baseConfig); + params.setOverriddenValues(userConfig); const ErrorInfo err = params.expandBuildConfiguration(m_settings); if (err.hasError()) throw err; diff --git a/src/lib/language/language.h b/src/lib/language/language.h index a127248fa..a467adc4d 100644 --- a/src/lib/language/language.h +++ b/src/lib/language/language.h @@ -45,6 +45,7 @@ #include <QDataStream> #include <QHash> #include <QProcessEnvironment> +#include <QRegExp> #include <QScriptProgram> #include <QScriptValue> #include <QScopedPointer> diff --git a/src/lib/language/loader.cpp b/src/lib/language/loader.cpp index fa047942b..29c080b60 100644 --- a/src/lib/language/loader.cpp +++ b/src/lib/language/loader.cpp @@ -104,9 +104,7 @@ TopLevelProjectPtr Loader::loadProject(const SetupProjectParameters ¶meters) parameters.overriddenValuesTree(), parameters.buildConfigurationTree(), true); - const TopLevelProjectPtr project = m_projectResolver->resolve(loadResult, - parameters.buildRoot(), parameters.overriddenValuesTree(), - parameters.buildConfigurationTree()); + const TopLevelProjectPtr project = m_projectResolver->resolve(loadResult, parameters); // E.g. if the top-level project is disabled. if (m_progressObserver) diff --git a/src/lib/language/moduleloader.cpp b/src/lib/language/moduleloader.cpp index 67a0bc0f6..c9a8c014b 100644 --- a/src/lib/language/moduleloader.cpp +++ b/src/lib/language/moduleloader.cpp @@ -156,6 +156,7 @@ private: { if (!value->item()->isModuleInstance() && !m_validItemPropertyNamesPerItem.value(m_parentItem).contains(m_currentName) + && m_parentItem->file() && !m_parentItem->file()->idScope()->hasProperty(m_currentName)) { throw ErrorInfo(Tr::tr("Item '%1' is not declared. " "Did you forget to add a Depends item?").arg(m_currentName), diff --git a/src/lib/language/projectresolver.cpp b/src/lib/language/projectresolver.cpp index f64978f66..ef6ecc94b 100644 --- a/src/lib/language/projectresolver.cpp +++ b/src/lib/language/projectresolver.cpp @@ -101,18 +101,15 @@ static void checkForDuplicateProductNames(const TopLevelProjectConstPtr &project } TopLevelProjectPtr ProjectResolver::resolve(ModuleLoaderResult &loadResult, - const QString &buildRoot, const QVariantMap &overriddenProperties, - const QVariantMap &buildConfiguration) + const SetupProjectParameters &setupParameters) { - QBS_ASSERT(FileInfo::isAbsolute(buildRoot), return TopLevelProjectPtr()); + QBS_ASSERT(FileInfo::isAbsolute(setupParameters.buildRoot()), return TopLevelProjectPtr()); if (m_logger.traceEnabled()) m_logger.qbsTrace() << "[PR] resolving " << loadResult.root->file()->filePath(); ProjectContext projectContext; projectContext.loadResult = &loadResult; - m_buildRoot = buildRoot; - m_overriddenProperties = overriddenProperties; - m_buildConfiguration = buildConfiguration; + m_setupParams = setupParameters; m_productContext = 0; m_moduleContext = 0; resolveTopLevelProject(loadResult.root, &projectContext); @@ -126,7 +123,7 @@ void ProjectResolver::checkCancelation() const { if (m_progressObserver && m_progressObserver->canceled()) { throw ErrorInfo(Tr::tr("Project resolving canceled for configuration %1.") - .arg(TopLevelProject::deriveId(m_buildConfiguration))); + .arg(TopLevelProject::deriveId(m_setupParams.finalBuildConfigurationTree()))); } } @@ -182,8 +179,9 @@ void ProjectResolver::resolveTopLevelProject(Item *item, ProjectContext *project if (m_progressObserver) m_progressObserver->setMaximum(projectContext->loadResult->productInfos.count()); const TopLevelProjectPtr project = TopLevelProject::create(); - project->setBuildConfiguration(m_buildConfiguration); - project->buildDirectory = TopLevelProject::deriveBuildDirectory(m_buildRoot, project->id()); + project->setBuildConfiguration(m_setupParams.finalBuildConfigurationTree()); + project->buildDirectory + = TopLevelProject::deriveBuildDirectory(m_setupParams.buildRoot(), project->id()); projectContext->project = project; resolveProject(item, projectContext); project->usedEnvironment = m_engine->usedEnvironment(); @@ -298,7 +296,7 @@ void ProjectResolver::resolveProduct(Item *item, ProjectContext *projectContext) item->location()); } - ModuleLoader::overrideItemProperties(item, product->name, m_overriddenProperties); + ModuleLoader::overrideItemProperties(item, product->name, m_setupParams.overriddenValuesTree()); m_productsByName.insert(product->name, product); product->enabled = m_evaluator->boolValue(item, QLatin1String("condition")); product->additionalFileTags @@ -665,7 +663,8 @@ void ProjectResolver::resolveFileTagger(Item *item, ProjectContext *projectConte QList<FileTaggerConstPtr> &fileTaggers = m_productContext ? m_productContext->product->fileTaggers : projectContext->fileTaggers; FileTaggerPtr tagger = FileTagger::create( - QRegExp(m_evaluator->stringValue(item, QLatin1String("pattern"))), + QRegExp(m_evaluator->stringValue(item, QLatin1String("pattern")), Qt::CaseSensitive, + QRegExp::Wildcard), m_evaluator->fileTagsValue(item, "fileTags")); if (tagger->artifactExpression().isEmpty()) throw ErrorInfo(Tr::tr("FileTagger.pattern must not be empty."), item->location()); diff --git a/src/lib/language/projectresolver.h b/src/lib/language/projectresolver.h index b57a5a57e..645aeba77 100644 --- a/src/lib/language/projectresolver.h +++ b/src/lib/language/projectresolver.h @@ -34,6 +34,7 @@ #include "filetags.h" #include "language.h" #include <logging/logger.h> +#include <tools/setupprojectparameters.h> #include <QMap> #include <QSet> @@ -57,8 +58,8 @@ public: ~ProjectResolver(); void setProgressObserver(ProgressObserver *observer); - TopLevelProjectPtr resolve(ModuleLoaderResult &loadResult, const QString &buildRoot, - const QVariantMap &overriddenProperties, const QVariantMap &buildConfiguration); + TopLevelProjectPtr resolve(ModuleLoaderResult &loadResult, + const SetupProjectParameters &setupParameters); private: struct ProjectContext @@ -121,15 +122,13 @@ private: Logger m_logger; ScriptEngine *m_engine; ProgressObserver *m_progressObserver; - QString m_buildRoot; - QVariantMap m_overriddenProperties; - QVariantMap m_buildConfiguration; ProductContext *m_productContext; ModuleContext *m_moduleContext; QMap<QString, ResolvedProductPtr> m_productsByName; QHash<ResolvedProductPtr, Item *> m_productItemMap; mutable QHash<FileContextConstPtr, ResolvedFileContextPtr> m_fileContextMap; QMap<QString, QVariantMap> m_exports; + SetupProjectParameters m_setupParams; typedef void (ProjectResolver::*ItemFuncPtr)(Item *item, ProjectContext *projectContext); typedef QMap<QByteArray, ItemFuncPtr> ItemFuncMap; diff --git a/src/lib/lib.pro b/src/lib/lib.pro index e1ac1c256..14c24a083 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -59,7 +59,7 @@ win32 { !qbs_no_dev_install { qbs_h.files = qbs.h qbs_h.path = $${QBS_INSTALL_PREFIX}/include/qbs - use_pri.files = use_installed.pri + use_pri.files = use_installed.pri ../../qbs_version.pri use_pri.path = $${qbs_h.path} INSTALLS += qbs_h use_pri } diff --git a/src/lib/lib.qbs b/src/lib/lib.qbs index 5c38cef71..e30f142e9 100644 --- a/src/lib/lib.qbs +++ b/src/lib/lib.qbs @@ -321,7 +321,10 @@ Product { } Group { name: "use_installed.pri" - files: "use_installed.pri" + files: [ + "use_installed.pri", + "../../qbs_version.pri" + ] qbs.install: project.installApiHeaders qbs.installDir: headerInstallPrefix } @@ -338,7 +341,7 @@ Product { ] } Group { - fileTagsFilter: "dynamiclibrary" + fileTagsFilter: product.type.concat("dynamiclibrary_symlink") qbs.install: true qbs.installDir: project.libInstallDir } diff --git a/src/lib/tools/preferences.cpp b/src/lib/tools/preferences.cpp index 69366eb4d..f8ed01740 100644 --- a/src/lib/tools/preferences.cpp +++ b/src/lib/tools/preferences.cpp @@ -77,7 +77,17 @@ QString Preferences::shell() const */ QStringList Preferences::searchPaths(const QString &qbsRootPath) const { - return pathList(QLatin1String("qbsPath"), qbsRootPath + QLatin1String("/share/qbs")); + const QStringList searchPaths = pathList(QLatin1String("qbsSearchPaths"), + qbsRootPath + QLatin1String("/share/qbs")); + + // TODO: Remove in 1.2. + const QStringList deprecatedSearchPaths = getPreference(QLatin1String("qbsPath")).toString() + .split(Internal::HostOsInfo::pathListSeparator(), QString::SkipEmptyParts); + if (!deprecatedSearchPaths.isEmpty()) { + qDebug("Warning: preferences.qbsPath is deprecated, " + "use preferences.qbsSearchPaths instead."); + } + return deprecatedSearchPaths + searchPaths; } /*! diff --git a/src/lib/tools/propertyfinder.cpp b/src/lib/tools/propertyfinder.cpp index 4e5f32825..8d8c935d8 100644 --- a/src/lib/tools/propertyfinder.cpp +++ b/src/lib/tools/propertyfinder.cpp @@ -38,9 +38,8 @@ QVariantList PropertyFinder::propertyValues(const QVariantMap &properties, { m_moduleName = moduleName; m_key = key; - m_findOnlyOne = false; m_values.clear(); - findModuleValues(properties); + findModuleValues(properties, true); if (mergeType == DoMergeLists) mergeLists(&m_values); return m_values; @@ -51,15 +50,14 @@ QVariant PropertyFinder::propertyValue(const QVariantMap &properties, const QStr { m_moduleName = moduleName; m_key = key; - m_findOnlyOne = true; m_values.clear(); - findModuleValues(properties); + findModuleValues(properties, false); QBS_ASSERT(m_values.count() <= 1, return QVariant()); return m_values.isEmpty() ? QVariant() : m_values.first(); } -void PropertyFinder::findModuleValues(const QVariantMap &properties) +void PropertyFinder::findModuleValues(const QVariantMap &properties, bool searchRecursively) { QVariantMap moduleProperties = properties.value(QLatin1String("modules")).toMap(); @@ -72,10 +70,13 @@ void PropertyFinder::findModuleValues(const QVariantMap &properties) moduleProperties.erase(modIt); } + if (!searchRecursively) + return; + // These are the non-matching modules. for (QVariantMap::ConstIterator it = moduleProperties.constBegin(); - it != moduleProperties.constEnd() && (m_values.isEmpty() || !m_findOnlyOne); ++it) { - findModuleValues(it->toMap()); + it != moduleProperties.constEnd(); ++it) { + findModuleValues(it->toMap(), true); } } diff --git a/src/lib/tools/propertyfinder.h b/src/lib/tools/propertyfinder.h index d8da245df..206ef42c8 100644 --- a/src/lib/tools/propertyfinder.h +++ b/src/lib/tools/propertyfinder.h @@ -47,14 +47,13 @@ public: const QString &key); private: - void findModuleValues(const QVariantMap &properties); + void findModuleValues(const QVariantMap &properties, bool searchRecursively); void addToList(const QVariant &value); static void mergeLists(QVariantList *values); QString m_moduleName; QString m_key; QVariantList m_values; - bool m_findOnlyOne; }; } // namespace Internal diff --git a/src/lib/use.pri b/src/lib/use.pri index 28e6d9df3..7ac510712 100644 --- a/src/lib/use.pri +++ b/src/lib/use.pri @@ -15,12 +15,16 @@ unix { macx:QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../lib } +CONFIG(shared, static|shared) { + QBSCORELIBSUFFIX = $$QBS_VERSION_MAJ +} + win32 { CONFIG(debug, debug|release) { - QBSCORELIB = qbscored$$QBS_VERSION_MAJ + QBSCORELIB = qbscored$$QBSCORELIBSUFFIX } CONFIG(release, debug|release) { - QBSCORELIB = qbscore$$QBS_VERSION_MAJ + QBSCORELIB = qbscore$$QBSCORELIBSUFFIX } win32-msvc* { LIBS += /LIBPATH:$$QBSLIBDIR diff --git a/src/lib/use_installed.pri b/src/lib/use_installed.pri index 3129232db..4f9a4beea 100644 --- a/src/lib/use_installed.pri +++ b/src/lib/use_installed.pri @@ -1,3 +1,5 @@ +include(qbs_version.pri) + QT += script xml QBSLIBDIR=$${PWD}/../../lib @@ -7,12 +9,16 @@ unix { !disable_rpath:unix:QMAKE_LFLAGS += -Wl,-rpath,$${QBSLIBDIR} +CONFIG(shared, static|shared) { + QBSCORELIBSUFFIX = $$QBS_VERSION_MAJ +} + win32 { CONFIG(debug, debug|release) { - QBSCORELIB = qbscored + QBSCORELIB = qbscored$$QBSCORELIBSUFFIX } CONFIG(release, debug|release) { - QBSCORELIB = qbscore + QBSCORELIB = qbscore$$QBSCORELIBSUFFIX } win32-msvc* { LIBS += /LIBPATH:$$QBSLIBDIR diff --git a/tests/manual/productmoduledeps/lib1.cpp b/tests/auto/blackbox/testdata/exportSimple/lib1.cpp index 2760a9170..2760a9170 100644 --- a/tests/manual/productmoduledeps/lib1.cpp +++ b/tests/auto/blackbox/testdata/exportSimple/lib1.cpp diff --git a/tests/manual/productmoduledeps/main.cpp b/tests/auto/blackbox/testdata/exportSimple/main.cpp index b7ddf7215..b7ddf7215 100644 --- a/tests/manual/productmoduledeps/main.cpp +++ b/tests/auto/blackbox/testdata/exportSimple/main.cpp diff --git a/tests/manual/productmoduledeps/productmoduledeps.qbs b/tests/auto/blackbox/testdata/exportSimple/project.qbs index 1b665b880..1b665b880 100644 --- a/tests/manual/productmoduledeps/productmoduledeps.qbs +++ b/tests/auto/blackbox/testdata/exportSimple/project.qbs diff --git a/tests/manual/genmoc_cpp/bla.txt b/tests/auto/blackbox/testdata/fileTagger/bla.txt index 26185684a..26185684a 100644 --- a/tests/manual/genmoc_cpp/bla.txt +++ b/tests/auto/blackbox/testdata/fileTagger/bla.txt diff --git a/tests/manual/genmoc_cpp/moc_cpp.qbs b/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs index 681a93f28..681a93f28 100644 --- a/tests/manual/genmoc_cpp/moc_cpp.qbs +++ b/tests/auto/blackbox/testdata/fileTagger/moc_cpp.qbs diff --git a/tests/manual/objc/main.mm b/tests/auto/blackbox/testdata/objc/main.mm index 49b4f3915..49b4f3915 100644 --- a/tests/manual/objc/main.mm +++ b/tests/auto/blackbox/testdata/objc/main.mm diff --git a/tests/manual/objc/objc.qbs b/tests/auto/blackbox/testdata/objc/objc.qbs index b878097c4..b878097c4 100644 --- a/tests/manual/objc/objc.qbs +++ b/tests/auto/blackbox/testdata/objc/objc.qbs diff --git a/tests/auto/blackbox/testdata/proper quoting/main.cpp b/tests/auto/blackbox/testdata/proper quoting/main.cpp index 26e0cdc49..edc62cfcf 100644 --- a/tests/auto/blackbox/testdata/proper quoting/main.cpp +++ b/tests/auto/blackbox/testdata/proper quoting/main.cpp @@ -29,9 +29,6 @@ #include <stdio.h> -#define __stringify__(x) #x -#define stringify(x) __stringify__(x) - int bla(); int main() @@ -40,8 +37,6 @@ int main() printf(DEFINEWITHSPACE"\n"); printf(DEFINEWITHTAB"\n"); printf(DEFINEWITHBACKSLASH"\n"); - printf(stringify(DEFINEWITHBACKSLASHRAW)"\n"); return bla(); } - diff --git a/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs b/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs index 64a35b46b..c1db3c1b2 100644 --- a/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs +++ b/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs @@ -12,9 +12,7 @@ Project { 'DEFINEWITHSPACE="contains space"', 'DEFINEWITHTAB="contains\ttab"', 'DEFINEWITHBACKSLASH="backslash\\\\"', - 'DEFINEWITHBACKSLASHRAW=backslash\\\\' ] -// cpp.responseFileThreshold: 0 } Product { @@ -23,7 +21,6 @@ Project { files : [ "my static lib.cpp" ] Depends { name: "cpp" } Depends { name: "helper lib" } -// cpp.responseFileThreshold: 0 } Product { @@ -38,6 +35,5 @@ Project { Depends { name: "cpp" } cpp.includePaths: ['some helper'] } -// cpp.responseFileThreshold: 0 } } diff --git a/tests/manual/rc/main.cpp b/tests/auto/blackbox/testdata/rc/main.cpp index f5fab598e..f5fab598e 100644 --- a/tests/manual/rc/main.cpp +++ b/tests/auto/blackbox/testdata/rc/main.cpp diff --git a/tests/manual/rc/rc.qbs b/tests/auto/blackbox/testdata/rc/rc.qbs index 75502cf88..75502cf88 100644 --- a/tests/manual/rc/rc.qbs +++ b/tests/auto/blackbox/testdata/rc/rc.qbs diff --git a/tests/manual/rc/test.rc b/tests/auto/blackbox/testdata/rc/test.rc index a8e5fd39b..a8e5fd39b 100644 --- a/tests/manual/rc/test.rc +++ b/tests/auto/blackbox/testdata/rc/test.rc diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index ddebcce0e..116da31fa 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -431,6 +431,12 @@ void TestBlackbox::clean() QVERIFY(QFile(depExeFilePath).exists()); } +void TestBlackbox::exportSimple() +{ + QDir::setCurrent(testDataDir + "/exportSimple"); + QCOMPARE(runQbs(), 0); +} + void TestBlackbox::exportWithRecursiveDepends() { QDir::setCurrent(testDataDir + "/exportWithRecursiveDepends"); @@ -440,6 +446,21 @@ void TestBlackbox::exportWithRecursiveDepends() QCOMPARE(runQbs(params), 0); } +void TestBlackbox::fileTagger() +{ + QDir::setCurrent(testDataDir + "/fileTagger"); + QCOMPARE(runQbs(), 0); + QVERIFY(m_qbsStdout.contains("moc bla.cpp")); +} + +void TestBlackbox::rc() +{ + QDir::setCurrent(testDataDir + "/rc"); + QCOMPARE(runQbs(), 0); + const bool rcFileWasCompiled = m_qbsStdout.contains("compiling test.rc"); + QCOMPARE(rcFileWasCompiled, HostOsInfo::isWindowsHost()); +} + void TestBlackbox::renameProduct() { QDir::setCurrent(testDataDir + "/renameProduct"); @@ -1342,6 +1363,12 @@ void TestBlackbox::inheritQbsSearchPaths() QCOMPARE(runQbs(), 0); } +void TestBlackbox::objC() +{ + QDir::setCurrent(testDataDir + "/objc"); + QCOMPARE(runQbs(), 0); +} + void TestBlackbox::properQuoting() { QDir::setCurrent(testDataDir + "/proper quoting"); @@ -1350,7 +1377,7 @@ void TestBlackbox::properQuoting() params.expectFailure = true; // Because the exit code is non-zero. QCOMPARE(runQbs(params), 156); const char * const expectedOutput = "whitespaceless\ncontains space\ncontains\ttab\n" - "backslash\\\nbackslash\\\nHello World! The magic number is 156."; + "backslash\\\nHello World! The magic number is 156."; QCOMPARE(unifiedLineEndings(m_qbsStdout).constData(), expectedOutput); } diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 042446a96..f86e7617c 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -111,6 +111,7 @@ private slots: void jsExtensionsProcess(); void jsExtensionsTextFile(); void inheritQbsSearchPaths(); + void objC(); void properQuoting(); void propertiesBlocks(); void resolve_project_data(); @@ -118,7 +119,10 @@ private slots: void resolve_project_dry_run_data(); void resolve_project_dry_run(); void clean(); + void exportSimple(); void exportWithRecursiveDepends(); + void fileTagger(); + void rc(); void renameProduct(); void renameTargetArtifact(); void subProjects(); diff --git a/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs b/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs index ddf8114e9..51272a8d7 100644 --- a/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs +++ b/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs @@ -76,6 +76,6 @@ Project { name: "macappstore" files: "main.cpp" cpp.frameworks: "Foundation" - cpp.minimumSystemVersion: "10.6.8" + cpp.minimumOsxVersion: "10.6.8" } } diff --git a/tests/manual/qrc2/bla.cpp b/tests/manual/qrc2/bla.cpp deleted file mode 100644 index 17ba1b7a7..000000000 --- a/tests/manual/qrc2/bla.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Build Suite. -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -int main(){ - return 3; -} diff --git a/tests/manual/qrc2/bla.qrc b/tests/manual/qrc2/bla.qrc deleted file mode 100644 index f0a7168f5..000000000 --- a/tests/manual/qrc2/bla.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/bla"> - <file>stuff.txt</file> - </qresource> -</RCC> diff --git a/tests/manual/qrc2/foo.qrc b/tests/manual/qrc2/foo.qrc deleted file mode 100644 index a8acfc34a..000000000 --- a/tests/manual/qrc2/foo.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/foo"> - <file>stuff.txt</file> - </qresource> -</RCC> diff --git a/tests/manual/qrc2/i.qbs b/tests/manual/qrc2/i.qbs deleted file mode 100644 index e5c310773..000000000 --- a/tests/manual/qrc2/i.qbs +++ /dev/null @@ -1,19 +0,0 @@ -import qbs 1.0 - -Project { - Product { - type: "application" - name: "i" - - Depends { - name: "Qt.core" - } - - files: [ - "bla.cpp", - "bla.qrc", - "foo.qrc", - "stuff.txt" - ] - } -} diff --git a/tests/manual/qrc2/stuff.txt b/tests/manual/qrc2/stuff.txt deleted file mode 100644 index 78f0d32c6..000000000 --- a/tests/manual/qrc2/stuff.txt +++ /dev/null @@ -1 +0,0 @@ -a resource file |