[Qt-creator] Problems with wizard.json regarding resolution of variables

Stefan uni at stefan-hans.de
Thu Feb 25 10:05:33 CET 2016


Hello,

using variables within wizard related files works fine with wizard.xml, 
but not with wizard.json regarding resolution of variables.

e.g. %ProjectName% is test

{
     "version": 1,
     "kind": "project",
     "id": "A.CRN-Modul",
     "category": "A.Project",
     "trDescription": "Creates a console project to develop a CRN modul.",
     "trDisplayName": "CRN-Shell Modul Project",
     "trDisplayCategory": "CRN Projects",
     "icon": "../crn.png",
     "featuresRequired": [ "Plugin.QmakeProjectManager", 
"QtSupport.Wizards.FeatureQt" ],

     "options":
     [
         { "key": "ProFileName", "value": "%{JS: 
Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
         { "key": "IsTopLevelProject", "value": "%{JS: 
('%{Exists:ProjectExplorer.Profile.Ids}') ? '' : 'yes'}" }
     ],

     "pages":
     [
         {
             "trDisplayName": "Project Location",
             "trShortTitle": "Location",
             "typeId": "Project",
             "data": { "trDescription": "This wizard creates a main.cpp 
file to develop a CRN-Shell modul." }
         },
         {
             "trDisplayName": "Kit Selection",
             "trShortTitle": "Kits",
             "typeId": "Kits",
             "enabled": "%{IsTopLevelProject}",
             "data": { "projectFilePath": "%{ProFileName}" }
         },
         {
             "trDisplayName": "Project Management",
             "trShortTitle": "Summary",
             "typeId": "Summary"
         }
     ],
     "generators":
     [
         {
             "typeId": "File",
             "data":
             [
                 {
                     "source": "project.pro",
                     "target": "%{ProFileName}",
                     "openAsProject": true
                 },
                 {
                     "source": "main.cpp",
                     "target": "main.cpp",
                     "openAsProject": false
                 }
             ]
         }
     ]
}

=> %ProjectName%

<wizard version="1" kind="project"
         class="qmakeproject" firstpage="10"
         id="A.Plain C++" category="A.Project"
         featuresRequired="QtSupport.Wizards.FeatureQt">
     <icon>../crn.png</icon>
     <description>Creates a console project to develop a CRN 
modul.</description>
     <displayname>CRN-Shell Modul Project</displayname>;
     <displaycategory>CRN Projects</displaycategory>
     <files>
         <file source="main.cpp" target="main.%CppSourceSuffix%" 
openeditor="true"/>
         <file source="project.pro" target="%ProjectName%.pro" 
openproject="true"/>
     </files>
</wizard>

=> test


What is the difference in using wizard.json resp. wizard.xml? What am I 
doing wrong?

If you have an idea what it could be or any other hint, always welcome. 
If not, please just ignore me. At the moment I'm fine with wizard.xml.


Greetings

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20160225/2b5fcd0f/attachment.html>


More information about the Qt-creator mailing list