A Delphi design-time plugin and CLI that keep volatile project settings out of committed project files.
The goal is to reduce merge conflicts in .dproj files for teams working on the same codebase with different local IDE/runtime preferences.
In Delphi teams, conflicts in .dproj files are often caused not by functional code changes, but by local IDE settings automatically written to the project file.
Typical examples:
- Different active output platform across developers
Developer A saves with Win32 active, while Developer B saves with Win64 active. Even with no code changes, the project file changes and causes a merge conflict.
<!-- saved by developer A -->
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<!-- saved by developer B -->
<Platform Condition="'$(Platform)'==''">Win64</Platform>- Different Run Parameters for local debugging
Each developer uses different runtime parameters (ports, config files, feature flags, tenant, local credentials). If these values remain in .dproj, every save adds noisy commit changes.
<!-- machine A -->
<Debugger_RunParams>--port=8080 --env=local</Debugger_RunParams>
<!-- machine B -->
<Debugger_RunParams>--port=8090 --env=staging</Debugger_RunParams>- Delphi installations with different platform support
In mixed teams, some developers have Android/Linux SDK support configured and others do not. Opening and re-saving the same project can add/remove platform nodes that are not part of the intended project targets, creating constant noisy diffs.
<!-- introduced on a machine with extra platform support -->
<Platform value="Linux64">False</Platform>
<Platform value="Android64">False</Platform>Practical result: many commit conflicts on project files, even when no one changed application logic. This plugin separates local settings and keeps .dproj clean and stable in version control.
- Sanitizes
.dprojfiles after save. - Moves local run/debug settings to a sidecar file:
*.dproj.localcfgwhich stays in the developer workspace without being part of the git repository. - Supports command-line sanitization through
DprojSanitizerCli.
The sanitizer reads the enabled target platforms from the project itself (<Platforms> entries set to True) and keeps the project aligned with that list.
In practice it removes unsupported or disabled platform noise from sections that commonly drift across machines, such as:
- base platform
PropertyGroupentries for non-enabled targets Platformsentries explicitly set toFalse- unsupported platform nodes inside
Deployment
This is especially useful in mixed teams where developers use different Delphi installations (for example, some with Android/Linux SDK support and others without it). Without normalization, opening/saving the same project on different machines often reintroduces platform-specific changes and merge conflicts.
With this plugin, only platforms intentionally enabled in the project remain stable in version control.
In Delphi teams, some settings are developer-specific and change often. When these values remain in .dproj, they generate noisy diffs and merge conflicts.
This project keeps those values local while preserving a clean, stable .dproj in source control.
-
untLocalProjectSettings.pas: IDE plugin integration via ToolsAPI notifiers. -
untDprojSanitizer.pas: XML sanitizer for.dproj. -
untLocalDevSettingsStore.pas: Shared sidecar persistence layer. -
Tools/DprojSanitizerCli/DprojSanitizerCli.dpr: CLI tool for batch/automation usage.
The plugin writes local settings to:
YourProject.dproj.localcfg
Backward compatibility:
- Legacy files named
YourProject.dproj.teamowork.localare still read. - On next save, settings are written to
YourProject.dproj.localcfg.
Stored data includes:
- Current active platform
- Run parameters matrix by build configuration and platform
Only non-empty values are persisted. Disabled platforms are not persisted.
- RAD Studio / Delphi 12 (Athens) or compatible ToolsAPI version
dcc64/dcc32available in environment
Push-Location "c:\Athens\GitHub\TeamoworkFriendlyDproj"
dcc64 TeamoworkFriendlyDproj.dpk
Pop-LocationPush-Location "c:\Athens\GitHub\TeamoworkFriendlyDproj\Tools\DprojSanitizerCli"
dcc32 DprojSanitizerCli.dpr
Pop-LocationDprojSanitizerCli <file|folder|wildcard> [/s]Examples:
DprojSanitizerCli "C:\Repo\MyProject.dproj"
DprojSanitizerCli "C:\Repo\*.dproj"
DprojSanitizerCli "C:\Repo" /sNever commit local sidecars or Delphi local files.
Recommended ignore rules are included in .gitignore.
Some organizations still use CVS (Concurrent Versions System), a legacy VCS predating Git/SVN.
In CVS working copies, a file may appear "locally modified" only because its filesystem timestamp changed, even when file bytes are identical to the last checked-out version. This can happen with Delphi project files, because IDE save + post-processing may rewrite the file and then restore equivalent content.
This project includes a CVS-specific compatibility path in untLocalProjectSettings.pas that:
- runs only when a matching
CVS/Entriesrow exists for the file - captures pre-save bytes only if CVS considered the file clean before save
- compares pre-save vs post-sanitize bytes
- if bytes are equal, updates only the timestamp field in
CVS/Entriesfor that file
Important guarantees:
- It does not run
cvs update. - It does not fetch or merge remote changes.
- It does not force-reset real local edits.
- The plugin targets Delphi ToolsAPI behavior available in modern RAD Studio versions.
- If a sidecar XML file is empty/corrupt, the store recreates it on next save.
- Legacy sidecars with the old suffix are supported for reading and transparently migrated on save.
- Teams should agree on supported target platforms in the
.dprojto avoid unexpected local filtering.
MIT. See LICENSE.