• R/O
  • SSH
  • HTTPS

dzprepbuild: Commit


Commit MetaInfo

Révision73 (tree)
l'heure2019-11-02 21:25:06
Auteurdummzeuch

Message de Log

* bugfix: reading .dproj and .bdsproj files was broken: The Entries for private and special builds are called "Private" and "Special", not "IsPrivateBuild" and "IsSpecialBuild" (I can only blame myself for accepting a patch that breaks functionality without having tested it :-( )
* for whatever reason the filename of the XML file was stored twice: In FXmlFilename and in FProjectFilename
* Bugfix: TCentralIniVersionInfo never initialized FProjectName but used it instead of FIniFilename
* Error messages when reading from a file now contain the file name
* new placeholders for any strings: {MajorVer}, {MinorVer} and {ProjectName}
* TIniVersionInfo.Create now also checks that the given sections exist.
* Refactoring
* Added some summary comments
* turned on map file generation

Change Summary

Modification

--- trunk/src/PrepBuild.dproj (revision 72)
+++ trunk/src/PrepBuild.dproj (revision 73)
@@ -1,215 +1,220 @@
1- <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2- <PropertyGroup>
3- <ProjectGuid>{209412ac-0ec2-4f63-b92a-e78853ff142a}</ProjectGuid>
4- <MainSource>PrepBuild.dpr</MainSource>
5- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6- <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
7- <DCC_DependencyCheckOutputName>..\PrepBuild.exe</DCC_DependencyCheckOutputName>
8- <ProjectVersion>13.4</ProjectVersion>
9- <Config Condition="'$(Config)'==''">Debug</Config>
10- <Base>True</Base>
11- <AppType>Application</AppType>
12- <FrameworkType>VCL</FrameworkType>
13- <Platform Condition="'$(Platform)'==''">Win32</Platform>
14- <TargetedPlatforms>1</TargetedPlatforms>
15- </PropertyGroup>
16- <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
17- <Base>true</Base>
18- </PropertyGroup>
19- <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
20- <Base_Win32>true</Base_Win32>
21- <CfgParent>Base</CfgParent>
22- <Base>true</Base>
23- </PropertyGroup>
24- <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
25- <Cfg_1>true</Cfg_1>
26- <CfgParent>Base</CfgParent>
27- <Base>true</Base>
28- </PropertyGroup>
29- <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
30- <Cfg_1_Win32>true</Cfg_1_Win32>
31- <CfgParent>Cfg_1</CfgParent>
32- <Cfg_1>true</Cfg_1>
33- <Base>true</Base>
34- </PropertyGroup>
35- <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
36- <Cfg_2>true</Cfg_2>
37- <CfgParent>Base</CfgParent>
38- <Base>true</Base>
39- </PropertyGroup>
40- <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
41- <Cfg_2_Win32>true</Cfg_2_Win32>
42- <CfgParent>Cfg_2</CfgParent>
43- <Cfg_2>true</Cfg_2>
44- <Base>true</Base>
45- </PropertyGroup>
46- <PropertyGroup Condition="'$(Base)'!=''">
47- <Manifest_File>None</Manifest_File>
48- <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
49- <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
50- <VerInfo_Locale>2057</VerInfo_Locale>
51- <DCC_Define>no_translation;NO_TRANSLATION_HINT;$(DCC_Define)</DCC_Define>
52- <DCC_ExeOutput>..</DCC_ExeOutput>
53- <DCC_UNIT_PLATFORM>false</DCC_UNIT_PLATFORM>
54- <DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
55- <DCC_DcuOutput>..\$(Config)\$(Platform)\dcu</DCC_DcuOutput>
56- <DCC_UnitSearchPath>..\libs\dzlib\src;..\libs\dzlib\templates;..\libs\jcl\source\include;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;..\libs\jcl\source\include\jedi;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
57- <DCC_DependencyCheckOutputName>PrepBuild.exe</DCC_DependencyCheckOutputName>
58- </PropertyGroup>
59- <PropertyGroup Condition="'$(Base_Win32)'!=''">
60- <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
61- <PreBuildEvent><![CDATA[..\buildtools\prebuild.cmd $(PROJECTPATH)
62-$(PreBuildEvent)]]></PreBuildEvent>
63- <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
64- <Debugger_RunParams>--incbuild --readini=testdata\testproject --updateini=testdata\testproject --writerc=testdata\testproject</Debugger_RunParams>
65- <VerInfo_Locale>1033</VerInfo_Locale>
66- <PostBuildEvent><![CDATA[..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)
67-$(PostBuildEvent)]]></PostBuildEvent>
68- </PropertyGroup>
69- <PropertyGroup Condition="'$(Cfg_1)'!=''">
70- <DCC_ExeOutput>..</DCC_ExeOutput>
71- <Version>7.0</Version>
72- <DCC_DebugInformation>False</DCC_DebugInformation>
73- <DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
74- <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
75- <DCC_ObjOutput>dcu</DCC_ObjOutput>
76- <DCC_HppOutput>dcu</DCC_HppOutput>
77- <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
78- </PropertyGroup>
79- <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
80- <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
81- <VerInfo_Locale>1033</VerInfo_Locale>
82- </PropertyGroup>
83- <PropertyGroup Condition="'$(Cfg_2)'!=''">
84- <DCC_DebugDCUs>true</DCC_DebugDCUs>
85- <DCC_DependencyCheckOutputName>..\PrepBuild.exe</DCC_DependencyCheckOutputName>
86- <Version>7.0</Version>
87- <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
88- <DCC_ExeOutput>..</DCC_ExeOutput>
89- <DCC_ResourcePath>$(BDS)\lib\Debug;..\libs\dzlib\src;..\libs\dztemplates\templates;..\libs\dztemplates\units;..\libs\dzCmdLineParser\src;..\libs\jcl\source;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;$(DCC_ResourcePath)</DCC_ResourcePath>
90- <DCC_ObjPath>$(BDS)\lib\Debug;..\libs\dzlib\src;..\libs\dztemplates\templates;..\libs\dztemplates\units;..\libs\dzCmdLineParser\src;..\libs\jcl\source;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;$(DCC_ObjPath)</DCC_ObjPath>
91- <DCC_IncludePath>$(BDS)\lib\Debug;..\libs\dzlib\src;..\libs\dztemplates\templates;..\libs\dztemplates\units;..\libs\dzCmdLineParser\src;..\libs\jcl\source;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;$(DCC_IncludePath)</DCC_IncludePath>
92- <DCC_SYMBOL_PLATFORM>False</DCC_SYMBOL_PLATFORM>
93- <DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
94- <DCC_Optimize>False</DCC_Optimize>
95- </PropertyGroup>
96- <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
97- <Debugger_RunParams>--incbuild --BuildDateTime={today} --readini=testdata\testproject --updateini=testdata\testproject --WriteRc=testdata\testproject --InputManifest=testdata\testproject.manifest.in --manifest=testdata\testproject --updatemanifest --WriteManifestRc=testdata\testproject --theming=on</Debugger_RunParams>
98- <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
99- <VerInfo_Locale>1033</VerInfo_Locale>
100- </PropertyGroup>
101- <ProjectExtensions>
102- <Borland.Personality>Delphi.Personality.12</Borland.Personality>
103- <Borland.ProjectType/>
104- <BorlandProject>
105- <Delphi.Personality>
106- <Parameters>
107- <Parameters Name="RunParams">--incbuild --readini=testdata\testproject --updateini=testdata\testproject --writerc=testdata\testproject</Parameters>
108- </Parameters>
109- <VersionInfo>
110- <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
111- <VersionInfo Name="AutoIncBuild">False</VersionInfo>
112- <VersionInfo Name="MajorVer">1</VersionInfo>
113- <VersionInfo Name="MinorVer">0</VersionInfo>
114- <VersionInfo Name="Release">0</VersionInfo>
115- <VersionInfo Name="Build">0</VersionInfo>
116- <VersionInfo Name="Debug">False</VersionInfo>
117- <VersionInfo Name="PreRelease">False</VersionInfo>
118- <VersionInfo Name="Special">False</VersionInfo>
119- <VersionInfo Name="Private">False</VersionInfo>
120- <VersionInfo Name="DLL">False</VersionInfo>
121- <VersionInfo Name="Locale">2057</VersionInfo>
122- <VersionInfo Name="CodePage">1252</VersionInfo>
123- </VersionInfo>
124- <Excluded_Packages>
125- <Excluded_Packages Name="$(BDSBIN)\bcboffice2k160.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
126- <Excluded_Packages Name="$(BDSBIN)\bcbofficexp160.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
127- <Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
128- <Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
129- </Excluded_Packages>
130- <Source>
131- <Source Name="MainSource">PrepBuild.dpr</Source>
132- </Source>
133- <VersionInfoKeys>
134- <VersionInfoKeys Name="CompanyName"/>
135- <VersionInfoKeys Name="FileDescription"/>
136- <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
137- <VersionInfoKeys Name="InternalName"/>
138- <VersionInfoKeys Name="LegalCopyright"/>
139- <VersionInfoKeys Name="LegalTrademarks"/>
140- <VersionInfoKeys Name="OriginalFilename"/>
141- <VersionInfoKeys Name="ProductName"/>
142- <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
143- <VersionInfoKeys Name="Comments"/>
144- </VersionInfoKeys>
145- </Delphi.Personality>
146- <ModelSupport>False</ModelSupport>
147- <Platforms>
148- <Platform value="Win64">False</Platform>
149- <Platform value="Win32">True</Platform>
150- </Platforms>
151- </BorlandProject>
152- <ProjectFileVersion>12</ProjectFileVersion>
153- </ProjectExtensions>
154- <ItemGroup>
155- <DelphiCompile Include="$(MainSource)">
156- <MainSource>MainSource</MainSource>
157- </DelphiCompile>
158- <DCCReference Include="d_XmlVersionInfo.pas">
159- <Form>dm_XmlVersionInfo</Form>
160- <DesignClass>TDataModule</DesignClass>
161- </DCCReference>
162- <DCCReference Include="d_DprojVersionInfo.pas">
163- <Form>dm_DprojVersionInfo</Form>
164- <DesignClass>TDataModule</DesignClass>
165- </DCCReference>
166- <DCCReference Include="d_BdsProjVersionInfo.pas">
167- <Form>dm_BdsProjVersionInfo</Form>
168- <DesignClass>TDataModule</DesignClass>
169- </DCCReference>
170- <DCCReference Include="d_ManifestVersionInfo.pas">
171- <Form>dm_ManifestVersionInfo</Form>
172- <DesignClass>TDataModule</DesignClass>
173- </DCCReference>
174- <DCCReference Include="i_VersionInfoAccess.pas"/>
175- <DCCReference Include="u_DofVersionInfo.pas"/>
176- <DCCReference Include="u_IniVersionInfo.pas"/>
177- <DCCReference Include="u_CentralIniVersionInfo.pas"/>
178- <DCCReference Include="u_PrepBuildMain.pas"/>
179- <DCCReference Include="u_VersionInfo.pas"/>
180- <DCCReference Include="..\libs\dzlib\forms\w_dzDialog.pas">
181- <Form>f_dzDialog</Form>
182- </DCCReference>
183- <DCCReference Include="..\libs\dzlib\src\u_dzDefaultMain.pas"/>
184- <BuildConfiguration Include="Debug">
185- <Key>Cfg_2</Key>
186- <CfgParent>Base</CfgParent>
187- </BuildConfiguration>
188- <BuildConfiguration Include="Base">
189- <Key>Base</Key>
190- </BuildConfiguration>
191- <BuildConfiguration Include="Release">
192- <Key>Cfg_1</Key>
193- <CfgParent>Base</CfgParent>
194- </BuildConfiguration>
195- </ItemGroup>
196- <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
197- <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\8.0\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\8.0\UserTools.proj"/>
198- <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
199- <PropertyGroup Condition="'$(Config)'=='Release' And '$(Platform)'=='Win32'">
200- <PreBuildEvent>..\buildtools\prebuild.cmd $(PROJECTPATH)</PreBuildEvent>
201- <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode>
202- <PreLinkEvent/>
203- <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode>
204- <PostBuildEvent>..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)</PostBuildEvent>
205- <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode>
206- </PropertyGroup>
207- <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win32'">
208- <PreBuildEvent>..\buildtools\prebuild.cmd $(PROJECTPATH)</PreBuildEvent>
209- <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode>
210- <PreLinkEvent/>
211- <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode>
212- <PostBuildEvent>..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)</PostBuildEvent>
213- <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode>
214- </PropertyGroup>
215- </Project>
1+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+ <PropertyGroup>
3+ <Base>True</Base>
4+ <AppType>Application</AppType>
5+ <Config Condition="'$(Config)'==''">Debug</Config>
6+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+ <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
8+ <DCC_DependencyCheckOutputName>..\PrepBuild.exe</DCC_DependencyCheckOutputName>
9+ <FrameworkType>VCL</FrameworkType>
10+ <MainSource>PrepBuild.dpr</MainSource>
11+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
12+ <ProjectGuid>{209412ac-0ec2-4f63-b92a-e78853ff142a}</ProjectGuid>
13+ <ProjectVersion>13.4</ProjectVersion>
14+ <TargetedPlatforms>1</TargetedPlatforms>
15+ </PropertyGroup>
16+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
17+ <Base>true</Base>
18+ </PropertyGroup>
19+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
20+ <Base>true</Base>
21+ <CfgParent>Base</CfgParent>
22+ <Base_Win32>true</Base_Win32>
23+ </PropertyGroup>
24+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
25+ <Base>true</Base>
26+ <CfgParent>Base</CfgParent>
27+ <Cfg_1>true</Cfg_1>
28+ </PropertyGroup>
29+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
30+ <Base>true</Base>
31+ <CfgParent>Cfg_1</CfgParent>
32+ <Cfg_1>true</Cfg_1>
33+ <Cfg_1_Win32>true</Cfg_1_Win32>
34+ </PropertyGroup>
35+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
36+ <Base>true</Base>
37+ <CfgParent>Base</CfgParent>
38+ <Cfg_2>true</Cfg_2>
39+ </PropertyGroup>
40+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
41+ <Base>true</Base>
42+ <CfgParent>Cfg_2</CfgParent>
43+ <Cfg_2>true</Cfg_2>
44+ <Cfg_2_Win32>true</Cfg_2_Win32>
45+ </PropertyGroup>
46+ <PropertyGroup Condition="'$(Base)'!=''">
47+ <DCC_DcuOutput>..\$(Config)\$(Platform)\dcu</DCC_DcuOutput>
48+ <DCC_Define>no_translation;NO_TRANSLATION_HINT;$(DCC_Define)</DCC_Define>
49+ <DCC_DependencyCheckOutputName>PrepBuild.exe</DCC_DependencyCheckOutputName>
50+ <DCC_ExeOutput>..</DCC_ExeOutput>
51+ <DCC_MapFile>3</DCC_MapFile>
52+ <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
53+ <DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
54+ <DCC_UNIT_PLATFORM>false</DCC_UNIT_PLATFORM>
55+ <DCC_UnitSearchPath>..\libs\dzlib\src;..\libs\dzlib\templates;..\libs\jcl\source\include;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;..\libs\jcl\source\include\jedi;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
56+ <Manifest_File>None</Manifest_File>
57+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
58+ <VerInfo_Locale>2057</VerInfo_Locale>
59+ </PropertyGroup>
60+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
61+ <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
62+ <Debugger_RunParams>--incbuild --readini=testdata\testproject --updateini=testdata\testproject --writerc=testdata\testproject</Debugger_RunParams>
63+ <PostBuildEvent>
64+ <![CDATA[..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)
65+$(PostBuildEvent)]]>
66+ </PostBuildEvent>
67+ <PreBuildEvent>
68+ <![CDATA[..\buildtools\prebuild.cmd $(PROJECTPATH)
69+$(PreBuildEvent)]]>
70+ </PreBuildEvent>
71+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
72+ <VerInfo_Locale>1033</VerInfo_Locale>
73+ </PropertyGroup>
74+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
75+ <DCC_DebugInformation>False</DCC_DebugInformation>
76+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
77+ <DCC_ExeOutput>..</DCC_ExeOutput>
78+ <DCC_HppOutput>dcu</DCC_HppOutput>
79+ <DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
80+ <DCC_ObjOutput>dcu</DCC_ObjOutput>
81+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
82+ <Version>7.0</Version>
83+ </PropertyGroup>
84+ <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
85+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
86+ <VerInfo_Locale>1033</VerInfo_Locale>
87+ </PropertyGroup>
88+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
89+ <DCC_DebugDCUs>true</DCC_DebugDCUs>
90+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
91+ <DCC_DependencyCheckOutputName>..\PrepBuild.exe</DCC_DependencyCheckOutputName>
92+ <DCC_ExeOutput>..</DCC_ExeOutput>
93+ <DCC_IncludePath>$(BDS)\lib\Debug;..\libs\dzlib\src;..\libs\dztemplates\templates;..\libs\dztemplates\units;..\libs\dzCmdLineParser\src;..\libs\jcl\source;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;$(DCC_IncludePath)</DCC_IncludePath>
94+ <DCC_ObjPath>$(BDS)\lib\Debug;..\libs\dzlib\src;..\libs\dztemplates\templates;..\libs\dztemplates\units;..\libs\dzCmdLineParser\src;..\libs\jcl\source;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;$(DCC_ObjPath)</DCC_ObjPath>
95+ <DCC_Optimize>False</DCC_Optimize>
96+ <DCC_ResourcePath>$(BDS)\lib\Debug;..\libs\dzlib\src;..\libs\dztemplates\templates;..\libs\dztemplates\units;..\libs\dzCmdLineParser\src;..\libs\jcl\source;..\libs\jcl\source\common;..\libs\jcl\source\windows;..\libs\jcl\source\vcl;$(DCC_ResourcePath)</DCC_ResourcePath>
97+ <DCC_SYMBOL_PLATFORM>False</DCC_SYMBOL_PLATFORM>
98+ <DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
99+ <Version>7.0</Version>
100+ </PropertyGroup>
101+ <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
102+ <Debugger_RunParams>--incbuild --BuildDateTime={today} --readini=testdata\testproject --updateini=testdata\testproject --WriteRc=testdata\testproject --InputManifest=testdata\testproject.manifest.in --manifest=testdata\testproject --updatemanifest --WriteManifestRc=testdata\testproject --theming=on</Debugger_RunParams>
103+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
104+ <VerInfo_Locale>1033</VerInfo_Locale>
105+ </PropertyGroup>
106+ <ProjectExtensions>
107+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
108+ <Borland.ProjectType/>
109+ <BorlandProject>
110+ <Delphi.Personality>
111+ <Parameters>
112+ <Parameters Name="RunParams">--incbuild --readini=testdata\testproject --updateini=testdata\testproject --writerc=testdata\testproject</Parameters>
113+ </Parameters>
114+ <VersionInfo>
115+ <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
116+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
117+ <VersionInfo Name="MajorVer">1</VersionInfo>
118+ <VersionInfo Name="MinorVer">0</VersionInfo>
119+ <VersionInfo Name="Release">0</VersionInfo>
120+ <VersionInfo Name="Build">0</VersionInfo>
121+ <VersionInfo Name="Debug">False</VersionInfo>
122+ <VersionInfo Name="PreRelease">False</VersionInfo>
123+ <VersionInfo Name="Special">False</VersionInfo>
124+ <VersionInfo Name="Private">False</VersionInfo>
125+ <VersionInfo Name="DLL">False</VersionInfo>
126+ <VersionInfo Name="Locale">2057</VersionInfo>
127+ <VersionInfo Name="CodePage">1252</VersionInfo>
128+ </VersionInfo>
129+ <Excluded_Packages>
130+ <Excluded_Packages Name="$(BDSBIN)\bcboffice2k160.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
131+ <Excluded_Packages Name="$(BDSBIN)\bcbofficexp160.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
132+ <Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
133+ <Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
134+ </Excluded_Packages>
135+ <Source>
136+ <Source Name="MainSource">PrepBuild.dpr</Source>
137+ </Source>
138+ <VersionInfoKeys>
139+ <VersionInfoKeys Name="CompanyName"/>
140+ <VersionInfoKeys Name="FileDescription"/>
141+ <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
142+ <VersionInfoKeys Name="InternalName"/>
143+ <VersionInfoKeys Name="LegalCopyright"/>
144+ <VersionInfoKeys Name="LegalTrademarks"/>
145+ <VersionInfoKeys Name="OriginalFilename"/>
146+ <VersionInfoKeys Name="ProductName"/>
147+ <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
148+ <VersionInfoKeys Name="Comments"/>
149+ </VersionInfoKeys>
150+ </Delphi.Personality>
151+ <ModelSupport>False</ModelSupport>
152+ <Platforms>
153+ <Platform value="Win32">True</Platform>
154+ <Platform value="Win64">False</Platform>
155+ </Platforms>
156+ </BorlandProject>
157+ <ProjectFileVersion>12</ProjectFileVersion>
158+ </ProjectExtensions>
159+ <ItemGroup>
160+ <DelphiCompile Include="$(MainSource)">
161+ <MainSource>MainSource</MainSource>
162+ </DelphiCompile>
163+ <DCCReference Include="d_XmlVersionInfo.pas">
164+ <Form>dm_XmlVersionInfo</Form>
165+ <DesignClass>TDataModule</DesignClass>
166+ </DCCReference>
167+ <DCCReference Include="d_DprojVersionInfo.pas">
168+ <Form>dm_DprojVersionInfo</Form>
169+ <DesignClass>TDataModule</DesignClass>
170+ </DCCReference>
171+ <DCCReference Include="d_BdsProjVersionInfo.pas">
172+ <Form>dm_BdsProjVersionInfo</Form>
173+ <DesignClass>TDataModule</DesignClass>
174+ </DCCReference>
175+ <DCCReference Include="d_ManifestVersionInfo.pas">
176+ <Form>dm_ManifestVersionInfo</Form>
177+ <DesignClass>TDataModule</DesignClass>
178+ </DCCReference>
179+ <DCCReference Include="i_VersionInfoAccess.pas"/>
180+ <DCCReference Include="u_DofVersionInfo.pas"/>
181+ <DCCReference Include="u_IniVersionInfo.pas"/>
182+ <DCCReference Include="u_CentralIniVersionInfo.pas"/>
183+ <DCCReference Include="u_PrepBuildMain.pas"/>
184+ <DCCReference Include="u_VersionInfo.pas"/>
185+ <DCCReference Include="..\libs\dzlib\forms\w_dzDialog.pas">
186+ <Form>f_dzDialog</Form>
187+ </DCCReference>
188+ <DCCReference Include="..\libs\dzlib\src\u_dzDefaultMain.pas"/>
189+ <BuildConfiguration Include="Base">
190+ <Key>Base</Key>
191+ </BuildConfiguration>
192+ <BuildConfiguration Include="Release">
193+ <Key>Cfg_1</Key>
194+ <CfgParent>Base</CfgParent>
195+ </BuildConfiguration>
196+ <BuildConfiguration Include="Debug">
197+ <Key>Cfg_2</Key>
198+ <CfgParent>Base</CfgParent>
199+ </BuildConfiguration>
200+ </ItemGroup>
201+ <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
202+ <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\8.0\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\8.0\UserTools.proj"/>
203+ <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
204+ <PropertyGroup Condition="'$(Config)'=='Release' And '$(Platform)'=='Win32'">
205+ <PostBuildEvent>..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)</PostBuildEvent>
206+ <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode>
207+ <PreBuildEvent>..\buildtools\prebuild.cmd $(PROJECTPATH)</PreBuildEvent>
208+ <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode>
209+ <PreLinkEvent/>
210+ <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode>
211+ </PropertyGroup>
212+ <PropertyGroup Condition="'$(Config)'=='Debug' And '$(Platform)'=='Win32'">
213+ <PostBuildEvent>..\buildtools\postbuild.cmd $(OUTPUTDIR)$(OUTPUTNAME)</PostBuildEvent>
214+ <PostBuildEventIgnoreExitCode>False</PostBuildEventIgnoreExitCode>
215+ <PreBuildEvent>..\buildtools\prebuild.cmd $(PROJECTPATH)</PreBuildEvent>
216+ <PreBuildEventIgnoreExitCode>False</PreBuildEventIgnoreExitCode>
217+ <PreLinkEvent/>
218+ <PreLinkEventIgnoreExitCode>False</PreLinkEventIgnoreExitCode>
219+ </PropertyGroup>
220+</Project>
--- trunk/src/d_BdsProjVersionInfo.pas (revision 72)
+++ trunk/src/d_BdsProjVersionInfo.pas (revision 73)
@@ -17,7 +17,7 @@
1717 protected
1818 procedure InitVersionNodes; override;
1919 public
20- constructor Create(const _Project: string);
20+ constructor Create(const _ProjectBaseFn: string);
2121 end;
2222
2323 implementation
@@ -26,9 +26,10 @@
2626
2727 { Tdm_BdsProjVersionInfo }
2828
29-constructor Tdm_BdsProjVersionInfo.Create(const _Project: string);
29+constructor Tdm_BdsProjVersionInfo.Create(const _ProjectBaseFn: string);
3030 begin
31- inherited Create(ChangeFileExt(_Project, '.bdsproj'));
31+ inherited Create(ChangeFileExt(_ProjectBaseFn, '.bdsproj'),
32+ ChangeFileExt(ExtractFileName(_ProjectBaseFn), ''));
3233 end;
3334
3435 procedure Tdm_BdsProjVersionInfo.InitVersionNodes;
--- trunk/src/d_DProjVersionInfo.pas (revision 72)
+++ trunk/src/d_DProjVersionInfo.pas (revision 73)
@@ -18,7 +18,7 @@
1818 protected
1919 procedure InitVersionNodes; override;
2020 public
21- constructor Create(const _Project: string);
21+ constructor Create(const _ProjectBaseFn: string);
2222 end;
2323
2424 implementation
@@ -25,9 +25,10 @@
2525
2626 {$R *.dfm}
2727
28-constructor Tdm_DprojVersionInfo.Create(const _Project: string);
28+constructor Tdm_DprojVersionInfo.Create(const _ProjectBaseFn: string);
2929 begin
30- inherited Create(ChangeFileExt(_Project, '.dproj'));
30+ inherited Create(ChangeFileExt(_ProjectBaseFn, '.dproj'),
31+ ChangeFileExt(ExtractFileName(_ProjectBaseFn), ''));
3132 end;
3233
3334 procedure Tdm_DprojVersionInfo.InitVersionNodes;
--- trunk/src/d_XmlVersionInfo.pas (revision 72)
+++ trunk/src/d_XmlVersionInfo.pas (revision 73)
@@ -17,7 +17,6 @@
1717 Tdm_XmlVersionInfo = class(TDataModule, IVersionInfoAccess)
1818 ProjDoc: TXMLDocument;
1919 private
20- FProjectFilename: string;
2120 function GetChildNodeContent(_Parent: IXMLNode; const _NodeName, _AttrName: string): string;
2221 function GetVersionInfo(const _Name: string): string;
2322 function GetVersionInfoKey(const _Name: string): string;
@@ -35,11 +34,17 @@
3534 procedure WriteToFile(_VerInfo: TVersionInfo);
3635 protected
3736 FXmlFilename: string;
37+ FProjectName: string;
3838 FVersionInfo: IXMLNode;
3939 FVersionInfoKeys: IXMLNode;
4040 procedure InitVersionNodes; virtual; abstract;
4141 public
42- constructor Create(const _FullFilename: string); reintroduce;
42+ ///<summary>
43+ /// reads a XML formatted project file (.bdsproj or .dproj)
44+ /// @param FullFilename is the name of the file to read
45+ /// @param ProjectName is the name of the Delphi project without path and extension
46+ ///
47+ constructor Create(const _FullFilename: string; const _ProjectName: string); reintroduce;
4348 destructor Destroy; override;
4449 end;
4550
@@ -97,11 +102,12 @@
97102 end;
98103 end;
99104
100-constructor Tdm_XmlVersionInfo.Create(const _FullFilename: string);
105+constructor Tdm_XmlVersionInfo.Create(const _FullFilename: string; const _ProjectName: string);
101106 begin
102107 inherited Create(nil);
103- FProjectFilename := _FullFilename;
104- FXmlFilename := VerInfoFilename;
108+ FXmlFilename := _FullFilename;
109+ FProjectName := _ProjectName;
110+
105111 ProjDoc.FileName := FXmlFilename;
106112 ProjDoc.Active := True;
107113
@@ -108,7 +114,8 @@
108114 InitVersionNodes;
109115
110116 if not SameText(GetChildNodeContent(FVersionInfo, 'VersionInfo', 'IncludeVerInfo'), 'True') then
111- raise ENoVersionInfo.Create(_('.dproj file does not contain version information'));
117+ raise ENoVersionInfo.CreateFmt(_('File "%s" does not contain version information'),
118+ [FXmlFilename]);
112119 end;
113120
114121 destructor Tdm_XmlVersionInfo.Destroy;
@@ -121,6 +128,8 @@
121128 begin
122129 _VerInfo.Source := VerInfoFilename;
123130
131+ _VerInfo.ProjectName := FProjectName;
132+
124133 _VerInfo.AutoIncBuild := SameText(GetVersionInfo('AutoIncBuild'), 'True');
125134
126135 _VerInfo.MajorVer := StrToIntDef(GetVersionInfo('MajorVer'), 0);
@@ -141,11 +150,10 @@
141150 _VerInfo.SCMRevision := GetVersionInfoKey('Revision');
142151 _VerInfo.BuildDateTime := GetVersionInfoKey('BuildDateTime');
143152
144- _VerInfo.IsPrivateBuild := StrToBool(GetVersionInfo('IsPrivateBuild'));
145- _VerInfo.IsSpecialBuild := StrToBool(GetVersionInfo('IsSpecialBuild'));
153+ _VerInfo.IsPrivateBuild := StrToBool(GetVersionInfo('Private'));
154+ _VerInfo.IsSpecialBuild := StrToBool(GetVersionInfo('Special'));
146155 _VerInfo.PrivateBuildComments := GetVersionInfoKey('PrivateBuild');
147156 _VerInfo.SpecialBuildComments := GetVersionInfoKey('SpecialBuild');
148-
149157 end;
150158
151159 procedure Tdm_XmlVersionInfo.WriteToFile(_VerInfo: TVersionInfo);
@@ -168,8 +176,8 @@
168176 SetVersionInfo('Revision', _VerInfo.SCMRevision);
169177 SetVersionInfoKey('BuildDateTime', _VerInfo.BuildDateTime);
170178
171- SetVersionInfo('IsPrivateBuild', BoolToStr(_VerInfo.IsPrivateBuild, True));
172- SetVersionInfo('IsSpecialBuild', BoolToStr(_VerInfo.IsSpecialBuild, True));
179+ SetVersionInfo('Private', BoolToStr(_VerInfo.IsPrivateBuild, True));
180+ SetVersionInfo('Special', BoolToStr(_VerInfo.IsSpecialBuild, True));
173181 SetVersionInfoKey('PrivateBuild', _VerInfo.PrivateBuildComments);
174182 SetVersionInfoKey('SpecialBuild', _VerInfo.SpecialBuildComments);
175183
@@ -188,7 +196,7 @@
188196
189197 function Tdm_XmlVersionInfo.VerInfoFilename: string;
190198 begin
191- Result := FProjectFilename;
199+ Result := FXmlFilename;
192200 end;
193201
194202 // standard TInterfacedObject implementation of IInterface
--- trunk/src/i_VersionInfoAccess.pas (revision 72)
+++ trunk/src/i_VersionInfoAccess.pas (revision 73)
@@ -11,6 +11,8 @@
1111
1212 type
1313 IVersionInfoAccess = interface ['{57B36255-0A4B-4F62-9007-B4D211C2185D}']
14+ ///<summary>
15+ /// @returns the name of the file the version info is read from / written to </summary>
1416 function VerInfoFilename: string;
1517 procedure ReadFromFile(_VerInfo: TVersionInfo);
1618 procedure WriteToFile(_VerInfo: TVersionInfo);
--- trunk/src/u_CentralIniVersionInfo.pas (revision 72)
+++ trunk/src/u_CentralIniVersionInfo.pas (revision 73)
@@ -7,20 +7,20 @@
77 u_IniVersionInfo;
88
99 type
10- {: This is a specialized descendant of TIniVersionInfo which
11- allows any entry of the file to redirect to a different file.
12- This can be done for single entries or for a whole section.
13- For redirecting a single entry, the value must contain a string
14- REDIRECT:<filename>,<section><entry>
15- For redirecting a section it must contain only one entry
16- redirect=<filename>,<section>
17- These redirections will be used for reading and writing, that is it can be
18- used to maintain/increment a central build number for several branches of
19- a project where the files have different version numbers but the build
20- number should be increased for a build of any of these versions. }
10+ ///<summary>
11+ /// This is a specialized descendant of TIniVersionInfo which
12+ /// allows any entry of the file to redirect to a different file.
13+ /// This can be done for single entries or for a whole section.
14+ /// For redirecting a single entry, the value must contain a string
15+ /// REDIRECT:<filename>,<section><entry>
16+ /// For redirecting a section it must contain only one entry
17+ /// redirect=<filename>,<section>
18+ /// These redirections will be used for reading and writing, that is it can be
19+ /// used to maintain/increment a central build number for several branches of
20+ /// a project where the files have different version numbers but the build
21+ /// number should be increased for a build of any of these versions. </summary>
2122 TCentralIniVersionInfo = class(TIniVersionInfo, IVersionInfoAccess)
2223 private
23- FProjectName: string;
2424 procedure GetRedirIdentInfo(const _RedirString: string; out _Filename, _Section, _Ident: string);
2525 procedure GetRedirSectionInfo(_Redir: string; out _Filename, _Section: string);
2626 procedure AdjustFilename(var _Filename: string);
@@ -28,11 +28,12 @@
2828 function ReadString(const _Section, _Ident: string; _Default: string): string; override;
2929 procedure WriteString(const _Section, _Ident: string; _Value: string); override;
3030 public
31- {: Creates a TCentralVersionInfo instance
32- @param ProjectName is the name of the project (.dpr file without extension)
33- The constructor appends "_Version.ini" to this
34- name and tries to open the file }
35- constructor Create(const _ProjectName: string);
31+ ///<summary>
32+ /// Creates a TCentralVersionInfo instance
33+ /// @param ProjectBaseFn is the name of the project (.dpr file without extension)
34+ /// The constructor appends "_Version.ini" to this
35+ /// name and tries to open the file }
36+ constructor Create(const _ProjectBaseFn: string);
3637 end;
3738
3839 implementation
@@ -48,9 +49,11 @@
4849
4950 { TCentralVersionInfo }
5051
51-constructor TCentralIniVersionInfo.Create(const _ProjectName: string);
52+constructor TCentralIniVersionInfo.Create(const _ProjectBaseFn: string);
5253 begin
53- inherited Create(ChangeFileExt(_ProjectName, '_Version.ini'), VERSION_INFO_SECTION, VERSION_INFO_KEYS_SECTION);
54+ inherited Create(ChangeFileExt(_ProjectBaseFn, '_Version.ini'),
55+ ExtractFileName(_ProjectBaseFn),
56+ VERSION_INFO_SECTION, VERSION_INFO_KEYS_SECTION);
5457 end;
5558
5659 procedure TCentralIniVersionInfo.AdjustFilename(var _Filename: string);
@@ -60,7 +63,7 @@
6063 Path := ExtractFilePath(_Filename);
6164 if (Path = '') or ((Path[1] <> '\') and (Copy(Path, 2, 1) <> ':')) then begin
6265 // Path is relative, so make it relative to the main .ini file
63- _Filename := ExtractFilePath(FProjectName) + _Filename;
66+ _Filename := ExtractFilePath(FIniFilename) + _Filename;
6467 end;
6568 end;
6669
--- trunk/src/u_DofVersionInfo.pas (revision 72)
+++ trunk/src/u_DofVersionInfo.pas (revision 73)
@@ -14,14 +14,14 @@
1414 <projectname>.dof file, that was used by Delphi up to version 7. }
1515 TDofVersionInfo = class(TIniVersionInfo, IVersionInfoAccess)
1616 private
17- FProjectName: string;
17+ FProjectBaseFn: string;
1818 public
1919 {: Creates a TDofVersionInfo instance. Succeeds, if the file exists
2020 and IncludeVerInfo is <> 0
21- @param _Projectname is the project name (*.dpr file without extension)
21+ @param ProjectBaseFn is the full project file name (*.dpr file without extension)
2222 @raises ENoVersionInfo if the file does not exist or
2323 the value of [Version Info] IncludeVerInfo is not 1 }
24- constructor Create(const _ProjectName: string);
24+ constructor Create(const _ProjectBaseFn: string);
2525 class function FilenameFor(const _ProjectName: string): string;
2626 end;
2727
@@ -36,10 +36,11 @@
3636
3737 { TDofVersionInfo }
3838
39-constructor TDofVersionInfo.Create(const _ProjectName: string);
39+constructor TDofVersionInfo.Create(const _ProjectBaseFn: string);
4040 begin
41- FProjectName := _ProjectName;
42- inherited Create(FilenameFor(_ProjectName), VERSION_INFO_SECTION, VERSION_INFO_KEYS_SECTION);
41+ FProjectBaseFn := _ProjectBaseFn;
42+ inherited Create(FilenameFor(_ProjectBaseFn), ExtractFileName(_ProjectBaseFn),
43+ VERSION_INFO_SECTION, VERSION_INFO_KEYS_SECTION);
4344 if FIniFile.ReadInteger(VERSION_INFO_SECTION, 'IncludeVerInfo', 0) <> 1 then
4445 raise ENoVersionInfo.Create(_('.dof file does not contain version info'));
4546 end;
--- trunk/src/u_IniVersionInfo.pas (revision 72)
+++ trunk/src/u_IniVersionInfo.pas (revision 73)
@@ -8,10 +8,6 @@
88 u_VersionInfo;
99
1010 type
11- ///<summary>
12- /// Tries to read a <projectname>.ini file, succeeds, if it exists
13- /// @param Project is the project name (*.dpr file without extension)
14- /// @param VersionInfo is a TVersionInfoRec record which will be filled with the version info </summary>
1511 TIniVersionInfo = class(TInterfacedObject)
1612 protected
1713 FIniFile: TMemIniFile;
@@ -23,8 +19,9 @@
2319 procedure WriteString(const _Section, _Ident: string; _Value: string); virtual;
2420 function ReadBool(const _Section, _Ident: string; _Default: Boolean): Boolean; virtual;
2521 procedure WriteBool(const _Section, _Ident: string; _Value: Boolean); virtual;
26- private
22+ protected
2723 FIniFilename: string;
24+ FProjectName: string;
2825 protected // implement IVersionInfoAccess
2926 function VerInfoFilename: string;
3027 procedure ReadFromFile(_VerInfo: TVersionInfo);
@@ -34,14 +31,17 @@
3431 /// Creates a TIniVersionInfo instance.
3532 /// @param FullFilename is the full filename including path and extension of
3633 /// file to use
34+ /// @param ProjectName is the name of the Delphi project, without path and extension
3735 /// @param InfoSection is the name of the section that contains the general
3836 /// version info like Major/Minor version, Release etc.
3937 /// In a Delphi .dof file this section is called [Version Info]
4038 /// @param InfoKeySection is the name of the section that contains the additional
41- /// strings of the version information
42- /// In a Delphi .dof file this section is called [Version Info Keys] </summary>
43- constructor Create(const _FullFilename: string; const _InfoSection: string;
44- const _InfoKeysSection: string);
39+ /// strings of the version information
40+ /// In a Delphi .dof file this section is called [Version Info Keys]
41+ /// @raises ENoVersionInfo if the file does not exist or does not contain
42+ /// the specified sections </summary>
43+ constructor Create(const _FullFilename: string; const _ProjectName: string;
44+ const _InfoSection: string; const _InfoKeysSection: string);
4545 destructor Destroy; override;
4646 end;
4747
@@ -53,16 +53,25 @@
5353
5454 { TIniVersionInfo }
5555
56-constructor TIniVersionInfo.Create(const _FullFilename: string; const _InfoSection: string;
57- const _InfoKeysSection: string);
56+constructor TIniVersionInfo.Create(const _FullFilename: string; const _ProjectName: string;
57+ const _InfoSection: string; const _InfoKeysSection: string);
5858 begin
5959 inherited Create;
6060 FIniFilename := _FullFilename;
6161 if not FileExists(_FullFilename) then
6262 raise ENoVersionInfo.CreateFmt(_('File "%s" does not exist.'), [_FullFilename]);
63+ FProjectName := _ProjectName;
6364 FInfoSection := _InfoSection;
6465 FInfoKeysSection := _InfoKeysSection;
6566 FIniFile := TMemIniFile.Create(_FullFilename);
67+
68+ if not FIniFile.SectionExists(FInfoSection) then
69+ raise ENoVersionInfo.CreateFmt(_('File "%s" does contain a [%s] section'),
70+ [_FullFilename, FInfoSection]);
71+
72+ if not FIniFile.SectionExists(FInfoKeysSection) then
73+ raise ENoVersionInfo.CreateFmt(_('File "%s" does contain a [%s] section'),
74+ [_FullFilename, FInfoKeysSection]);
6675 end;
6776
6877 destructor TIniVersionInfo.Destroy;
@@ -113,6 +122,7 @@
113122 procedure TIniVersionInfo.ReadFromFile(_VerInfo: TVersionInfo);
114123 begin
115124 _VerInfo.Source := VerInfoFilename;
125+ _VerInfo.ProjectName := FProjectName;
116126
117127 _VerInfo.AutoIncBuild := ReadBool(FInfoSection, 'AutoIncBuild', False);
118128
--- trunk/src/u_PrepBuildMain.pas (revision 72)
+++ trunk/src/u_PrepBuildMain.pas (revision 73)
@@ -242,7 +242,7 @@
242242 VersionInfo: TVersionInfo;
243243 IntValue: Integer;
244244 IconFile: string;
245- Project: string;
245+ ProjectFn: string;
246246 InputManifest: string;
247247 Manifest: string;
248248 IgnoreManifestErrors: Boolean;
@@ -259,31 +259,31 @@
259259 if FGetOpt.OptionPassed('dumpcmd') then
260260 DumpCmd;
261261
262- Project := '';
263- if FGetOpt.OptionPassed('ReadDof', Project) then begin
264- Project := UnquoteStr(Project);
265- VerInfoAccess := TDofVersionInfo.Create(Project);
262+ ProjectFn := '';
263+ if FGetOpt.OptionPassed('ReadDof', ProjectFn) then begin
264+ ProjectFn := UnquoteStr(ProjectFn);
265+ VerInfoAccess := TDofVersionInfo.Create(ProjectFn);
266266 end;
267267
268- if FGetOpt.OptionPassed('ReadBdsProj', Project) then begin
268+ if FGetOpt.OptionPassed('ReadBdsProj', ProjectFn) then begin
269269 if Assigned(VerInfoAccess) then
270270 raise Exception.Create(_('You can only pass one of --ReadDof, --ReadBdsproj, --ReadDproj or --ReadIni'));
271- Project := UnquoteStr(Project);
272- VerInfoAccess := Tdm_BdsProjVersionInfo.Create(Project);
271+ ProjectFn := UnquoteStr(ProjectFn);
272+ VerInfoAccess := Tdm_BdsProjVersionInfo.Create(ProjectFn);
273273 end;
274274
275- if FGetOpt.OptionPassed('ReadIni', Project) then begin
275+ if FGetOpt.OptionPassed('ReadIni', ProjectFn) then begin
276276 if Assigned(VerInfoAccess) then
277277 raise Exception.Create(_('You can only pass one of --ReadDof, --ReadBdsproj, --ReadDproj or --ReadIni'));
278- Project := UnquoteStr(Project);
279- VerInfoAccess := TCentralIniVersionInfo.Create(Project);
278+ ProjectFn := UnquoteStr(ProjectFn);
279+ VerInfoAccess := TCentralIniVersionInfo.Create(ProjectFn);
280280 end;
281281
282- if FGetOpt.OptionPassed('ReadDproj', Project) then begin
282+ if FGetOpt.OptionPassed('ReadDproj', ProjectFn) then begin
283283 if Assigned(VerInfoAccess) then
284284 raise Exception.Create(_('You can only pass one of --ReadDof, --ReadBdsproj, --ReadDproj or --ReadIni'));
285- Project := UnquoteStr(Project);
286- VerInfoAccess := Tdm_DProjVersionInfo.Create(Project);
285+ ProjectFn := UnquoteStr(ProjectFn);
286+ VerInfoAccess := Tdm_DProjVersionInfo.Create(ProjectFn);
287287 end;
288288
289289 VersionInfo := TVersionInfo.Create;
@@ -507,7 +507,7 @@
507507 Param := UnquoteStr(Param);
508508 WriteLn('Executing ', Param);
509509 Flush(Output);
510- HandleExecOption(Param, VersionInfo, Project);
510+ HandleExecOption(Param, VersionInfo, ProjectFn);
511511 end;
512512
513513 finally
--- trunk/src/u_VersionInfo.pas (revision 72)
+++ trunk/src/u_VersionInfo.pas (revision 73)
@@ -24,7 +24,10 @@
2424 FInternalName: string;
2525 FOriginalFilename: string;
2626 FComments: string;
27+
2728 FSource: string;
29+ FProjectName: string;
30+
2831 FSCMRevision: string;
2932 FBuildDateTime: string;
3033 FIsPrivateBuild: Boolean;
@@ -86,6 +89,7 @@
8689 function ResolveVariables(const _s: string): string;
8790
8891 property Source: string read FSource write FSource;
92+ property ProjectName: string read FProjectName write FProjectName;
8993 //
9094 property AutoIncBuild: Boolean read GetAutoIncBuild write SetAutoIncBuild;
9195 //
@@ -190,6 +194,12 @@
190194 Result := DateTime2Iso(Date, False);
191195 end else if SameText('now', _s) then begin
192196 Result := DateTime2Iso(Date, True);
197+ end else if SameText('MajorVer', _s) then begin
198+ Result := IntToStr(FMajorVer);
199+ end else if SameText('MinorVer', _s) then begin
200+ Result := IntToStr(FMinorVer);
201+ end else if SameText('ProjectName', _s) then begin
202+ Result := ExtractFileName(FProjectName);
193203 end else
194204 Result := _s;
195205 end;
Afficher sur ancien navigateur de dépôt.