Utility Scripts

A series of helpers to make life easier.

Generate

Helps to generate new files for the project.

Generate Sample

All flags are optional. Setting --name is advised. If --output-dir is not set, the sample will be generated in the samples directory filed under the specified category.

./scripts/generate.py sample --name <SampleName> --category <category> --output-dir <output_dir>

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.h

A new class will also be generated

class SampleName : public VulkanSample {
...
};

Generate API Sample

API samples can be generated using the following command:

./scripts/generate.py sample_api --name <SampleName> --category <category> --output-dir <output_dir>

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.h

A new class will also be generated

class SampleName :public ApiVulkanSample {
...
};

Generate Android Project

./scripts/generate.py android
./scripts/generate.py android --output-dir build/<another_folder_name>

Clang Format

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