A series of helpers to make life easier.
Helps to generate new files for the project.
All flags are optional. Setting --name is advised.
If --output-dir is not set, the sample will be generated in the samples directory under the specified category.
After generation, entries are automatically added to Antora navigation and to the category README. You can optionally provide a one-line description for the category README using --readme-description; otherwise, you’ll be prompted interactively (a placeholder will be used if left empty).
./scripts/generate.py sample --name <SampleName> --category <category> [--output-dir <output_dir>] [--readme-description "One-line description"]Running the above line will generate the following files:
samples/category/my_sample/CMakeLists.txt
samples/category/my_sample/sample_name.cpp
samples/category/my_sample/sample_name.hA new class will also be generated
class SampleName : public VulkanSample {
...
};API samples can be generated using the following command:
./scripts/generate.py sample_api --name <SampleName> --category <category> [--output-dir <output_dir>] [--readme-description "One-line description"]Running the above line will generate the following files:
samples/category/my_sample/CMakeLists.txt
samples/category/my_sample/sample_name.cpp
samples/category/my_sample/sample_name.hA new class will also be generated
class SampleName :public ApiVulkanSample {
...
};If a Vulkan-Hpp template is available, you can generate a Vulkan-Hpp based sample. If the sample_hpp CMake template is not present, the script will fall back to sample_api and continue with a warning.
./scripts/generate.py sample_hpp --name <SampleName> --category <category> [--output-dir <output_dir>] [--readme-description "One-line description"]When called from the root of the repository, this script will run clang-format on all files in the repository that have been altered in the git diff
./scripts/clang-format.py <brand_to_diff>When called from the root of the repository, this script will check all files in the repository that have been altered in the git diff to ensure they have the correct license header.
./scripts/copyright.py <branch_to_diff>This is similar to the copyright CI check except when run with --fix this script will update the license headers in all files in the repository that have been altered in the git diff.
./scripts/copyright.py <branch_to_diff> --fix