-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.schema.v1.json
executable file
·508 lines (508 loc) · 19.6 KB
/
config.schema.v1.json
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/cardinalby/xgo-pack/master/config_schema/config.schema.v1.json",
"$defs": {
"Src": {
"properties": {
"main_pkg": {
"type": "string"
},
"icon": {
"type": "string",
"description": "Icon is a path to the icon file relative to Root. It will be converted to needed formats via imagemagick,\nso for psd files you can use icon.psd[0] to convert all layers"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetBuildConfig": {
"properties": {
"race": {
"type": "boolean",
"description": "Enable data race detection (supported only on amd64)"
},
"tags": {
"type": "string",
"description": "List of build tags to consider satisfied during the build"
},
"ldflags": {
"type": "string",
"description": "Arguments to pass on each go tool link invocation"
},
"mode": {
"type": "string",
"description": "Indicates which kind of object file to build"
},
"vcs": {
"type": "string",
"description": "Whether to stamp binaries with version control information"
},
"trimpath": {
"type": "boolean",
"description": "Remove all file system paths from the resulting executable"
},
"cross_args": {
"type": "string",
"description": "CGO dependency configure arguments"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetLinux": {
"properties": {
"common": {
"$ref": "#/$defs/TargetLinuxCommon",
"description": "Common will be used as defaults for all architectures"
},
"arm64": {
"$ref": "#/$defs/TargetLinuxArch"
},
"amd64": {
"$ref": "#/$defs/TargetLinuxArch"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetLinuxArch": {
"properties": {
"out_dir": {
"type": "string",
"description": "OutDir is a path relative to Config.DistDir where the final artifacts will be placed\nIf not set, \"linux_[arch]\" will be used"
},
"build_bin": {
"type": "boolean",
"description": "Defines if binary should be built\nIf empty, the binary will be created only if it's needed for deb package"
},
"build_deb": {
"type": "boolean",
"description": "Defines if deb package should be built\nIf empty, the deb package will not be created"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetLinuxCommon": {
"properties": {
"product_name": {
"type": "string",
"description": "ProductName is a human-readable name of the product. Is used in MacOS app bundle, dmg and Windows manifest\nIf not set, the last part of module name will be used"
},
"version": {
"type": "string",
"description": "Version is a version of the app. It's used in MacOS app bundle and Windows manifest\nIf not set, \"1.0.0\" will be used"
},
"identifier": {
"type": "string",
"description": "Identifier is a unique identifier for the app (used in MacOS bundle plist and Windows manifest),\nusually in reverse domain notation e.g. com.example.myapp\nIf not set, the reversed module name will be used"
},
"copyright": {
"type": "string",
"description": "Copyright is a copyright string (used in MacOS bundle plist and deb package)\nIf not set, the \"© [current_year], [identifier without the last part]\" will be used"
},
"high_dpi": {
"type": "boolean",
"description": "HighDpi is a flag to enable high dpi support on Windows and MacOS"
},
"go_build": {
"$ref": "#/$defs/TargetBuildConfig",
"description": "Arguments of go build command"
},
"bin_name": {
"type": "string",
"description": "The name of the resulting binary file. For Windows '.exe' extension will be added automatically\nIf not set, the last part of the main package path will be used"
},
"deb": {
"$ref": "#/$defs/TargetLinuxDeb",
"description": "Deb is a config for deb package"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetLinuxDeb": {
"properties": {
"deb_name": {
"type": "string",
"description": "Name of the resulting deb package file relative to arch `out_dir`\nIf empty, [common.product_name].deb will be used"
},
"custom_nfpm_config": {
"type": "string",
"description": "Path to custom nfpm config relative to the root.\nIf set, all other fields will be ignored and nfpm will be used with this config\nand \"XGO_PACK_\" env variables that can be used in config fields as placeholders:\n${XGO_PACK_DASHED_PRODUCT_NAME}, ${XGO_PACK_ARCH}, ${XGO_PACK_VERSION}"
},
"name": {
"type": "string",
"description": "If empty, common.ProductName will be used.\nFor allowed format see https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source\nThe string will be lower-cased and not supported symbols will be replaced with '-'"
},
"section": {
"type": "string",
"description": "If empty, \"default\" will be used"
},
"maintainer": {
"type": "string",
"description": "Recommended to be filled. If empty common.identifier without last part will be used"
},
"description": {
"type": "string"
},
"vendor": {
"type": "string"
},
"homepage": {
"type": "string"
},
"license": {
"type": "string"
},
"contents": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"description": "Additional files to include to the package (local path -\u003e destination abs path)"
},
"dst_bin_path": {
"type": "string",
"description": "Destination path for bin file in the package (as absolute path in the dest system)\nIf empty, \"/usr/bin/{common.bin_name}\" will be used"
},
"desktop_entry": {
"$ref": "#/$defs/TargetLinuxDebDesktopEntry",
"description": "desktop entry file options"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetLinuxDebDesktopEntry": {
"properties": {
"add_desktop_entry": {
"type": "boolean",
"description": "Defines if desktop entry should be added to the package\nIf empty, `true` will be used"
},
"add_icon": {
"type": "boolean",
"description": "Defines if icon should be added to the package\nIf empty, `true` will be used (only if add_desktop_entry is true)"
},
"dst_icon_path": {
"type": "string",
"description": "If empty, \"/usr/share/icons/[common.identifierProductName].png\" will be used"
},
"name": {
"type": "string",
"description": "Desktop entry name.\nIf empty, common.product_name will be used"
},
"type": {
"type": "string",
"description": "Desktop entry type. If empty, \"Application\" will be used"
},
"terminal": {
"type": "boolean",
"description": "Desktop entry Terminal key.\nIf empty, `true` will be used"
},
"no_display": {
"type": "boolean",
"description": "Desktop entry NoDisplay key.\nIf empty, `false` will be used"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetMacos": {
"properties": {
"common": {
"$ref": "#/$defs/TargetMacosCommon",
"description": "Will be used as defaults for all architectures"
},
"arm64": {
"$ref": "#/$defs/TargetMacosArch"
},
"amd64": {
"$ref": "#/$defs/TargetMacosArch"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetMacosArch": {
"properties": {
"out_dir": {
"type": "string",
"description": "OutDir is a path relative to Config.DistDir where the final artifacts will be placed\nIf not set, \"macos_[arch]\" will be used"
},
"build_bin": {
"type": "boolean",
"description": "Defines if binary should be built.\nIf false, the binary will be built only in case it's required to build bundle or dmg.\nTemporary path will be used in this case."
},
"build_bundle": {
"type": "boolean",
"description": "Defines if app bundle should be built.\nIf false, the bundle will be created only in case it's required to build dmg.\nTemporary path will be used in this case."
},
"build_dmg": {
"type": "boolean",
"description": "Defines if dmg should be built.\nIf empty, the dmg will not be created"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetMacosCommon": {
"properties": {
"product_name": {
"type": "string",
"description": "ProductName is a human-readable name of the product. Is used in MacOS app bundle, dmg and Windows manifest\nIf not set, the last part of module name will be used"
},
"version": {
"type": "string",
"description": "Version is a version of the app. It's used in MacOS app bundle and Windows manifest\nIf not set, \"1.0.0\" will be used"
},
"identifier": {
"type": "string",
"description": "Identifier is a unique identifier for the app (used in MacOS bundle plist and Windows manifest),\nusually in reverse domain notation e.g. com.example.myapp\nIf not set, the reversed module name will be used"
},
"copyright": {
"type": "string",
"description": "Copyright is a copyright string (used in MacOS bundle plist and deb package)\nIf not set, the \"© [current_year], [identifier without the last part]\" will be used"
},
"high_dpi": {
"type": "boolean",
"description": "HighDpi is a flag to enable high dpi support on Windows and MacOS"
},
"go_build": {
"$ref": "#/$defs/TargetBuildConfig",
"description": "Arguments of go build command"
},
"bin_name": {
"type": "string",
"description": "The name of the resulting binary file. For Windows '.exe' extension will be added automatically\nIf not set, the last part of the main package path will be used"
},
"codesign": {
"$ref": "#/$defs/TargetMacosCommonCodesign"
},
"bundle": {
"$ref": "#/$defs/TargetMacosCommonBundle"
},
"dmg": {
"$ref": "#/$defs/TargetMacosCommonDmg"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetMacosCommonBundle": {
"properties": {
"bundle_name": {
"type": "string",
"description": "BundleName is a name of the resulting app bundle relative to TargetMacosArch.OutDir.\nIf empty, \"[targets.common.product_name].app\" will be used"
},
"hide_in_dock": {
"type": "boolean",
"description": "HideInDock sets the plist flag in the app bundle to hide the app in dock"
}
},
"additionalProperties": false,
"type": "object",
"description": "TargetMacosCommonBundle is an arches common settings for MacOS bundle"
},
"TargetMacosCommonCodesign": {
"properties": {
"sign": {
"type": "boolean",
"description": "Use codesign tool to sign a binary and a bundle. Default is true.\nBy default, self-signed certificate will be used.\nrcodesign.toml in root dir can be used to configure custom options."
}
},
"additionalProperties": false,
"type": "object",
"description": "TargetMacosCommonCodesign is options for rcodesign tool run against binary and bundle"
},
"TargetMacosCommonDmg": {
"properties": {
"dmg_name": {
"type": "string",
"description": "DmgName is a name of the resulting dmg file relative to TargetMacosArch.OutDir.\nIf empty, \"[targets.common.product_name].dmg\" will be used"
},
"add_applications_symlink": {
"type": "boolean",
"description": "AddApplicationsSymlink is a flag to add a symlink to the /Applications folder in the dmg\nIf not set, true will be used"
}
},
"additionalProperties": false,
"type": "object",
"description": "TargetMacosCommonDmg is an arches common settings for MacOS dmg"
},
"TargetWindows": {
"properties": {
"common": {
"$ref": "#/$defs/TargetWindowsCommon",
"description": "Common will be used as defaults for all architectures"
},
"amd64": {
"$ref": "#/$defs/TargetWindowsArch"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetWindowsArch": {
"properties": {
"out_dir": {
"type": "string",
"description": "OutDir is a path relative to Config.DistDir where the final artifacts will be placed\nIf not set, \"windows_[arch]\" will be used"
},
"build_syso": {
"type": "boolean",
"description": "BuildSyso defines if .syso file should be built.\nIf false, the .syso file will be built only in case it's required to build binary\nTemporary path will be used in this case.\nTo keep the .syso file, set it to true"
},
"build_bin": {
"type": "boolean",
"description": "Defines if binary should be built"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetWindowsCommon": {
"properties": {
"product_name": {
"type": "string",
"description": "ProductName is a human-readable name of the product. Is used in MacOS app bundle, dmg and Windows manifest\nIf not set, the last part of module name will be used"
},
"version": {
"type": "string",
"description": "Version is a version of the app. It's used in MacOS app bundle and Windows manifest\nIf not set, \"1.0.0\" will be used"
},
"identifier": {
"type": "string",
"description": "Identifier is a unique identifier for the app (used in MacOS bundle plist and Windows manifest),\nusually in reverse domain notation e.g. com.example.myapp\nIf not set, the reversed module name will be used"
},
"copyright": {
"type": "string",
"description": "Copyright is a copyright string (used in MacOS bundle plist and deb package)\nIf not set, the \"© [current_year], [identifier without the last part]\" will be used"
},
"high_dpi": {
"type": "boolean",
"description": "HighDpi is a flag to enable high dpi support on Windows and MacOS"
},
"go_build": {
"$ref": "#/$defs/TargetBuildConfig",
"description": "Arguments of go build command"
},
"bin_name": {
"type": "string",
"description": "The name of the resulting binary file. For Windows '.exe' extension will be added automatically\nIf not set, the last part of the main package path will be used"
}
},
"additionalProperties": false,
"type": "object"
},
"Targets": {
"properties": {
"common": {
"$ref": "#/$defs/TargetsCommon",
"description": "Common will be used as defaults for all other targets"
},
"windows": {
"$ref": "#/$defs/TargetWindows"
},
"macos": {
"$ref": "#/$defs/TargetMacos"
},
"linux": {
"$ref": "#/$defs/TargetLinux"
}
},
"additionalProperties": false,
"type": "object"
},
"TargetsCommon": {
"properties": {
"product_name": {
"type": "string",
"description": "ProductName is a human-readable name of the product. Is used in MacOS app bundle, dmg and Windows manifest\nIf not set, the last part of module name will be used"
},
"version": {
"type": "string",
"description": "Version is a version of the app. It's used in MacOS app bundle and Windows manifest\nIf not set, \"1.0.0\" will be used"
},
"identifier": {
"type": "string",
"description": "Identifier is a unique identifier for the app (used in MacOS bundle plist and Windows manifest),\nusually in reverse domain notation e.g. com.example.myapp\nIf not set, the reversed module name will be used"
},
"copyright": {
"type": "string",
"description": "Copyright is a copyright string (used in MacOS bundle plist and deb package)\nIf not set, the \"© [current_year], [identifier without the last part]\" will be used"
},
"high_dpi": {
"type": "boolean",
"description": "HighDpi is a flag to enable high dpi support on Windows and MacOS"
},
"go_build": {
"$ref": "#/$defs/TargetBuildConfig",
"description": "Arguments of go build command"
},
"bin_name": {
"type": "string",
"description": "The name of the resulting binary file. For Windows '.exe' extension will be added automatically\nIf not set, the last part of the main package path will be used"
}
},
"additionalProperties": false,
"type": "object"
},
"XGoConfig": {
"properties": {
"go_version": {
"type": "string",
"description": "Go release to use for cross compilation (flag: go)"
},
"go_proxy": {
"type": "string",
"description": "Set a Global Proxy for Go Modules"
},
"verbose": {
"type": "boolean"
}
},
"additionalProperties": false,
"type": "object"
}
},
"properties": {
"$schema": {
"type": "string",
"description": "Used for JSON schema"
},
"presets": {
"items": {
"type": "string"
},
"type": "array",
"description": "Presets is a preset config names list that will be used as a base for the config.\nPresets will be applied in the order of appearance in the list, so the last one will override the previous ones."
},
"root": {
"type": "string",
"description": "Root path of the project. Absolute or relative to working directory."
},
"dist_dir": {
"type": "string",
"description": "DistDir is path (relative to root) of a directory for final build artifacts.\nIf not set, \"dist\" dir will be used"
},
"tmp_dir": {
"type": "string",
"description": "TmpDir is path (relative to root) of a temp directory for temporary build artifacts. If not set, a temporary\ndirectory will be created in DistDir"
},
"src": {
"$ref": "#/$defs/Src",
"description": "Src sets paths of source files and an icon"
},
"xgo": {
"$ref": "#/$defs/XGoConfig",
"description": "XGoConfig is a config for xgo tool"
},
"targets": {
"$ref": "#/$defs/Targets",
"description": "Targets is a config for building targets"
}
},
"additionalProperties": false,
"type": "object"
}