summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-07-30 10:14:16 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-07-30 08:47:03 +0000
commit3811fd0855ea37eea6a02d6d3285b2503c6701d0 (patch)
tree1fbf4cdc1874c50f27ff762babd6362a4826ca20
parent4b20594bd141fbfb46891ee100696a39ffe5d4c6 (diff)
downloadqbs-3811fd0855ea37eea6a02d6d3285b2503c6701d0.tar.gz
Code clean-up in corelib/language/.
- Remove unneeded #includes (particularly from header files). - Make inline member function implementations less verbose. - De-QObjectify the Loader class and remove unneeded members & heap allocations. - Minor stuff (const issues, unneeded namespace qualifications). Change-Id: I55f2d7ed98b32faed7582bc6adfa04eb799de874 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
-rw-r--r--src/lib/corelib/api/runenvironment.cpp1
-rw-r--r--src/lib/corelib/buildgraph/buildgraph.cpp2
-rw-r--r--src/lib/corelib/buildgraph/buildgraphloader.cpp3
-rw-r--r--src/lib/corelib/buildgraph/depscanner.cpp2
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp1
-rw-r--r--src/lib/corelib/buildgraph/productinstaller.cpp2
-rw-r--r--src/lib/corelib/buildgraph/projectbuilddata.cpp2
-rw-r--r--src/lib/corelib/buildgraph/qtmocscanner.cpp1
-rw-r--r--src/lib/corelib/buildgraph/rulesapplicator.cpp3
-rw-r--r--src/lib/corelib/buildgraph/timestampsupdater.cpp2
-rw-r--r--src/lib/corelib/buildgraph/transformer.cpp1
-rw-r--r--src/lib/corelib/jsextensions/moduleproperties.cpp1
-rw-r--r--src/lib/corelib/language/artifactproperties.h3
-rw-r--r--src/lib/corelib/language/builtindeclarations.cpp2
-rw-r--r--src/lib/corelib/language/builtindeclarations.h3
-rw-r--r--src/lib/corelib/language/evaluator.cpp6
-rw-r--r--src/lib/corelib/language/evaluator.h13
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.cpp1
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.h3
-rw-r--r--src/lib/corelib/language/filecontext.h10
-rw-r--r--src/lib/corelib/language/filecontextbase.h72
-rw-r--r--src/lib/corelib/language/functiondeclaration.h2
-rw-r--r--src/lib/corelib/language/item.cpp22
-rw-r--r--src/lib/corelib/language/item.h188
-rw-r--r--src/lib/corelib/language/itemobserver.h2
-rw-r--r--src/lib/corelib/language/itemreaderastvisitor.cpp3
-rw-r--r--src/lib/corelib/language/itemreaderastvisitor.h7
-rw-r--r--src/lib/corelib/language/jsimports.h2
-rw-r--r--src/lib/corelib/language/language.cpp5
-rw-r--r--src/lib/corelib/language/language.h8
-rw-r--r--src/lib/corelib/language/loader.cpp40
-rw-r--r--src/lib/corelib/language/loader.h13
-rw-r--r--src/lib/corelib/language/moduleloader.cpp4
-rw-r--r--src/lib/corelib/language/moduleloader.h2
-rw-r--r--src/lib/corelib/language/modulemerger.cpp2
-rw-r--r--src/lib/corelib/language/modulemerger.h5
-rw-r--r--src/lib/corelib/language/projectresolver.cpp6
-rw-r--r--src/lib/corelib/language/projectresolver.h3
-rw-r--r--src/lib/corelib/language/propertydeclaration.cpp2
-rw-r--r--src/lib/corelib/language/propertydeclaration.h9
-rw-r--r--src/lib/corelib/language/propertymapinternal.cpp2
-rw-r--r--src/lib/corelib/language/resolvedfilecontext.h2
-rw-r--r--src/lib/corelib/language/scriptengine.cpp5
-rw-r--r--src/lib/corelib/language/scriptengine.h5
-rw-r--r--src/lib/corelib/language/scriptpropertyobserver.h7
-rw-r--r--src/lib/corelib/language/tst_language.cpp5
-rw-r--r--src/lib/corelib/language/value.cpp2
-rw-r--r--src/lib/corelib/language/value.h6
48 files changed, 170 insertions, 323 deletions
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp
index 120d12c14..55ed80737 100644
--- a/src/lib/corelib/api/runenvironment.cpp
+++ b/src/lib/corelib/api/runenvironment.cpp
@@ -33,6 +33,7 @@
#include <api/projectdata.h>
#include <buildgraph/productinstaller.h>
#include <language/language.h>
+#include <language/propertymapinternal.h>
#include <language/scriptengine.h>
#include <logging/logger.h>
#include <logging/translator.h>
diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp
index bb8e86cc4..05226e7f0 100644
--- a/src/lib/corelib/buildgraph/buildgraph.cpp
+++ b/src/lib/corelib/buildgraph/buildgraph.cpp
@@ -39,11 +39,13 @@
#include <jsextensions/moduleproperties.h>
#include <language/language.h>
#include <language/preparescriptobserver.h>
+#include <language/propertymapinternal.h>
#include <language/resolvedfilecontext.h>
#include <language/scriptengine.h>
#include <logging/logger.h>
#include <logging/translator.h>
#include <tools/error.h>
+#include <tools/fileinfo.h>
#include <tools/scripttools.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp
index d3244f4d1..c1e1204b3 100644
--- a/src/lib/corelib/buildgraph/buildgraphloader.cpp
+++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp
@@ -39,10 +39,13 @@
#include "projectbuilddata.h"
#include "rulesevaluationcontext.h"
#include "transformer.h"
+
#include <language/artifactproperties.h>
#include <language/language.h>
#include <language/loader.h>
+#include <language/propertymapinternal.h>
#include <logging/translator.h>
+#include <tools/fileinfo.h>
#include <tools/persistence.h>
#include <tools/propertyfinder.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp
index 7bc996a87..311793f98 100644
--- a/src/lib/corelib/buildgraph/depscanner.cpp
+++ b/src/lib/corelib/buildgraph/depscanner.cpp
@@ -36,9 +36,11 @@
#include <tools/error.h>
#include <logging/translator.h>
#include <language/language.h>
+#include <language/propertymapinternal.h>
#include <language/scriptengine.h>
#include <jsextensions/moduleproperties.h>
#include <plugins/scanner/scanner.h>
+#include <tools/fileinfo.h>
#include <QVariantMap>
#include <QSet>
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index 7065b2e5a..35a166e17 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -44,6 +44,7 @@
#include <buildgraph/transformer.h>
#include <language/language.h>
+#include <language/propertymapinternal.h>
#include <language/scriptengine.h>
#include <logging/translator.h>
#include <tools/error.h>
diff --git a/src/lib/corelib/buildgraph/productinstaller.cpp b/src/lib/corelib/buildgraph/productinstaller.cpp
index 584ff28bb..dced7abe1 100644
--- a/src/lib/corelib/buildgraph/productinstaller.cpp
+++ b/src/lib/corelib/buildgraph/productinstaller.cpp
@@ -31,7 +31,9 @@
#include "artifact.h"
#include "productbuilddata.h"
+
#include <language/language.h>
+#include <language/propertymapinternal.h>
#include <logging/translator.h>
#include <tools/qbsassert.h>
#include <tools/error.h>
diff --git a/src/lib/corelib/buildgraph/projectbuilddata.cpp b/src/lib/corelib/buildgraph/projectbuilddata.cpp
index b4c635ffb..fa6def887 100644
--- a/src/lib/corelib/buildgraph/projectbuilddata.cpp
+++ b/src/lib/corelib/buildgraph/projectbuilddata.cpp
@@ -38,11 +38,13 @@
#include "rulenode.h"
#include "rulesevaluationcontext.h"
#include "transformer.h"
+
#include <language/language.h>
#include <language/preparescriptobserver.h>
#include <language/scriptengine.h>
#include <logging/translator.h>
#include <tools/error.h>
+#include <tools/fileinfo.h>
#include <tools/persistence.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/buildgraph/qtmocscanner.cpp b/src/lib/corelib/buildgraph/qtmocscanner.cpp
index 5b3e13ea6..d74e646d2 100644
--- a/src/lib/corelib/buildgraph/qtmocscanner.cpp
+++ b/src/lib/corelib/buildgraph/qtmocscanner.cpp
@@ -34,6 +34,7 @@
#include "productbuilddata.h"
#include "scanresultcache.h"
#include <logging/translator.h>
+#include <tools/fileinfo.h>
#include <tools/scannerpluginmanager.h>
#include <tools/scripttools.h>
diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp
index 6edc8ee8f..894ec7f52 100644
--- a/src/lib/corelib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp
@@ -37,14 +37,17 @@
#include "qtmocscanner.h"
#include "rulesevaluationcontext.h"
#include "transformer.h"
+
#include <jsextensions/moduleproperties.h>
#include <language/artifactproperties.h>
#include <language/builtindeclarations.h>
#include <language/language.h>
#include <language/preparescriptobserver.h>
+#include <language/propertymapinternal.h>
#include <language/scriptengine.h>
#include <logging/translator.h>
#include <tools/error.h>
+#include <tools/fileinfo.h>
#include <tools/scripttools.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/buildgraph/timestampsupdater.cpp b/src/lib/corelib/buildgraph/timestampsupdater.cpp
index 994afac50..43c450199 100644
--- a/src/lib/corelib/buildgraph/timestampsupdater.cpp
+++ b/src/lib/corelib/buildgraph/timestampsupdater.cpp
@@ -33,7 +33,9 @@
#include "artifactvisitor.h"
#include "productbuilddata.h"
#include "projectbuilddata.h"
+
#include <language/language.h>
+#include <tools/fileinfo.h>
#include <tools/filetime.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/buildgraph/transformer.cpp b/src/lib/corelib/buildgraph/transformer.cpp
index c487ce5a2..d4a84722e 100644
--- a/src/lib/corelib/buildgraph/transformer.cpp
+++ b/src/lib/corelib/buildgraph/transformer.cpp
@@ -37,6 +37,7 @@
#include <language/scriptengine.h>
#include <logging/translator.h>
#include <tools/error.h>
+#include <tools/fileinfo.h>
#include <tools/persistence.h>
#include <tools/scripttools.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/jsextensions/moduleproperties.cpp b/src/lib/corelib/jsextensions/moduleproperties.cpp
index 6ae8322e6..d83fc34e9 100644
--- a/src/lib/corelib/jsextensions/moduleproperties.cpp
+++ b/src/lib/corelib/jsextensions/moduleproperties.cpp
@@ -32,6 +32,7 @@
#include <buildgraph/artifact.h>
#include <language/language.h>
+#include <language/propertymapinternal.h>
#include <language/scriptengine.h>
#include <logging/translator.h>
#include <tools/error.h>
diff --git a/src/lib/corelib/language/artifactproperties.h b/src/lib/corelib/language/artifactproperties.h
index 6a09c3022..242936bf7 100644
--- a/src/lib/corelib/language/artifactproperties.h
+++ b/src/lib/corelib/language/artifactproperties.h
@@ -31,8 +31,9 @@
#ifndef QBS_ARTIFACTPROPERTIES_H
#define QBS_ARTIFACTPROPERTIES_H
-#include "language.h"
+#include "filetags.h"
#include "forward_decls.h"
+
#include <tools/persistentobject.h>
namespace qbs {
diff --git a/src/lib/corelib/language/builtindeclarations.cpp b/src/lib/corelib/language/builtindeclarations.cpp
index 829477a44..1a82f7a0c 100644
--- a/src/lib/corelib/language/builtindeclarations.cpp
+++ b/src/lib/corelib/language/builtindeclarations.cpp
@@ -31,10 +31,8 @@
#include "builtindeclarations.h"
#include "deprecationinfo.h"
-#include "item.h"
#include <logging/translator.h>
-#include <tools/error.h>
namespace qbs {
namespace Internal {
diff --git a/src/lib/corelib/language/builtindeclarations.h b/src/lib/corelib/language/builtindeclarations.h
index f4f9a9ff6..84ab4544e 100644
--- a/src/lib/corelib/language/builtindeclarations.h
+++ b/src/lib/corelib/language/builtindeclarations.h
@@ -35,7 +35,6 @@
#include <tools/version.h>
-#include <QByteArray>
#include <QMap>
namespace qbs {
@@ -73,7 +72,7 @@ private:
void addTransformerItem();
void addScannerItem();
- Version m_languageVersion;
+ const Version m_languageVersion;
QMap<QString, ItemDeclaration> m_builtins;
};
diff --git a/src/lib/corelib/language/evaluator.cpp b/src/lib/corelib/language/evaluator.cpp
index c8a2398f7..eedb6e497 100644
--- a/src/lib/corelib/language/evaluator.cpp
+++ b/src/lib/corelib/language/evaluator.cpp
@@ -29,23 +29,25 @@
****************************************************************************/
#include "evaluator.h"
+
#include "evaluationdata.h"
#include "evaluatorscriptclass.h"
#include "filecontext.h"
#include "filetags.h"
#include "item.h"
+#include "scriptengine.h"
+
#include <jsextensions/jsextensions.h>
#include <logging/translator.h>
#include <tools/error.h>
#include <tools/scripttools.h>
#include <tools/qbsassert.h>
+
#include <QDebug>
-#include <QScriptEngine>
namespace qbs {
namespace Internal {
-
Evaluator::Evaluator(ScriptEngine *scriptEngine, const Logger &logger)
: m_scriptEngine(scriptEngine)
, m_scriptClass(new EvaluatorScriptClass(scriptEngine, logger))
diff --git a/src/lib/corelib/language/evaluator.h b/src/lib/corelib/language/evaluator.h
index 9781f5956..6806ce65c 100644
--- a/src/lib/corelib/language/evaluator.h
+++ b/src/lib/corelib/language/evaluator.h
@@ -33,16 +33,16 @@
#include "forward_decls.h"
#include "itemobserver.h"
-#include <language/scriptengine.h>
#include <QHash>
#include <QScriptValue>
namespace qbs {
namespace Internal {
-class FileTags;
-
class EvaluatorScriptClass;
+class FileTags;
+class Logger;
+class ScriptEngine;
class Evaluator : private ItemObserver
{
@@ -52,7 +52,7 @@ public:
Evaluator(ScriptEngine *scriptEngine, const Logger &logger);
virtual ~Evaluator();
- ScriptEngine *engine() const;
+ ScriptEngine *engine() const { return m_scriptEngine; }
QScriptValue property(const Item *item, const QString &name);
QScriptValue value(const Item *item, const QString &name, bool *propertySet = 0);
@@ -82,11 +82,6 @@ private:
mutable QHash<FileContextConstPtr, QScriptValue> m_fileScopeMap;
};
-inline ScriptEngine *Evaluator::engine() const
-{
- return m_scriptEngine;
-}
-
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp
index 06aa9a3f8..e9e6d8d36 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.cpp
+++ b/src/lib/corelib/language/evaluatorscriptclass.cpp
@@ -30,7 +30,6 @@
#include "evaluatorscriptclass.h"
-#include "builtinvalue.h"
#include "evaluationdata.h"
#include "evaluator.h"
#include "filecontext.h"
diff --git a/src/lib/corelib/language/evaluatorscriptclass.h b/src/lib/corelib/language/evaluatorscriptclass.h
index cfc2da748..7dcda5619 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.h
+++ b/src/lib/corelib/language/evaluatorscriptclass.h
@@ -31,8 +31,9 @@
#ifndef QBS_EVALUATORSCRIPTCLASS_H
#define QBS_EVALUATORSCRIPTCLASS_H
-#include "value.h"
#include "builtinvalue.h"
+#include "forward_decls.h"
+
#include <logging/logger.h>
#include <QScriptClass>
diff --git a/src/lib/corelib/language/filecontext.h b/src/lib/corelib/language/filecontext.h
index 3d669e0c6..f0f71f155 100644
--- a/src/lib/corelib/language/filecontext.h
+++ b/src/lib/corelib/language/filecontext.h
@@ -32,10 +32,11 @@
#define QBS_FILECONTEXT_H
#include "filecontextbase.h"
-#include "item.h"
+#include "forward_decls.h"
namespace qbs {
namespace Internal {
+class Item;
class FileContext : public FileContextBase
{
@@ -46,17 +47,12 @@ class FileContext : public FileContextBase
public:
static FileContextPtr create();
- Item *idScope() const;
+ Item *idScope() const { return m_idScope; }
private:
Item *m_idScope;
};
-inline Item *FileContext::idScope() const
-{
- return m_idScope;
-}
-
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/language/filecontextbase.h b/src/lib/corelib/language/filecontextbase.h
index eec9f9f9e..4be7b7de7 100644
--- a/src/lib/corelib/language/filecontextbase.h
+++ b/src/lib/corelib/language/filecontextbase.h
@@ -38,23 +38,21 @@ namespace Internal {
class FileContextBase
{
- friend class ItemReaderASTVisitor;
-
public:
- void setFilePath(const QString &filePath);
- QString filePath() const;
+ void setFilePath(const QString &filePath) { m_filePath = filePath; }
+ QString filePath() const { return m_filePath; }
- void setContent(const QString &content);
- const QString &content() const;
+ void setContent(const QString &content) { m_content = content; }
+ const QString &content() const { return m_content; }
- void setJsImports(const JsImports &jsImports);
- JsImports jsImports() const;
+ void setJsImports(const JsImports &jsImports) { m_jsImports = jsImports; }
+ JsImports jsImports() const { return m_jsImports; }
- void setJsExtensions(const QStringList &extensions);
- QStringList jsExtensions() const;
+ void setJsExtensions(const QStringList &extensions) { m_jsExtensions = extensions; }
+ QStringList jsExtensions() const { return m_jsExtensions; }
- void setSearchPaths(const QStringList &paths);
- QStringList searchPaths() const;
+ void setSearchPaths(const QStringList &paths) { m_searchPaths = paths; }
+ QStringList searchPaths() const { return m_searchPaths; }
QString dirPath() const;
@@ -69,56 +67,6 @@ protected:
QStringList m_searchPaths;
};
-inline void FileContextBase::setFilePath(const QString &filePath)
-{
- m_filePath = filePath;
-}
-
-inline QString FileContextBase::filePath() const
-{
- return m_filePath;
-}
-
-inline void FileContextBase::setContent(const QString &content)
-{
- m_content = content;
-}
-
-inline const QString &FileContextBase::content() const
-{
- return m_content;
-}
-
-inline void FileContextBase::setJsImports(const JsImports &jsImports)
-{
- m_jsImports = jsImports;
-}
-
-inline JsImports FileContextBase::jsImports() const
-{
- return m_jsImports;
-}
-
-inline void FileContextBase::setJsExtensions(const QStringList &extensions)
-{
- m_jsExtensions = extensions;
-}
-
-inline QStringList FileContextBase::jsExtensions() const
-{
- return m_jsExtensions;
-}
-
-inline void FileContextBase::setSearchPaths(const QStringList &paths)
-{
- m_searchPaths = paths;
-}
-
-inline QStringList FileContextBase::searchPaths() const
-{
- return m_searchPaths;
-}
-
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/language/functiondeclaration.h b/src/lib/corelib/language/functiondeclaration.h
index f0e0be62d..dcf63e2ee 100644
--- a/src/lib/corelib/language/functiondeclaration.h
+++ b/src/lib/corelib/language/functiondeclaration.h
@@ -33,6 +33,8 @@
#include <tools/codelocation.h>
+#include <QString>
+
namespace qbs {
namespace Internal {
diff --git a/src/lib/corelib/language/item.cpp b/src/lib/corelib/language/item.cpp
index 8400313b4..57ea4742b 100644
--- a/src/lib/corelib/language/item.cpp
+++ b/src/lib/corelib/language/item.cpp
@@ -33,7 +33,9 @@
#include "builtindeclarations.h"
#include "deprecationinfo.h"
#include "filecontext.h"
+#include "itemobserver.h"
#include "itempool.h"
+#include "value.h"
#include <logging/logger.h>
#include <logging/translator.h>
@@ -150,7 +152,7 @@ VariantValuePtr Item::variantProperty(const QString &name) const
return v.staticCast<VariantValue>();
}
-const PropertyDeclaration Item::propertyDeclaration(const QString &name) const
+PropertyDeclaration Item::propertyDeclaration(const QString &name) const
{
const PropertyDeclaration decl = m_propertyDeclarations.value(name);
return (!decl.isValid() && m_prototype) ? m_prototype->propertyDeclaration(name) : decl;
@@ -168,6 +170,13 @@ void Item::setPropertyObserver(ItemObserver *observer) const
m_propertyObserver = observer;
}
+void Item::setProperty(const QString &name, const ValuePtr &value)
+{
+ m_properties.insert(name, value);
+ if (m_propertyObserver)
+ m_propertyObserver->onItemPropertyChanged(this);
+}
+
void Item::dump() const
{
dump(0);
@@ -293,5 +302,16 @@ Item *Item::child(const QString &type, bool checkForMultiple) const
return child;
}
+void Item::addChild(Item *parent, Item *child)
+{
+ parent->m_children.append(child);
+ child->setParent(parent);
+}
+
+void Item::setPropertyDeclaration(const QString &name, const PropertyDeclaration &declaration)
+{
+ m_propertyDeclarations.insert(name, declaration);
+}
+
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/language/item.h b/src/lib/corelib/language/item.h
index b2a992832..bf926dae4 100644
--- a/src/lib/corelib/language/item.h
+++ b/src/lib/corelib/language/item.h
@@ -32,8 +32,6 @@
#define QBS_ITEM_H
#include "forward_decls.h"
-#include "itemobserver.h"
-#include "value.h"
#include "functiondeclaration.h"
#include "propertydeclaration.h"
#include "qualifiedid.h"
@@ -46,7 +44,7 @@
namespace qbs {
namespace Internal {
-
+class ItemObserver;
class ItemPool;
class Logger;
@@ -77,23 +75,23 @@ public:
static Item *create(ItemPool *pool);
Item *clone() const;
- ItemPool *pool() const;
-
- const QString &id() const;
- const QString &typeName() const;
- const CodeLocation &location() const;
- Item *prototype() const;
- Item *scope() const;
- bool isModuleInstance() const;
- Item *outerItem() const;
- Item *parent() const;
- const FileContextPtr file() const;
- QList<Item *> children() const;
+ ItemPool *pool() const { return m_pool; }
+
+ const QString &id() const { return m_id; }
+ const QString &typeName() const { return m_typeName; }
+ const CodeLocation &location() const { return m_location; }
+ Item *prototype() const { return m_prototype; }
+ Item *scope() const { return m_scope; }
+ bool isModuleInstance() const { return m_moduleInstance; }
+ Item *outerItem() const { return m_outerItem; }
+ Item *parent() const { return m_parent; }
+ const FileContextPtr file() const { return m_file; }
+ QList<Item *> children() const { return m_children; }
Item *child(const QString &type, bool checkForMultiple = true) const;
- const PropertyMap &properties() const;
- const PropertyDeclarationMap &propertyDeclarations() const;
- const PropertyDeclaration propertyDeclaration(const QString &name) const;
- const Modules &modules() const;
+ const PropertyMap &properties() const { return m_properties; }
+ const PropertyDeclarationMap &propertyDeclarations() const { return m_propertyDeclarations; }
+ PropertyDeclaration propertyDeclaration(const QString &name) const;
+ const Modules &modules() const { return m_modules; }
void addModule(const Module &module);
void removeModules() { m_modules.clear(); }
void setModules(const Modules &modules) { m_modules = modules; }
@@ -109,15 +107,15 @@ public:
void setProperties(const PropertyMap &props) { m_properties = props; }
void removeProperty(const QString &name);
void setPropertyDeclaration(const QString &name, const PropertyDeclaration &declaration);
- void setTypeName(const QString &name);
- void setLocation(const CodeLocation &location);
- void setPrototype(Item *prototype);
- void setFile(const FileContextPtr &file);
- void setScope(Item *item);
- void setModuleInstanceFlag(bool b);
- void setOuterItem(Item *item);
- void setChildren(const QList<Item *> &children);
- void setParent(Item *item);
+ void setTypeName(const QString &name) { m_typeName = name; }
+ void setLocation(const CodeLocation &location) { m_location = location; }
+ void setPrototype(Item *prototype) { m_prototype = prototype; }
+ void setFile(const FileContextPtr &file) { m_file = file; }
+ void setScope(Item *item) { m_scope = item; }
+ void setModuleInstanceFlag(bool b) { m_moduleInstance = b; }
+ void setOuterItem(Item *item) { m_outerItem = item; }
+ void setChildren(const QList<Item *> &children) { m_children = children; }
+ void setParent(Item *item) { m_parent = item; }
static void addChild(Item *parent, Item *child);
void dump() const;
bool isPresentModule() const;
@@ -149,140 +147,6 @@ private:
ErrorInfo m_delayedError;
};
-inline ItemPool *Item::pool() const
-{
- return m_pool;
-}
-
-inline const QString &Item::id() const
-{
- return m_id;
-}
-
-inline const QString &Item::typeName() const
-{
- return m_typeName;
-}
-
-inline const CodeLocation &Item::location() const
-{
- return m_location;
-}
-
-inline Item *Item::prototype() const
-{
- return m_prototype;
-}
-
-inline Item *Item::scope() const
-{
- return m_scope;
-}
-
-inline bool Item::isModuleInstance() const
-{
- return m_moduleInstance;
-}
-
-inline Item *Item::outerItem() const
-{
- return m_outerItem;
-}
-
-inline Item *Item::parent() const
-{
- return m_parent;
-}
-
-inline const FileContextPtr Item::file() const
-{
- return m_file;
-}
-
-inline QList<Item *> Item::children() const
-{
- return m_children;
-}
-
-inline const Item::PropertyMap &Item::properties() const
-{
- return m_properties;
-}
-
-inline const Item::PropertyDeclarationMap &Item::propertyDeclarations() const
-{
- return m_propertyDeclarations;
-}
-
-inline void Item::setProperty(const QString &name, const ValuePtr &value)
-{
- m_properties.insert(name, value);
- if (m_propertyObserver)
- m_propertyObserver->onItemPropertyChanged(this);
-}
-
-inline void Item::setPropertyDeclaration(const QString &name,
- const PropertyDeclaration &declaration)
-{
- m_propertyDeclarations.insert(name, declaration);
-}
-
-inline void Item::setTypeName(const QString &name)
-{
- m_typeName = name;
-}
-
-inline void Item::setLocation(const CodeLocation &location)
-{
- m_location = location;
-}
-
-inline void Item::setPrototype(Item *prototype)
-{
- m_prototype = prototype;
-}
-
-inline void Item::setFile(const FileContextPtr &file)
-{
- m_file = file;
-}
-
-inline void Item::setScope(Item *item)
-{
- m_scope = item;
-}
-
-inline void Item::setModuleInstanceFlag(bool b)
-{
- m_moduleInstance = b;
-}
-
-inline void Item::setOuterItem(Item *item)
-{
- m_outerItem = item;
-}
-
-inline void Item::setChildren(const QList<Item *> &children)
-{
- m_children = children;
-}
-
-inline void Item::setParent(Item *item)
-{
- m_parent = item;
-}
-
-inline void Item::addChild(Item *parent, Item *child)
-{
- parent->m_children.append(child);
- child->setParent(parent);
-}
-
-inline const Item::Modules &Item::modules() const
-{
- return m_modules;
-}
-
inline bool operator<(const Item::Module &m1, const Item::Module &m2) { return m1.name < m2.name; }
} // namespace Internal
diff --git a/src/lib/corelib/language/itemobserver.h b/src/lib/corelib/language/itemobserver.h
index b2c823c9c..dbc4f5767 100644
--- a/src/lib/corelib/language/itemobserver.h
+++ b/src/lib/corelib/language/itemobserver.h
@@ -31,8 +31,6 @@
#ifndef QBS_ITEMOBSERVER_H
#define QBS_ITEMOBSERVER_H
-#include <QString>
-
namespace qbs {
namespace Internal {
diff --git a/src/lib/corelib/language/itemreaderastvisitor.cpp b/src/lib/corelib/language/itemreaderastvisitor.cpp
index b507b729b..3b1f64fea 100644
--- a/src/lib/corelib/language/itemreaderastvisitor.cpp
+++ b/src/lib/corelib/language/itemreaderastvisitor.cpp
@@ -32,8 +32,11 @@
#include "asttools.h"
#include "builtindeclarations.h"
+#include "filecontext.h"
#include "identifiersearch.h"
+#include "item.h"
#include "itemreadervisitorstate.h"
+#include "value.h"
#include <jsextensions/jsextensions.h>
#include <parser/qmljsast_p.h>
diff --git a/src/lib/corelib/language/itemreaderastvisitor.h b/src/lib/corelib/language/itemreaderastvisitor.h
index 643c9a1e1..077ab29cd 100644
--- a/src/lib/corelib/language/itemreaderastvisitor.h
+++ b/src/lib/corelib/language/itemreaderastvisitor.h
@@ -31,18 +31,19 @@
#ifndef QBS_ITEMREADERASTVISITOR_H
#define QBS_ITEMREADERASTVISITOR_H
-#include "item.h"
-#include "filecontext.h"
+#include "forward_decls.h"
#include <logging/logger.h>
#include <parser/qmljsastvisitor_p.h>
+#include <tools/codelocation.h>
#include <QHash>
#include <QStringList>
namespace qbs {
namespace Internal {
-
+class Item;
+class ItemPool;
class ItemReaderVisitorState;
class Version;
diff --git a/src/lib/corelib/language/jsimports.h b/src/lib/corelib/language/jsimports.h
index cb90ae98d..0cbceeea2 100644
--- a/src/lib/corelib/language/jsimports.h
+++ b/src/lib/corelib/language/jsimports.h
@@ -32,8 +32,8 @@
#define QBS_JSIMPORTS_H
#include <tools/codelocation.h>
+
#include <QHash>
-#include <QSet>
#include <QStringList>
namespace qbs {
diff --git a/src/lib/corelib/language/language.cpp b/src/lib/corelib/language/language.cpp
index 68fcd16c3..edd9c33db 100644
--- a/src/lib/corelib/language/language.cpp
+++ b/src/lib/corelib/language/language.cpp
@@ -31,9 +31,12 @@
#include "language.h"
#include "artifactproperties.h"
+#include "propertymapinternal.h"
#include "resolvedfilecontext.h"
#include "scriptengine.h"
+
#include <buildgraph/artifact.h>
+#include <buildgraph/artifactset.h>
#include <buildgraph/productbuilddata.h>
#include <buildgraph/projectbuilddata.h>
#include <buildgraph/rulegraph.h> // TODO: Move to language?
@@ -43,7 +46,7 @@
#include <tools/buildgraphlocker.h>
#include <tools/hostosinfo.h>
#include <tools/error.h>
-#include <tools/propertyfinder.h>
+#include <tools/fileinfo.h>
#include <tools/persistence.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/language/language.h b/src/lib/corelib/language/language.h
index d487db6c6..00d3963b9 100644
--- a/src/lib/corelib/language/language.h
+++ b/src/lib/corelib/language/language.h
@@ -34,22 +34,18 @@
#include "filetags.h"
#include "forward_decls.h"
#include "jsimports.h"
-#include "propertymapinternal.h"
-#include <buildgraph/artifactset.h>
+
#include <buildgraph/forward_decls.h>
#include <tools/codelocation.h>
-#include <tools/fileinfo.h>
+#include <tools/filetime.h>
#include <tools/persistentobject.h>
-#include <tools/settings.h>
#include <tools/weakpointer.h>
-#include <QByteArray>
#include <QDataStream>
#include <QHash>
#include <QMutex>
#include <QProcessEnvironment>
#include <QRegExp>
-#include <QScriptProgram>
#include <QScriptValue>
#include <QScopedPointer>
#include <QSet>
diff --git a/src/lib/corelib/language/loader.cpp b/src/lib/corelib/language/loader.cpp
index 94c7a55bd..3f3586286 100644
--- a/src/lib/corelib/language/loader.cpp
+++ b/src/lib/corelib/language/loader.cpp
@@ -30,10 +30,11 @@
#include "loader.h"
-#include "builtindeclarations.h"
-#include "item.h"
+#include "language.h"
#include "moduleloader.h"
#include "projectresolver.h"
+#include "scriptengine.h"
+
#include <logging/translator.h>
#include <tools/fileinfo.h>
#include <tools/progressobserver.h>
@@ -41,6 +42,7 @@
#include <tools/setupprojectparameters.h>
#include <QDir>
+#include <QObject>
#include <QTimer>
namespace qbs {
@@ -49,23 +51,13 @@ namespace Internal {
Loader::Loader(ScriptEngine *engine, const Logger &logger)
: m_logger(logger)
, m_progressObserver(0)
- , m_moduleLoader(new ModuleLoader(engine, logger))
- , m_projectResolver(new ProjectResolver(m_moduleLoader, logger))
, m_engine(engine)
{
}
-Loader::~Loader()
-{
- delete m_projectResolver;
- delete m_moduleLoader;
-}
-
void Loader::setProgressObserver(ProgressObserver *observer)
{
m_progressObserver = observer;
- m_moduleLoader->setProgressObserver(observer);
- m_projectResolver->setProgressObserver(observer);
}
void Loader::setSearchPaths(const QStringList &_searchPaths)
@@ -80,7 +72,7 @@ void Loader::setSearchPaths(const QStringList &_searchPaths)
}
}
- m_moduleLoader->setSearchPaths(searchPaths);
+ m_searchPaths = searchPaths;
}
TopLevelProjectPtr Loader::loadProject(const SetupProjectParameters &parameters)
@@ -101,13 +93,22 @@ TopLevelProjectPtr Loader::loadProject(const SetupProjectParameters &parameters)
.arg(TopLevelProject::deriveId(parameters.topLevelProfile(),
parameters.finalBuildConfigurationTree())), 1);
cancelationTimer.setSingleShot(false);
- QObject::connect(&cancelationTimer, SIGNAL(timeout()), SLOT(checkForCancelation()));
+ QObject::connect(&cancelationTimer, &QTimer::timeout, [this]() {
+ QBS_ASSERT(m_progressObserver, return);
+ if (m_progressObserver->canceled())
+ m_engine->cancel();
+ });
cancelationTimer.start(1000);
}
const FileTime resolveTime = FileTime::currentTime();
- ModuleLoaderResult loadResult = m_moduleLoader->load(parameters);
- const TopLevelProjectPtr project = m_projectResolver->resolve(loadResult, parameters);
+ ModuleLoader moduleLoader(m_engine, m_logger);
+ moduleLoader.setProgressObserver(m_progressObserver);
+ moduleLoader.setSearchPaths(m_searchPaths);
+ ModuleLoaderResult loadResult = moduleLoader.load(parameters);
+ ProjectResolver resolver(&moduleLoader, m_logger);
+ resolver.setProgressObserver(m_progressObserver);
+ const TopLevelProjectPtr project = resolver.resolve(loadResult, parameters);
project->lastResolveTime = resolveTime;
// E.g. if the top-level project is disabled.
@@ -117,12 +118,5 @@ TopLevelProjectPtr Loader::loadProject(const SetupProjectParameters &parameters)
return project;
}
-void Loader::checkForCancelation()
-{
- QBS_ASSERT(m_progressObserver, return);
- if (m_progressObserver->canceled())
- m_engine->cancel();
-}
-
} // namespace Internal
} // namespace qbs
diff --git a/src/lib/corelib/language/loader.h b/src/lib/corelib/language/loader.h
index ee08c7c26..ee2e85c7a 100644
--- a/src/lib/corelib/language/loader.h
+++ b/src/lib/corelib/language/loader.h
@@ -33,7 +33,6 @@
#include "forward_decls.h"
#include <logging/logger.h>
-#include <QObject>
#include <QStringList>
namespace qbs {
@@ -41,31 +40,23 @@ class Settings;
class SetupProjectParameters;
namespace Internal {
class Logger;
-class ModuleLoader;
class ProgressObserver;
class ScriptEngine;
-class ProjectResolver;
-class Loader : public QObject
+class Loader
{
- Q_OBJECT
public:
Loader(ScriptEngine *engine, const Logger &logger);
- ~Loader();
void setProgressObserver(ProgressObserver *observer);
void setSearchPaths(const QStringList &searchPaths);
TopLevelProjectPtr loadProject(const SetupProjectParameters &parameters);
-private slots:
- void checkForCancelation();
-
private:
Logger m_logger;
ProgressObserver *m_progressObserver;
- ModuleLoader *m_moduleLoader;
- ProjectResolver *m_projectResolver;
ScriptEngine * const m_engine;
+ QStringList m_searchPaths;
};
} // namespace Internal
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index 60c72f724..367e186be 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -36,20 +36,20 @@
#include "filecontext.h"
#include "item.h"
#include "itemreader.h"
+#include "qualifiedid.h"
#include "scriptengine.h"
#include "value.h"
+
#include <language/language.h>
#include <language/scriptengine.h>
#include <logging/logger.h>
#include <logging/translator.h>
#include <tools/error.h>
#include <tools/fileinfo.h>
-#include <tools/hostosinfo.h>
#include <tools/preferences.h>
#include <tools/profile.h>
#include <tools/progressobserver.h>
#include <tools/qbsassert.h>
-#include <tools/qttools.h>
#include <tools/scripttools.h>
#include <tools/settings.h>
diff --git a/src/lib/corelib/language/moduleloader.h b/src/lib/corelib/language/moduleloader.h
index 855b68d7d..6adbc978f 100644
--- a/src/lib/corelib/language/moduleloader.h
+++ b/src/lib/corelib/language/moduleloader.h
@@ -33,7 +33,6 @@
#include "forward_decls.h"
#include "itempool.h"
-#include "qualifiedid.h"
#include <logging/logger.h>
#include <tools/setupprojectparameters.h>
#include <tools/version.h>
@@ -59,6 +58,7 @@ class Evaluator;
class Item;
class ItemReader;
class ProgressObserver;
+class QualifiedId;
class ScriptEngine;
struct ModuleLoaderResult
diff --git a/src/lib/corelib/language/modulemerger.cpp b/src/lib/corelib/language/modulemerger.cpp
index 9648c83a7..b32361b79 100644
--- a/src/lib/corelib/language/modulemerger.cpp
+++ b/src/lib/corelib/language/modulemerger.cpp
@@ -30,6 +30,8 @@
#include "modulemerger.h"
+#include "value.h"
+
#include <logging/translator.h>
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/language/modulemerger.h b/src/lib/corelib/language/modulemerger.h
index ae13b9143..3b417191b 100644
--- a/src/lib/corelib/language/modulemerger.h
+++ b/src/lib/corelib/language/modulemerger.h
@@ -32,11 +32,12 @@
#define QBS_MODULEMERGER_H
#include "item.h"
+#include "qualifiedid.h"
+
#include <logging/logger.h>
#include <QHash>
#include <QSet>
-#include <QStringList>
namespace qbs {
namespace Internal {
@@ -59,7 +60,7 @@ private:
const Logger &m_logger;
Item * const m_rootItem;
Item *m_mergedModuleItem;
- const QStringList m_moduleName;
+ const QualifiedId m_moduleName;
QHash<ValuePtr, PropertyDeclaration> m_decls;
QSet<const Item *> m_seenInstancesTopDown;
QSet<const Item *> m_seenInstancesBottomUp;
diff --git a/src/lib/corelib/language/projectresolver.cpp b/src/lib/corelib/language/projectresolver.cpp
index 778962831..dfb674466 100644
--- a/src/lib/corelib/language/projectresolver.cpp
+++ b/src/lib/corelib/language/projectresolver.cpp
@@ -34,11 +34,13 @@
#include "evaluator.h"
#include "filecontext.h"
#include "item.h"
-#include "moduleloader.h"
+#include "language.h"
#include "modulemerger.h"
#include "propertymapinternal.h"
#include "resolvedfilecontext.h"
#include "scriptengine.h"
+#include "value.h"
+
#include <jsextensions/moduleproperties.h>
#include <logging/translator.h>
#include <tools/error.h>
@@ -48,10 +50,8 @@
#include <tools/qbsassert.h>
#include <tools/qttools.h>
-#include <QFileInfo>
#include <QDir>
#include <QQueue>
-#include <QSet>
#include <algorithm>
#include <set>
diff --git a/src/lib/corelib/language/projectresolver.h b/src/lib/corelib/language/projectresolver.h
index 4057c35a4..fc97422de 100644
--- a/src/lib/corelib/language/projectresolver.h
+++ b/src/lib/corelib/language/projectresolver.h
@@ -31,9 +31,7 @@
#ifndef PROJECTRESOLVER_H
#define PROJECTRESOLVER_H
-#include "evaluator.h"
#include "filetags.h"
-#include "language.h"
#include "moduleloader.h"
#include <logging/logger.h>
@@ -47,7 +45,6 @@ namespace Internal {
class Evaluator;
class Item;
-class ModuleLoader;
class ProgressObserver;
class ScriptEngine;
class QualifiedIdSet;
diff --git a/src/lib/corelib/language/propertydeclaration.cpp b/src/lib/corelib/language/propertydeclaration.cpp
index c79aed4ab..8d5367ee8 100644
--- a/src/lib/corelib/language/propertydeclaration.cpp
+++ b/src/lib/corelib/language/propertydeclaration.cpp
@@ -32,7 +32,9 @@
#include "deprecationinfo.h"
+#include <QScriptValue>
#include <QSharedData>
+#include <QStringList>
namespace qbs {
namespace Internal {
diff --git a/src/lib/corelib/language/propertydeclaration.h b/src/lib/corelib/language/propertydeclaration.h
index 8071b201a..f0e662a0c 100644
--- a/src/lib/corelib/language/propertydeclaration.h
+++ b/src/lib/corelib/language/propertydeclaration.h
@@ -32,9 +32,12 @@
#define QBS_PROPERTYDECLARATION_H
#include <QSharedDataPointer>
-#include <QString>
-#include <QStringList>
-#include <QScriptValue>
+
+QT_BEGIN_NAMESPACE
+class QScriptValue;
+class QString;
+class QStringList;
+QT_END_NAMESPACE
namespace qbs {
namespace Internal {
diff --git a/src/lib/corelib/language/propertymapinternal.cpp b/src/lib/corelib/language/propertymapinternal.cpp
index 91747cbac..577c7762f 100644
--- a/src/lib/corelib/language/propertymapinternal.cpp
+++ b/src/lib/corelib/language/propertymapinternal.cpp
@@ -80,7 +80,7 @@ static QString toJSLiteral_impl(const QVariantMap &vm, int level = 0)
str += toJSLiteral_impl(it.value().toMap(), level + 1);
str += indent + QLatin1String("}\n");
} else {
- str += indent + it.key() + QLatin1String(": ") + qbs::toJSLiteral(it.value())
+ str += indent + it.key() + QLatin1String(": ") + toJSLiteral(it.value())
+ QLatin1Char('\n');
}
}
diff --git a/src/lib/corelib/language/resolvedfilecontext.h b/src/lib/corelib/language/resolvedfilecontext.h
index b77f69042..b2c9d1741 100644
--- a/src/lib/corelib/language/resolvedfilecontext.h
+++ b/src/lib/corelib/language/resolvedfilecontext.h
@@ -33,7 +33,7 @@
#include "forward_decls.h"
#include "filecontextbase.h"
-#include "jsimports.h"
+
#include <tools/persistentobject.h>
namespace qbs {
diff --git a/src/lib/corelib/language/scriptengine.cpp b/src/lib/corelib/language/scriptengine.cpp
index fb80c03de..b555ffe28 100644
--- a/src/lib/corelib/language/scriptengine.cpp
+++ b/src/lib/corelib/language/scriptengine.cpp
@@ -32,9 +32,10 @@
#include "evaluatorscriptclass.h"
#include "filecontextbase.h"
-#include "item.h"
+#include "jsimports.h"
#include "propertymapinternal.h"
#include "scriptpropertyobserver.h"
+
#include <buildgraph/artifact.h>
#include <jsextensions/jsextensions.h>
#include <tools/error.h>
@@ -445,7 +446,7 @@ void ScriptEngine::addFileExistsResult(const QString &filePath, bool exists)
m_fileExistsResult.insert(filePath, exists);
}
-void ScriptEngine::addFileLastModifiedResult(const QString &filePath, FileTime fileTime)
+void ScriptEngine::addFileLastModifiedResult(const QString &filePath, const FileTime &fileTime)
{
m_fileLastModifiedResult.insert(filePath, fileTime);
}
diff --git a/src/lib/corelib/language/scriptengine.h b/src/lib/corelib/language/scriptengine.h
index b901db2b3..d0b0ec9d9 100644
--- a/src/lib/corelib/language/scriptengine.h
+++ b/src/lib/corelib/language/scriptengine.h
@@ -32,7 +32,6 @@
#define QBS_SCRIPTENGINE_H
#include "forward_decls.h"
-#include "jsimports.h"
#include "property.h"
#include <logging/logger.h>
#include <tools/filetime.h>
@@ -47,7 +46,7 @@
namespace qbs {
namespace Internal {
class Artifact;
-
+class JsImport;
class ScriptPropertyObserver;
class ScriptEngine : public QScriptEngine
@@ -96,7 +95,7 @@ public:
QHash<QString, QString> usedEnvironment() const { return m_usedEnvironment; }
void addCanonicalFilePathResult(const QString &filePath, const QString &resultFilePath);
void addFileExistsResult(const QString &filePath, bool exists);
- void addFileLastModifiedResult(const QString &filePath, FileTime fileTime);
+ void addFileLastModifiedResult(const QString &filePath, const FileTime &fileTime);
QHash<QString, QString> canonicalFilePathResults() const { return m_canonicalFilePathResult; }
QHash<QString, bool> fileExistsResults() const { return m_fileExistsResult; }
QHash<QString, FileTime> fileLastModifiedResults() const { return m_fileLastModifiedResult; }
diff --git a/src/lib/corelib/language/scriptpropertyobserver.h b/src/lib/corelib/language/scriptpropertyobserver.h
index 23077d4fb..93cc263a3 100644
--- a/src/lib/corelib/language/scriptpropertyobserver.h
+++ b/src/lib/corelib/language/scriptpropertyobserver.h
@@ -31,7 +31,12 @@
#ifndef QBS_SCRIPTPROPERTYOBSERVER_H
#define QBS_SCRIPTPROPERTYOBSERVER_H
-#include <QScriptValue>
+#include <QtGlobal>
+
+QT_BEGIN_NAMESPACE
+class QScriptValue;
+class QString;
+QT_END_NAMESPACE
namespace qbs {
namespace Internal {
diff --git a/src/lib/corelib/language/tst_language.cpp b/src/lib/corelib/language/tst_language.cpp
index d6ab07273..1044db3bd 100644
--- a/src/lib/corelib/language/tst_language.cpp
+++ b/src/lib/corelib/language/tst_language.cpp
@@ -33,18 +33,23 @@
#include "tst_language.h"
#include <language/evaluator.h>
+#include <language/filecontext.h>
#include <language/identifiersearch.h>
#include <language/item.h>
#include <language/itempool.h>
#include <language/language.h>
+#include <language/propertymapinternal.h>
#include <language/scriptengine.h>
+#include <language/value.h>
#include <parser/qmljslexer_p.h>
#include <parser/qmljsparser_p.h>
#include <tools/scripttools.h>
#include <tools/error.h>
+#include <tools/fileinfo.h>
#include <tools/hostosinfo.h>
#include <tools/profile.h>
#include <tools/propertyfinder.h>
+#include <tools/settings.h>
#include <QProcessEnvironment>
diff --git a/src/lib/corelib/language/value.cpp b/src/lib/corelib/language/value.cpp
index 70e0e066c..fae97d0da 100644
--- a/src/lib/corelib/language/value.cpp
+++ b/src/lib/corelib/language/value.cpp
@@ -29,6 +29,8 @@
****************************************************************************/
#include "value.h"
+
+#include "filecontext.h"
#include "item.h"
#include <tools/qbsassert.h>
diff --git a/src/lib/corelib/language/value.h b/src/lib/corelib/language/value.h
index 2dcc7ff17..8f17f0be9 100644
--- a/src/lib/corelib/language/value.h
+++ b/src/lib/corelib/language/value.h
@@ -31,14 +31,13 @@
#ifndef QBS_VALUE_H
#define QBS_VALUE_H
-#include "filecontext.h"
-#include "item.h"
+#include "forward_decls.h"
#include <tools/codelocation.h>
#include <QVariant>
namespace qbs {
namespace Internal {
-
+class Item;
class ValueHandler;
class Value
@@ -150,7 +149,6 @@ private:
Item *m_exportScope;
};
-class Item;
class ItemValue : public Value
{