Contributions in German or English are welcome. Language synchronization is handled by the maintainer no later than post-merge.
This repository provides a compact, battle-tested baseline for consistent Delphi code. It focuses on:
- A clear, modern Delphi Style Guide (German and English)
- A curated .gitignore tailored for Delphi
- A Git Attributes template for EOL normalization and binary protection
Both help teams write consistent code and avoid common friction.
Teams frequently commit files that should not be versioned (IDE artifacts, build outputs, local settings). This leads to:
- unnecessary diffs and merge conflicts
- unstable builds due to local artifacts
- unwanted side effects across the team
The curated, Delphi-specific .gitignore prevents exactly that. The Style Guide, in parallel, provides a shared understanding of structure, naming, and modern language features. Additionally, .gitattributes prevents false diffs due to line-ending mismatches (CRLF vs LF) and protects binary artifacts from accidental text filters/diff. See the contents section for details.
Beyond team settings, a consistent Style Guide also benefits solo developers over the long run. This guide follows proven, classic patterns seen in Delphi's RTL/VCL/FMX code, yet it is certainly opinionated. The most important thing is to agree on a style and apply it consistently across the codebase—consistency beats “perfect.”
- Curated GitIgnore template: Delphi GitIgnore.txt
- Git Attributes template: Delphi GitAttributes.txt
- Delphi Style Guide (DE): Delphi Style Guide DE.md
- Delphi Style Guide (EN): Delphi Style Guide EN.md
- Universal Build Script: DelphiBuildDPROJ.ps1 - PowerShell script for building Delphi projects via command line
- Release Tools: release-tools/ - Automated release creation
Note: The style guide is maintained in German and English. Please keep both documents in sync (maintainer will handle synchronization post-merge if needed).
- Agree on the style guide in your team
- Indentation: 2 spaces; line length: 120 chars (keep formatter/editor guideline in sync)
- Naming conventions (A-/L-/F‑prefixes, components, constants, enums with SCOPEDENUMS)
- Modern features: generics, anonymous methods, inline variables (10.3+), multiline strings (12+)
- Enable .gitignore
- Copy "Delphi GitIgnore.txt" to the repo root and rename it to ".gitignore"
- Add project-specific rules as needed
- Add Git Attributes
- Copy "Delphi GitAttributes.txt" to the repo root and rename it to ".gitattributes".
- It normalizes EOLs for Delphi sources (CRLF) and marks binary artifacts (.res, .ico, .dcu, .bpl, .dll, .exe) as binary.
- If your project stores .dfm/.fmx as text (default), keep the text rules. If stored as binary, switch to the binary rules in the template.
- For existing repos, after adding run:
git add --renormalize .and commit the changes.
The repository includes a universal PowerShell script for building Delphi projects from the command line. This is ideal for CI/CD pipelines, automated builds, or any scenario where you need to build Delphi projects without the IDE.
Features:
- Auto-detects the latest installed Delphi version from Windows Registry
- Supports all Delphi project files (.dproj)
- Configurable build configuration (Debug/Release) and platform (Win32/Win64)
- Colored console output for better readability
- Verbose mode for detailed build information
- No dependencies on specific projects - works with any Delphi project
Usage:
# Basic usage (auto-detects Delphi version, builds Debug/Win32)
.\DelphiBuildDPROJ.ps1 -ProjectFile "MyProject.dproj"
# Build Release for Win64
.\DelphiBuildDPROJ.ps1 -ProjectFile "MyProject.dproj" -Config Release -Platform Win64
# Use specific Delphi version with verbose output
.\DelphiBuildDPROJ.ps1 -ProjectFile "MyProject.dproj" -DelphiVersion "22.0" -VerboseOutputParameters:
-ProjectFile(required): Path to the .dproj file to build-Config: Build configuration (default: "Debug")-Platform: Target platform (default: "Win32")-DelphiVersion: Delphi version to use (default: auto-detect latest)-VerboseOutput: Enable verbose MSBuild output
Requirements:
- Embarcadero Delphi installed
- MSBuild available (Visual Studio Build Tools or full Visual Studio)
For more details, see the script documentation in DelphiBuildDPROJ.ps1.
Official releases are available in the release-assets/ directory. Each release includes:
- PDF versions of the style guides (German and English)
- Git templates (.gitignore and .gitattributes)
- Documentation
For creating new releases, see release-tools/README.md.
- Issues and PRs are welcome
- Single-language PRs (DE or EN) are fine; maintainer will sync the other language after merge
- Provide configuration templates for code formatters to implement this style guide (e.g., 2-space indentation, 120-char line length, synchronized vertical guideline)...
- Shared project presets (.dproj) or IDE settings for teams
MIT License – see notices in the files