diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-04-25 23:28:04 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2016-04-26 09:27:53 +0000 |
commit | ebd566c2015b9a65d14fa3c753dae79ee27c5313 (patch) | |
tree | 206e698631d6e5395c9b2d65a67d1db49aa5f3f3 /share | |
parent | fb4f7fce751665884dd60876c11091853960577c (diff) |
Fix use of qdoc with unrecognized file types.
Also, improve the error message when this happens.
Change-Id: If7a398e7dec83a8697e231df39392d6c2d904674
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/imports/qbs/ModUtils/utils.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/share/qbs/imports/qbs/ModUtils/utils.js b/share/qbs/imports/qbs/ModUtils/utils.js index 493316850..1983d30dd 100644 --- a/share/qbs/imports/qbs/ModUtils/utils.js +++ b/share/qbs/imports/qbs/ModUtils/utils.js @@ -412,7 +412,7 @@ var BlackboxOutputArtifactTracker = (function () { if (this.fileTaggers) { var files = this.findFiles(fakeOutputDirectory.path()); for (var i = 0; i < files.length; ++i) - artifacts.push(this.createArtifact(files[i])); + artifacts.push(this.createArtifact(fakeOutputDirectory.path(), files[i])); } if (this.processStdOutFunction) artifacts = artifacts.concat(this.processStdOutFunction(process.readStdOut())); @@ -426,7 +426,7 @@ var BlackboxOutputArtifactTracker = (function () { fakeOutputDirectory.remove(); } }; - BlackboxOutputArtifactTracker.prototype.createArtifact = function (filePath) { + BlackboxOutputArtifactTracker.prototype.createArtifact = function (root, filePath) { for (var ext in this.fileTaggers) { if (filePath.endsWith(ext)) { return { @@ -435,11 +435,18 @@ var BlackboxOutputArtifactTracker = (function () { }; } } - if (!this.allowUntaggedFiles) - throw "could not tag file " + filePath; + if (!this.defaultFileTags) { + var relFilePath = (filePath.startsWith(root + '/') || filePath.startsWith(root + '\\')) + ? filePath.substring(root.length + 1) + : filePath; + throw "BlackboxOutputArtifactTracker: no matching file taggers for path '" + + relFilePath + "'. Set defaultFileTags to an array of file tags to " + + "apply to files not tagged by the fileTaggers map, which was:\n" + + JSON.stringify(this.fileTaggers, undefined, 4); + } return { filePath: filePath, - fileTags: [] + fileTags: this.defaultFileTags }; }; // TODO: Use File.directoryEntries |