You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When submodules update or new ones are added you can update as follows:
64
66
65
-
```
67
+
```text
66
68
git submodule update --init --recursive
67
69
```
68
70
69
-
# Usage
71
+
##Usage
70
72
71
73
Add the pmbuild repository directory / executable installation directory to your path for convenience so you can simply invoke `pmbuild`, otherwise you can locate pmbuild manually and run `<path_to_pmbuild>/pmbuild`.
72
74
@@ -99,7 +101,7 @@ Configs are written in [jsn](https://github.com/polymonster/jsn). Define build `
By default you can run all non-explicit tasks by simply running:
114
116
115
-
```
117
+
```text
116
118
# run all tasks
117
119
pmbuild <profile>
118
120
@@ -122,17 +124,17 @@ pmbuild <profile> -all
122
124
123
125
You can run a single task or a selection of tasks by passing the task name, or you can supply `-n<task_name>` to exclude a task:
124
126
125
-
```
127
+
```text
126
128
# runs 2 tasks
127
129
pmbuild mac -premake -texturec
128
130
129
131
# rus all tasks and excludes copy
130
132
pmbuild mac -all -ncopy
131
133
```
132
134
133
-
# Help / Display Available Profiles
135
+
##Help / Display Available Profiles
134
136
135
-
```
137
+
```text
136
138
pmbuild -help
137
139
usage:
138
140
pmbuild <profile> <tasks...>
@@ -174,9 +176,9 @@ profiles:
174
176
android
175
177
```
176
178
177
-
# Display Available Tasks For Profile
179
+
##Display Available Tasks For Profile
178
180
179
-
```
181
+
```text
180
182
pmbuild <profile> -help
181
183
available tasks for profile mac:
182
184
config.jsn (edit task settings or add new ones in here)
@@ -191,13 +193,13 @@ available tasks for profile mac:
191
193
pmbuild_config
192
194
```
193
195
194
-
# Display Help For Task
196
+
##Display Help For Task
195
197
196
-
```
198
+
```text
197
199
pmbuild <profile> -<task> -help
198
200
```
199
201
200
-
# Variables and Inheritence
202
+
##Variables and Inheritence
201
203
202
204
jsn allows inheritance and variables `${variable}` evaluated with dollar sign where variables are defined in the script. This allows sharing and re-use of tasks to make configs more compact.
203
205
@@ -217,11 +219,11 @@ jsn allows inheritance and variables `${variable}` evaluated with dollar sign wh
217
219
}
218
220
```
219
221
220
-
# Special / User Variables
222
+
##Special / User Variables
221
223
222
224
pmbuild also provides special variables evaluated with percentage sign as so `%{variable_name}` these are evaluated at runtime, configurable per user and stored in `config.user.jsn` in addition to supplying your own user args there are some built in ones as well:
223
225
224
-
```
226
+
```text
225
227
%{profile} = current building profile (ie mac, win32, linux etc)
226
228
%{cwd} = current working directory
227
229
%{username} = user name of the machine
@@ -235,11 +237,26 @@ pmbuild also provides special variables evaluated with percentage sign as so `%{
235
237
236
238
You can also pass `-vars` to pmbuild from the commandline as a string of jsn:
You can initialise user vars to default values and have the `-vars` passed to the commandline override them as so:
245
+
246
+
```yaml
247
+
task: {
248
+
user_vars: {
249
+
var_or_default: "default_value"
250
+
}
251
+
shell: {
252
+
commands: [
253
+
"echo %{var_or_default}"
254
+
]
255
+
}
256
+
}
257
+
```
258
+
259
+
## Copy / Files
243
260
244
261
You can copy files with a copy task, this is often necessary to move files into a data directory or deploy to a dev kit, simply specify an array of file pairs (source, destination) in a task of type copy. Here you can supply [glob](https://docs.python.org/3/library/glob.html) or [regex](https://docs.python.org/3/library/re.html) to find files, a directory or a single file:
245
262
@@ -290,6 +307,7 @@ copy-change-ext:
290
307
change_ext: ".newext"
291
308
}
292
309
```
310
+
293
311
You can also specify `excludes` which is an [fnmatch](https://docs.python.org/3/library/fnmatch.html) to further filter files after they are expanded by directory, regex or glob:
294
312
295
313
```yaml
@@ -313,7 +331,7 @@ texturec: {
313
331
314
332
It is possible to further filter the files processed by using the commandline argument `-filter_files "*.*"` this is an [fnmatch](https://docs.python.org/3/library/fnmatch.html) which you can supply each time you make a commandline invocation. This feature is usefult to isolate certain file extensions `*.lua` or a single file `path/single_file.txt` should you need to run and debug a a tool or process.
315
333
316
-
# Clean
334
+
##Clean
317
335
318
336
Clean out stale data and build from fresh, you can define clean tasks which will delete these directories:
319
337
@@ -328,11 +346,10 @@ clean: {
328
346
}
329
347
```
330
348
331
-
# Tools
349
+
##Tools
332
350
333
351
Run your own tools or scripts and feed them files with the `files` objects as described in the copy task. We can register different tools for <mac, windows or linux>.
334
352
335
-
336
353
```yaml
337
354
{
338
355
tools<mac>: {
@@ -408,7 +425,25 @@ tools_update: {
408
425
409
426
Run `pmbuild update` to update any tools to `latest` versions or specific tagged version using the `tag_name` parameter.
410
427
411
-
# Extension Python Modules
428
+
## Shell / Inline Python
429
+
430
+
You can supply shell commands or inline python inside scripts as so:
431
+
432
+
```yaml
433
+
shell: {
434
+
commands: [
435
+
"echo hello world"
436
+
]
437
+
}
438
+
439
+
python: {
440
+
code: [
441
+
"print('hello world!')"
442
+
]
443
+
}
444
+
```
445
+
446
+
## Extension Python Modules
412
447
413
448
You can register and call extension modules written in python, specify a path to the python module directory, the module name (.py file) and a function name to invoke when the build runs:
414
449
@@ -428,7 +463,7 @@ extensions: {
428
463
}
429
464
```
430
465
431
-
# Export Config Files
466
+
##Export Config Files
432
467
433
468
You can use `export.jsn` files in data directories to specify per directory or per file command line arguments to run. For example when converting textures we may want certain textures to be converted to a different format to others. export.jsn files override each other hierarchically by directory so you can have a single export.jsn at the root of a directory tree.
434
469
@@ -472,7 +507,7 @@ You can specify `rules` which select files and apply different settings. jsn inh
472
507
}
473
508
```
474
509
475
-
# Dependencies
510
+
##Dependencies
476
511
477
512
With builds you can choose to output dependency info containing build and file timestamps, the commandline used to build and a list of input and output files used during a build. Add `dependencies: true` to any tool with a `files` object to generate an output `.dep` file for each file that is built, subsequent builds will skip if the dependencies remain up-to-date. Dependency info is output in json and can be used in other tools as well to trigger hot reloading.
Sometimes in source asset data we may have a collection of files in a directory we want to group together to concatonate or merge them... for instance if we have individual images for cubemap faces and we want to pass them to a tool to spit out a single cubemap texture. Specify container and `files` comprised of an array of filenames or globs, these files will be written into a `.container.txt` file you can forward to other tools.
513
548
@@ -536,15 +571,15 @@ Sometimes in source asset data we may have a collection of files in a directory
536
571
}
537
572
```
538
573
539
-
# Task Types
574
+
##Task Types
540
575
541
576
Each task has a type, you can define this using the `type` member, if the name of the task is the same as a tool, extension or built in function then the `type` member is implicitly added.
542
577
543
578
```yaml
544
579
copy:
545
580
{
546
581
files: [
547
-
// ..
582
+
// ..
548
583
]
549
584
}
550
585
@@ -558,11 +593,11 @@ copy-second:
558
593
}
559
594
```
560
595
561
-
# Make
596
+
##Make
562
597
563
598
Make is a special command which is specified before the profile
564
599
565
-
```
600
+
```text
566
601
pmbuild make <profile> <target>
567
602
```
568
603
@@ -577,11 +612,11 @@ make: {
577
612
}
578
613
```
579
614
580
-
# Launch
615
+
##Launch
581
616
582
617
Launch is a special command like make which can be invoked as follows:
583
618
584
-
```
619
+
```text
585
620
pmbuild launch <profile> <target>
586
621
```
587
622
@@ -596,27 +631,27 @@ launch: {
596
631
}
597
632
```
598
633
599
-
# Tool
634
+
##Tool
600
635
601
636
You can bypass the need for build profiles and run any of the tools you have registered in your pmbuild `config.jsn`. use the following command and the pass `-args` anything after args is passed directly to the tool.
In a development environment we may need to synchronise large amounts of data which is stored on a server, or we may need to build artifacts to a server or deploy to a dev kit. we can mount connections to local area network connections via smb. You can supply credentials for the network connects in plain text, or encrypt them with cryptographic quality encryption to be stored and accessed with a password.
616
651
617
652
To use encrypted credentials you need to install the python cryptography module:
618
653
619
-
```
654
+
```text
620
655
pip install cryptography
621
656
```
622
657
@@ -645,7 +680,7 @@ connect-server:
645
680
646
681
To add to the credentials file run:
647
682
648
-
```
683
+
```text
649
684
pmbuild -credentials
650
685
```
651
686
@@ -657,7 +692,7 @@ A file `credentials.unlocked.jsn` will be generated in the current working direc
657
692
}
658
693
```
659
694
660
-
# Explicit Tasks
695
+
##Explicit Tasks
661
696
662
697
Tasks can be marked as explicit so that you must specify `-<task_name>` from the commandline and they do not get included automatically with `-all`. This is useful if you have build tasks which you may only need to run infrequently and take a long time to complete. Building third party libraries which are updated infrequently is an example where this can be useful:
663
698
@@ -674,7 +709,7 @@ libs: {
674
709
}
675
710
```
676
711
677
-
# Hidden Profiles and Tasks
712
+
##Hidden Profiles and Tasks
678
713
679
714
Tasks and profiles which are marked hidden will not be included in the list returned by `pmbuild -help`. The behaviour of the task or profile is not otherwise affected in any way. This is useful for streamlining the list of commands displayed to the user, or for excluding tasks/profiles which are never called explicitly (e.g. ones that are solely used as a base for inheritance). In the example below, setting the base task `copy_videos_base` to hidden and explicit makes it impossible for a user to call this generic version.
680
715
@@ -700,7 +735,7 @@ copy_mp4_files(copy_base):
700
735
701
736
```
702
737
703
-
# Enable/Disable Tasks
738
+
##Enable/Disable Tasks
704
739
705
740
Individual tasks in a given profile can be enabled/disabled by setting `enable: true` or `enable: false`. Tasks default to being enabled, and the enabled value is inherited across profiles. This makes it possible to inherit from a profile and make only certain tasks enabled or disabled. In the example below, `child_profile` would run `task_1` and `task_2`, whereas `base_profile` only runs `task_2`.
706
741
@@ -733,7 +768,7 @@ child_profile(base_profile):
733
768
734
769
```
735
770
736
-
# Build Order
771
+
##Build Order
737
772
738
773
By default tasks are built in the order they are specified in the config.jsn files. When using jsn inheritance it may not be clear what the build order might be or you may want to specify an explicit build order. You can do this using the `build_order` lists.
739
774
@@ -755,7 +790,7 @@ post_build_order" [
755
790
756
791
Each of the build order lists is optional. If you do not specify a task name in any of the build order lists it will be appended to the `build_order` list.
757
792
758
-
# vscode
793
+
##vscode
759
794
760
795
pmbuild can generate `launch.json`, `tasks.json` and `.code-workspace` files for vscode which use pmbuild and a configured make toolchain to build code and launch the exectuable for debugging.
761
796
@@ -789,4 +824,5 @@ vscode: {
789
824
cwd: "bin/osx"
790
825
}
791
826
```
827
+
792
828
You should install the vscode C/C++ extension, install and configure whatever debugger you would like tou use. You can supply different debuggers to the `debugger` member, such as `lldb` (cppdbg) or `gdb` (cppdbg) or `vscode` (cppvsdbg) depending on what you have installed.
0 commit comments