WDDelphiTools is a collection of useful libraries (units), command-line tools, and examples for Delphi development. This repository provides utilities to boost productivity, optimize compile times, and create automated build/AI pipelines for the Delphi ecosystem.
- DPT (Delphi Processing Tools): The "Swiss Army Knife" for Delphi. A comprehensive CLI tool providing:
- AI & Debugging: A standalone MCP (Model Context Protocol) Server for AI agents and a Workflow Engine for AI-assisted code analysis (
AiSession,McpDebugger). - Build-Management & CI/CD: Command-Line Building with preprocessor support and the ability to export portable build environments.
- Project & Code Analysis: Automated extracting of
.dprojconfigurations and FitNesse/Slim-based linting. - IDE Automation: Registering/unregistering design-time packages (BPLs) and opening units directly in the IDE via the
dpt://protocol.
- AI & Debugging: A standalone MCP (Model Context Protocol) Server for AI agents and a Workflow Engine for AI-assisted code analysis (
- DcuCompileTimes: An analysis tool that identifies compilation bottlenecks based on
.dcufile timestamps. - FileVersion: A command-line tool for outputting version information of binary files.
- StaticGenerics & TmplCodeGen: A system for generating static, typed lists and dictionaries at compile time to improve compilation speed when using generics extensively.
The main library consists of a set of WDDT.*.pas units in the root directory, which can be directly included in your projects:
WDDT.DelayedMethod.pas: Enables delayed method execution, cleanly synchronized with the main thread (via Timer). Ideal for decoupling method calls or "debouncing" multiple calls.WDDT.FileVersion.pas: An efficient helper for reading file and product versions from Executables or DLLs.WDDT.StringTools.pas: High-performance routines for string manipulation.WDDT.RTTI.pas: Helper functions for Runtime Type Information (RTTI), e.g., for copying object properties (CopyObject).WDDT.Vcl.Controls.pas: A collection of helper functions for working with VCL controls.WDDT.Vcl.RTTI.pas: Specific RTTI functions for VCL components, such asDeepCloneComponent.WDDT.MobileTools.pas: Tools for mobile development (e.g.,KeepScreenOnfor Android).
The Examples/ folder contains demonstrations and benchmarks:
- GenericsStudy: A comprehensive benchmark comparing different approaches to generics in Delphi (focusing on compile time and binary size).
- VclControls: Examples for using the
WDDT.Vcl.*helpers.
- Clone the repository:
Ensure you also initialize the submodules:
git clone https://github.com/WladiD/WDDelphiTools.git
git submodule update --init --recursive
- Prepare the library dependencies (e.g. generating missing JCL include files for newer Delphi versions like 13.1):
_PrepareLibs.bat
- Add the path to the
WDDT.*.pasfiles to your Delphi library path or search path to use the core units. - The tools in the
Projectsfolder can be compiled directly with Delphi (usually.batscripts are available for building).
This project is licensed under the MIT License.