aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2016-11-22 19:09:52 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2016-11-23 16:19:38 +0000
commit0ab562cae6fd6b5c334714efad5eb5a2882ef2ab (patch)
tree104309fe78b51c9ffbf99bc7c2788c4d760ae2b7
parentcaa0784c18b6900ea856a9f8bf1050d37964c19a (diff)
Fix input.fileName for Scanner items
Let fileName contain the file name and filePath the file path like everywhere else. [ChangeLog] In Scanner items input.fileName now contains a file name, and input.filePath contains the file path. Change-Id: I3abc01989c56940df935047db56055936b3ab224 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--doc/reference/items/scanner.qdoc2
-rw-r--r--src/lib/corelib/buildgraph/depscanner.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/reference/items/scanner.qdoc b/doc/reference/items/scanner.qdoc
index 236133886..a7bd65f17 100644
--- a/doc/reference/items/scanner.qdoc
+++ b/doc/reference/items/scanner.qdoc
@@ -43,7 +43,7 @@
condition: true
inputs: 'qrc'
scan: {
- xml = XmlDomDocument(input.fileName);
+ var xml = new XmlDomDocument(input.filePath);
dependencies = [];
// do something with the xml
return dependencies;
diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp
index dd206d158..d88759f3b 100644
--- a/src/lib/corelib/buildgraph/depscanner.cpp
+++ b/src/lib/corelib/buildgraph/depscanner.cpp
@@ -179,7 +179,9 @@ QStringList UserDependencyScanner::evaluate(Artifact *artifact, const ScriptFunc
QScriptValue artifactConfig = m_engine->newObject();
ModuleProperties::init(artifactConfig, artifact);
- artifactConfig.setProperty(QLatin1String("fileName"), artifact->filePath(), 0);
+ artifactConfig.setProperty(QLatin1String("fileName"),
+ FileInfo::fileName(artifact->filePath()), 0);
+ artifactConfig.setProperty(QLatin1String("filePath"), artifact->filePath(), 0);
const QStringList fileTags = artifact->fileTags().toStringList();
artifactConfig.setProperty(QLatin1String("fileTags"), m_engine->toScriptValue(fileTags));
if (!m_scanner->module->name.isEmpty())