aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards/qtcreatorplugin/wizard.json
blob: cbaca648fe68942f9f4aa13903a30ed1ca1e09ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
{
    "version": 1,
    "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ],
    "id": "R.QtCreatorPlugin",
    "category": "G.Library",
    "trDescription": "Creates a custom Qt Creator plugin.",
    "trDisplayName": "Qt Creator Plugin",
    "trDisplayCategory": "Library",
    "icon": "qtcreatorplugin.png",
    "featuresRequired": [ "QtSupport.Wizards.FeatureQt", "QtSupport.Wizards.FeatureDesktop" ],
    "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}",

    "options":
    [
        { "key": "ProjectFile", "value": "%{ProFile}" },
        { "key": "PluginNameLower", "value": "%{JS: value('PluginName').toLowerCase()}"},
        { "key": "ProFile", "value": "%{JS: Util.fileName(value('PluginNameLower'), 'pro')}" },
        { "key": "PluginJsonFile", "value": "%{JS: Util.fileName(value('PluginName'), 'json.in')}" },
        { "key": "LibraryDefine", "value": "%{JS: Cpp.headerGuard(value('PluginName')) + '_LIBRARY'}" },
        { "key": "LibraryExport", "value": "%{JS: Cpp.headerGuard(value('PluginName')) + '_EXPORT'}" },
        { "key": "SrcFileName", "value": "%{JS: Util.fileName(value('PluginNameLower'), Util.preferredSuffix('text/x-c++src'))}" },
        { "key": "HdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower'), Util.preferredSuffix('text/x-c++hdr'))}" },
        { "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" },
        { "key": "ConstantsHdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower') + 'constants', Util.preferredSuffix('text/x-c++hdr'))}" },
        { "key": "CN", "value": "%{JS: Cpp.className(value('PluginName') + 'Plugin')}" },
        { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('CN'), Util.suffix(value('HdrFileName')))}" },
        { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" },
        { "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" },
        { "key": "CONSTANTS_GUARD", "value": "%{JS: Cpp.headerGuard(value('ConstantsHdrFileName'))}" }
    ],

    "pages":
    [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project",
            "data": { "trDescription": "This wizard creates a custom Qt Creator plugin." }
        },
        {
            "trDisplayName": "Define Project Details",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data":
            [
                {
                    "name": "ClassPageDescription",
                    "type": "Label",
                    "data":
                    {
                        "trText": "Specify details about your custom Qt Creator plugin.",
                        "wordWrap": true
                    }
                },
                {
                    "name": "PluginName",
                    "trDisplayName": "Plugin name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data":
                    {
                        "validator": "[a-zA-Z_][a-zA-Z_0-9]*",
                        "trText": "%{JS: value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1)}"
                    }
                },
                {
                    "name": "VendorName",
                    "persistenceKey": "VendorName",
                    "trDisplayName": "Vendor name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data":
                    {
                        "trText": "MyCompany"
                    }
                },
                {
                    "name": "Copyright",
                    "trDisplayName": "Copyright:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data":
                    {
                        "trText": "(C) %{VendorName}"
                    }
                },
                {
                    "name": "License",
                    "trDisplayName": "License:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data":
                    {
                        "trText": "Put short license information here"
                    }
                },
                {
                    "name": "Description",
                    "trDisplayName": "Description:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data":
                    {
                        "trText": "Put a short description of your plugin here"
                    }
                },
                {
                    "name": "Url",
                    "persistenceKey": "VendorUrl",
                    "trDisplayName": "URL:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data":
                    {
                        "trText": "https://www.%{JS: encodeURIComponent(value('VendorName').toLowerCase())}.com"
                    }
                },
                {
                    "name": "QtCreatorSources",
                    "persistenceKey": "QtCreatorSources",
                    "trDisplayName": "Qt Creator sources:",
                    "mandatory": true,
                    "type": "PathChooser",
                    "data":
                    {
                        "kind": "existingDirectory"
                    }
                },
                {
                    "name": "QtCreatorBuild",
                    "persistenceKey": "QtCreatorBuild",
                    "trDisplayName": "Qt Creator build:",
                    "mandatory": true,
                    "type": "PathChooser",
                    "data":
                    {
                        "kind": "existingDirectory"
                    }
                },
                {
                    "name": "DestDir",
                    "persistenceKey": "QtCreatorPluginDestDir",
                    "trDisplayName": "Deploy into:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                        [
                            {
                                "trKey": "Qt Creator Build",
                                "value": "# "
                            },
                            {
                                "trKey": "Local User Settings",
                                "value": ""
                            }
                        ]
                    }
                }
            ]
        },
        {
            "trDisplayName": "Translation File",
            "trShortTitle": "Translation",
            "typeId": "QtTranslation"
        },
        {
            "trDisplayName": "Kit Selection",
            "trShortTitle": "Kits",
            "typeId": "Kits",
            "enabled": "%{JS: !value('IsSubproject')}",
            "data": { "projectFilePath": "%{ProjectFile}" }
        },
        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],
    "generators":
    [
        {
            "typeId": "File",
            "data":
            [
                {
                    "source": "myplugin.pro",
                    "target": "%{ProFile}",
                    "openAsProject": true
                },
                {
                    "source": "github_workflow_build_qmake.yml",
                    "target": ".github/workflow/build_qmake.yml"
                },
                {
                    "source": "github_workflow_README.md",
                    "target": ".github/workflow/README.md"
                },
                {
                    "source": "myplugin.cpp",
                    "target": "%{SrcFileName}",
                    "openInEditor": true
                },
                {
                    "source": "myplugin.h",
                    "target": "%{HdrFileName}"
                },
                {
                    "source": "myplugin_global.h",
                    "target": "%{GlobalHdrFileName}"
                },
                {
                    "source": "mypluginconstants.h",
                    "target": "%{ConstantsHdrFileName}"
                },
                {
                    "source": "MyPlugin.json.in",
                    "target": "%{PluginJsonFile}"
                },
                {
                    "source": "../projects/translation.ts",
                    "target": "%{TsFileName}",
                    "condition": "%{HasTranslation}"
                },
                {
                    "source": "../projects/git.ignore",
                    "target": ".gitignore",
                    "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}"
                }
            ]
        }
    ]
}