summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-11-04 17:37:51 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2019-11-05 09:16:07 +0000
commit3e5268b08883eb98ab539887d63985f149e02241 (patch)
tree681c79495ca706e1988a1edecb4428193006a81f
parent77719b58932541e63d926ee9f454163c57273670 (diff)
Fix user dependency scanners
Since commit 9e55ddfa97, we mistakenly passed the output artifact to the scan script, rather than the input artifact. Fixes: QBS-1511 Change-Id: Ieb2a2b3bdf0366ef203e96d578a30a0ef8b1838a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp5
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.h4
-rw-r--r--tests/auto/blackbox/tst_blackboxqt.cpp10
3 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index c8b2cb779..81cbe2178 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -240,7 +240,7 @@ void InputArtifactScanner::scanForScannerFileDependencies(DependencyScanner *sca
if (scanData.lastScanTime < fileToBeScanned->timestamp()) {
try {
qCDebug(lcDepScan) << "scanning" << FileInfo::fileName(filePathToBeScanned);
- scanWithScannerPlugin(scanner, fileToBeScanned, &scanData.rawScanResult);
+ scanWithScannerPlugin(scanner, inputArtifact, fileToBeScanned, &scanData.rawScanResult);
scanData.lastScanTime = FileTime::currentTime();
} catch (const ErrorInfo &error) {
m_logger.printWarning(error);
@@ -364,12 +364,13 @@ void InputArtifactScanner::handleDependency(ResolvedDependency &dependency)
}
void InputArtifactScanner::scanWithScannerPlugin(DependencyScanner *scanner,
+ Artifact *inputArtifact,
FileResourceBase *fileToBeScanned,
RawScanResult *scanResult)
{
scanResult->deps.clear();
const QStringList &dependencies = scanner->collectDependencies(
- m_artifact, fileToBeScanned, m_fileTagsForScanner.constData());
+ inputArtifact, fileToBeScanned, m_fileTagsForScanner.constData());
for (const QString &s : dependencies)
scanResult->deps.push_back(RawScannedDependency(s));
}
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.h b/src/lib/corelib/buildgraph/inputartifactscanner.h
index ac51af579..7b7630b6f 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.h
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.h
@@ -133,8 +133,8 @@ private:
const RawScanResult &scanResult, QList<FileResourceBase *> *artifactsToScan,
InputArtifactScannerContext::ScannerResolvedDependenciesCache &cache);
void handleDependency(ResolvedDependency &dependency);
- void scanWithScannerPlugin(DependencyScanner *scanner, FileResourceBase *fileToBeScanned,
- RawScanResult *scanResult);
+ void scanWithScannerPlugin(DependencyScanner *scanner, Artifact *inputArtifact,
+ FileResourceBase *fileToBeScanned, RawScanResult *scanResult);
Artifact * const m_artifact;
RawScanResults &m_rawScanResults;
diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp
index 2b2b6814e..474fb95f3 100644
--- a/tests/auto/blackbox/tst_blackboxqt.cpp
+++ b/tests/auto/blackbox/tst_blackboxqt.cpp
@@ -371,6 +371,16 @@ void TestBlackboxQt::quickCompiler()
QCOMPARE(m_qbsStdout.contains("compiling qml_subdir_test_qml.cpp"), hasCompiler);
if (doesNotHaveCompiler)
QSKIP("qtquickcompiler not available");
+ QVERIFY2(m_qbsStdout.contains("generating loader source"), m_qbsStdout.constData());
+
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(!m_qbsStdout.contains("generating loader source"), m_qbsStdout.constData());
+
+ WAIT_FOR_NEW_TIMESTAMP();
+ touch("qml/subdir/test.qml");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.contains("generating loader source"), m_qbsStdout.constData());
+
QCOMPARE(runQbs(QbsRunParameters(QStringList{"config:off",
"modules.Qt.quick.useCompiler:false"})), 0);
QVERIFY2(m_qbsStdout.contains("compiling"), m_qbsStdout.constData());