Details
-
Bug
-
Resolution: Done
-
P2: Important
-
1.2.0
-
None
-
3b50726352fd1b1c5fc5424856ccb9446c87a30f
Description
Consider this example:
import qbs import qbs.FileInfo import qbs.TextFile Project { CppApplication { files: [ "one.h", "two.h", "one.cpp", "two.cpp", "main.cpp" ] Group { files: ["one.h", "two.h"] fileTags: ["pch"] overrideTags: false } Rule { inputs: ['pch'] multiplex:true Artifact { fileName: "pch_headers.h" fileTags: [ "hpp" ] } prepare: { var cmd = new JavaScriptCommand(); cmd.description = "generating precompiled header file"; cmd.sourceCode = function() { var fileContent="#if defined __cplusplus\n"; for(var i in inputs.pch) { fileContent+="#include \"" +FileInfo.fileName(inputs.pch[i].filePath) + "\"\n"; } fileContent+="#endif" var file = new TextFile(output.filePath, TextFile.WriteOnly); file.truncate(); file.write(fileContent); file.close(); } return cmd; } } } }
The rule does not run.
In the log appears:
TRACE: [PR] adding file tags (hpp) to one.h TRACE: [PR] adding file tags (hpp) to two.h TRACE: [PR] adding file tags (cpp) to one.cpp TRACE: [PR] adding file tags (cpp) to two.cpp TRACE: [PR] adding file tags (cpp) to main.cpp TRACE: [PR] adding file tags (pch, hpp) to one.h TRACE: [PR] adding file tags (pch, hpp) to two.h
Commenting out {{"one.h", "two.h"}} in the Product.files binding lets the rule run. The log looks like this:
TRACE: [PR] adding file tags (cpp) to one.cpp
TRACE: [PR] adding file tags (cpp) to two.cpp
TRACE: [PR] adding file tags (cpp) to main.cpp
TRACE: [PR] adding file tags (hpp, pch) to one.h
TRACE: [PR] adding file tags (hpp, pch) to two.h
Issues:
- the rule should run in the first case
- looks like the FileTaggers are run if overrideTags is false
- if overrideTags is true, there's no log output for the headers