Avoid duplicate *-php.xml files in "data/CMakeLists.txt"
ClosedPublic

Authored by cullmann on Feb 5 2019, 9:08 AM.

Details

Summary

When CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR are the same directory, the "data/generators/generate-php.pl" script creates the *-php.xml files in "data/syntax/", therefore, adding them in defs causes them to be loaded twice and warnings of duplicate contexts are shown when compiling:

[  8%] Generating index.katesyntax
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Start"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "FindHTML"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "FindEntityRefs"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "FindPEntityRefs"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "FindAttributes"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "FindDTDRules"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Comment"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "CDATA"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "PI"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Doctype"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Doctype Internal Subset"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Doctype Markupdecl"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Doctype Markupdecl DQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Doctype Markupdecl SQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "El Open"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "El Close"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "El Close 2"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "El Close 3"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "CSS"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "CSS content"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "JS"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "JS content"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "JS comment close"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Value"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Value NQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Value DQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "Value SQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/html-php.xml" Duplicate context: "FindPHP"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Base"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindSelector"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindFunctions"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindValues"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Annotation"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindUnits"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindStrings"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindComments"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Error"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "IsComments"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectAtRule"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "@keyframes"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Within-@keyframes"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "@viewport"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Within-@viewport"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "@font-face"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Within-@font-face"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "@page"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudo-@page"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Within-@page"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "IsProperty"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "NestedAtRule"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "NestedBase"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "AtRule"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "UnknownAtRule"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "AtRuleValue"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorAttr"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorAttrValue"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudo"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudoElements"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudoValueSelector"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudoValueCloseSelector"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudoValue"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "SelectorPseudoValueClose"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Comment"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "RuleSet"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Rule"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "IsVariable"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "RuleParameters"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Function"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FunctionVar"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FunctionCalc"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "NestedCalc"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "Calc"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FunctionUrl"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "UrlValue"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FunctionParameters"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "StringDQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "StringSQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "InsideString"
"/home/nibaldo/test/syntax-highlighting/data/syntax/css-php.xml" Duplicate context: "FindPHP"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Shebang"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Shebang Line"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Normal"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Object Member"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "NoRegExp"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Conditional Expression"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Object"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "FindStrings"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "String"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "String SQ"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Escape"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Character Escape"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Template"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "RawTemplate"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Substitution"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "FindComments"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Comment"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Multi/inline Comment"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Regular Expression"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "Regular Expression Character Class"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "(regex caret first check)"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "(charclass caret first check)"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "region_marker"
"/home/nibaldo/test/syntax-highlighting/data/syntax/javascript-php.xml" Duplicate context: "FindPHP"
[  9%] Generating qrc_theme-data.cpp
[ 10%] Generating qrc_syntax-data.cpp
/home/nibaldo/test/syntax-highlighting/data/syntax-data.qrc: Warning: potential duplicate alias detected: 'html-php.xml'
/home/nibaldo/test/syntax-highlighting/data/syntax-data.qrc: Warning: potential duplicate alias detected: 'css-php.xml'
/home/nibaldo/test/syntax-highlighting/data/syntax-data.qrc: Warning: potential duplicate alias detected: 'javascript-php.xml'

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Lint Skipped
Unit
Unit Tests Skipped
nibags created this revision.Feb 5 2019, 9:08 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 5 2019, 9:08 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Feb 5 2019, 9:08 AM
cullmann requested changes to this revision.Feb 12 2019, 7:35 PM

Hmm, is source == binary directory allowed at all?
I would prefer to generate the files into a different directory, e.g. ${CMAKE_CURRENT_BINARY_DIR}/syntax/generated, that would avoid them poping up at all in the search by accident, or?

This revision now requires changes to proceed.Feb 12 2019, 7:35 PM
cullmann commandeered this revision.Feb 12 2019, 8:16 PM
cullmann updated this revision to Diff 51542.
cullmann edited reviewers, added: nibags; removed: cullmann.

I would propose this, OK for you?

nibags accepted this revision.Feb 12 2019, 9:05 PM

It's good, I think it's a better solution ;D

This revision was not accepted when it landed; it landed in state Needs Review.Feb 14 2019, 1:18 PM
This revision was automatically updated to reflect the committed changes.