Batch scripts to automate some Unreal Engine 5 project development operations: cleaning, building, packaging, backing up etc.
Place DevOps
directory under the root project directory.
- Core
- Standalone
- backup_code.bat
- backup_from_gitignore.bat
- build_cook_archive.bat
- build_solution_development_editor.bat
- clean_intermediate_files.bat
- generate_vs_project_files.bat
- rebuild_python_stub.bat
- rebuild_solution_development_editor.bat
- rebuild_solution_game_shipping.bat
- resave.bat
- resave_and_generate_DDC.bat
- validate_assets.bat
Core file executed by every script.
- Will find *.uproject file and set project name from it.
- Read Unreal Engine version from *.uproject.
- Find path in registry for this engine version.
- Set additional config vars.
TODO - should be rewritten with python.
Core file executed by backup scripts only.
- Call
config.bat
first - Set archive file suffix based on current date and time
- Set
7z.exe
path - Set backup dir path
TODO - read %BACKUP_ROOT_DIR%
from config file. Current value is e:\DATA\Backups
Launch script for generate_readme.py
If launched with argument (should be directory path), pass it as script --dir
argument (override root scan dir),
otherwise launch generate_readme.py
without any arguments (in default mode will scan directory one level up)
Simple README.md
generator. Scan and parse *.bat
and *.py
files, get first comment in file and generate Markdown text.
Text will be inserted between
<!-- AUTO_GENERATED_CONTENT_START -->
and
<!-- AUTO_GENERATED_CONTENT_END -->
comments or will be appended to the end of existing (or new) README.md
file.
For *.bat
get header comment block (started with ::
)
For *.py
get module docstring value.
CLI options:
--dir DIRECTORY
Override root scan dir (type: str, default: directory one level up)--toc ENABLED
Generate table of contents (type: int, default: 1)
Collection of utility functions to display messages to terminal
Simple standalone backup script. Archive file or folder provided as argument to 'BACKUPS' subdir. Based on https://gist.github.com/adamcaudill/2322221
Installation:
- Windows+R
shell:sendto
to openSendTo
directory- Create shortcut to
simple_backup.bat
inSendTo
directory
Using:
- Right click on file or folder and select
Send to - Simple Backup
Place in project root dir and run to resave packages and generate DerivedDataCache for project. Help to speed up first (or after engine version update) launch of large project (City Sample, Lyra etc.)
- Note: unrealcmdpath is hardcoded, don't forget update it with correct engine path/version
Simple and fast backup for c++ code. Save to 7z archive Source and Config folders from Project and Project Plugins.
Archive placed to %BACKUP_ROOT_DIR%
defined in DevOps\Core\config_archiver.bat
file (default - e:\DATA\Backups
).
Perform (almost) full backup of project.
- Stage 1. Create archive based on .gitignore in root project folder.
- Stage 2. Add extra files to archive (probably ignored by version control)
- Content dir
- *.DotSettings.user (Rider settings)
- .idea\ (Rider settings)
- Plugins Content, Config and Source dirs
- Saved\Config\WindowsEditor\ (local configs)
Archive placed to %BACKUP_ROOT_DIR%
defined in DevOps\Core\config_archiver.bat
file (default - e:\DATA\Backups
)
Build game with cooked content
Build solution for editor
Clean project and project plugins Binaries Intermediate Saved dirs.
WARNING!
This script will permanently delete folders and files from project. Should be used with caution!
Dirs deleted from project:
- .vs
- Binaries
- Build
- DerivedDataCache
- Intermediate
- Saved\Automation
- Saved\Autosaves
- Saved\Cooked
- Saved\Crashes
- Saved\Logs
- Saved\MaterialStats
- Saved\MaterialStatsDebug
- Saved\Shaders
- Saved\SourceControl
- Saved\StagedBuilds
- Saved\Temp
- Saved\Config\CrashReportClient
Files deleted from project:
- *.sln
Dirs deleted from project plugins:
- Plugins\*\Binaries
- Plugins\*\Intermediate
- Plugins\*\Saved
NOTE - currently ignoring project plugins in sub dirs (like Plugins\GameFeatures
)
TODO - this list should be autogenerated
Generate Visual Studio solution
Manually generate python stub file for current project.
Generated file placed to
%RootProjectDir%/Intermediate/PythonStub/unreal.py
Rebuild solution for editor
Rebuild solution for shipping
Resave current project packages, fix redirectors
Resave current project packages, fix redirectors, generate DerivedDataCache
Perform command line assets validation