This repository contains tools used for building and packaging JBMod internally. We made them for us, but they're typically generic enough that you might find them useful too.
These tools are designed to be bare-bones, avoiding the overhead of heavy parsers or massive dependency trees. This keeps our execution fast and the build process snappy!
We use Bazel to ensure reproducible builds and simplify the build process across various platforms and languages.
To get started: using Bazelisk is recommended to automatically manage Bazel, as it will make your version match the GitHub Actions runner's version.
To build all tools, run:
bazel build //src/...To run a specific tool directly via Bazel, use:
bazel run //src/vpk-ctrl -- [OPTIONS]
bazel run //src/vpk-cleaner -- [OPTIONS]To run all tests:
bazel test //src/...Generate a VPK control file and print to stdout. This tool scans the specified directory and generates a control file that can be used to create VPK archives.
Usage: vpk-ctrl [OPTIONS] <PATHS>...
Arguments:
<PATHS>... Files, directories, or glob patterns to scan (use ! prefix to exclude)
Options:
-b, --base <BASE> Game base directory
-h, --help Print help
-V, --version Print version
Copy files from a source to a destination, excluding files listed in control files. This is used in tandem with vpk-ctrl to filter out files that have already been packed into VPKs, copying only the remaining unpackaged files to the output directory.
Note: To keep parsing light, control files passed to this tool are expected to be encoded in standard UTF-8. Be careful when generating control files with PowerShell, as some versions use UTF-16 instead of UTF-8 by default when using redirection.
Usage: vpk-cleaner [OPTIONS] <SRC> <DEST>
Arguments:
<SRC> Source directory to copy from
<DEST> Destination directory to copy to
Options:
-c, --ctrl-file <CTRL_FILE> VPK control file
-h, --help Print help
-V, --version Print version