Delphi needs a few more wizards – verify dpr against dproj and check both against files on disk
Posted by jpluimers on 2018/05/31
There are a few experts Delphi needs for project management:
- verify the .dproj against the .dpr as these get out of sync often, especially in multi-person or multi-branch projects
- verify .dproj and .dpr against files on disk (often there are files on disk not in the Project Manager; Visual Studio has this nice [WayBack] “Show All Files” button that helps fixing this there)
via [WayBack] Is there a way to export the file structure of a Project from the Project Manager view to a txt file? – John Kouraklis – Google+
Atilla Kovaks posted a small bash script to get started: [WayBack] http://pisil.de/prfiles.sh.txt
–jeroen
From https://pastebin.com/fcsiLc6Q :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# !!! Be careful with scripts, always do your backup or play on a copy !!! | |
if [[ $# -eq 0 ]] ; then | |
echo 'usage: prfiles.sh project.dproj' | |
exit 1 | |
fi | |
declare file_content=$( cat $1 | sed -nr "/DCCReference Include/I{s/(.*)\"(.*)\"(.*)/\2/g;p}" ) | |
shopt -s nocasematch | |
for i in `find . -name "*.pas" -type f -printf '%f\n'`; do | |
[[ ! " $file_content " =~ $i ]] && echo $i "not in dproj" | |
done | |
exit |
Attila Kovacs said
my webserver is temporary suspended due to GDPR :P
here is the script:
#!/bin/bash
!!! Be careful with scripts, always do your backup or play on a copy !!!
if [[ $# -eq 0 ]] ; then
echo ‘usage: prfiles.sh project.dproj’
exit 1
fi
declare file_content=$( cat $1 | sed -nr “/DCCReference Include/I{s/(.)\”(.)\”(.*)/\2/g;p}” )
shopt -s nocasematch
for i in
find . -name "*.pas" -type f -printf '%f\n'
; do[[ ! ” $file_content ” =~ $i ]] && echo $i “not in dproj”
done
exit
Attila Kovacs said
which is of course corrupted in the comment, so again, https://pastebin.com/fcsiLc6Q
jpluimers said
Thanks for that! I’ll put your pastebin in a gist and put that in my article.