Skip to content

Commit 44e6e2a

Browse files
committed
Merge branch 'feature/78-update-build-process' into develop
Closes #78
2 parents b60070e + 85669ce commit 44e6e2a

File tree

8 files changed

+129
-74
lines changed

8 files changed

+129
-74
lines changed

Diff for: .gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
__history/
1111

1212
# Project specific directories & files
13-
Bin
14-
Exe
15-
Release
13+
_build
1614
Src/CodeSnip.cfg
1715
Src/AutoGen/IntfExternalObj.pas

Diff for: Build.html

+62-21
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,7 @@ <h3>
460460
|
461461
+-- DUnit - test source code that uses the DUnit framework</pre>
462462
<p>
463-
If, by chance you also have <code>Bin</code>, <code>Exe</code> and / or
464-
<code>Release</code> directories don't worry - all will become clear.
463+
If, by chance you also have a <code>_build</code> directory don't worry - all will become clear.
465464
Git users may also see the usual <code>.git</code> hidden
466465
directory. If you have done some editing in the Delphi IDE you may also see
467466
occasional hidden <code>__history</code> folders.
@@ -498,18 +497,18 @@ <h3>
498497

499498
<pre>./
500499
|
501-
+-- Bin - receives object files for CodeSnip
502-
|
503-
...
504-
|
505-
+-- Exe - receives executable code and compiled help file
506-
|
507-
+-- Release - receives release files
500+
+-- _build - contains all the build files
501+
| |
502+
| +-- bin - receives object files for CodeSnip
503+
| |
504+
| +-- exe - receives executable code and compiled help file
505+
| |
506+
| +-- release - receives release files
508507
|
509508
...</pre>
510509

511510
<p>
512-
If the <code>Bin</code> folder already existed, it will have been emptied.
511+
If the <code>_build/bin</code> folder already existed, it will have been emptied.
513512
In addition, <code>Make</code> will have created a <code>.cfg</code> file from
514513
template in the <code>Src</code> folder. This <code>.cfg</code> file is needed
515514
for DCC32 to run correctly. The file will be ignored by Git.
@@ -625,7 +624,7 @@ <h3>
625624

626625
<p>
627626
The <em>CodeSnip</em> executable, named <code>CodeSnip.exe</code> will be
628-
placed in the <code>Exe</code> folder.
627+
placed in the <code>_build\exe</code> folder.
629628
</p>
630629

631630
<h4>
@@ -640,7 +639,7 @@ <h4>
640639
<pre class="cmd"><span class="prompt">&gt;</span> Make -DPORTABLE codesnip</pre>
641640

642641
<p>
643-
Again the executable is placed in the <code>Exe</code> folder, but this time
642+
Again the executable is placed in the <code>_build/exe</code> folder, but this time
644643
it is named <code>CodeSnip-p.exe</code>
645644
</p>
646645

@@ -654,13 +653,16 @@ <h3>
654653

655654
<pre class="cmd"><span class="prompt">&gt;</span> Make help</pre>
656655

656+
<p>
657+
The compiled help file will be written to the <code>_build\exe</code> folder.
658+
</p>
657659
<h3>
658660
Build the Setup Program
659661
</h3>
660662

661663
<p>
662664
The setup program requires that the <em>CodeSnip</em> excutable and the
663-
compiled help file are already present in the <code>Exe</code> directory.
665+
compiled help file are already present in the <code>_build\exe</code> directory.
664666
</p>
665667

666668
<p>
@@ -679,7 +681,7 @@ <h3>
679681
<p>
680682
The setup program is named <code>CodeSnip-Setup-x.x.x.exe</code>, where
681683
x.x.x is the version number extracted from <em>CodeSnip</em>'s version
682-
information. It is placed in the <code>Exe</code> directory.
684+
information. It is placed in the <code>_build/exe</code> directory.
683685
</p>
684686

685687
<p>
@@ -704,6 +706,7 @@ <h3>
704706

705707
<p>
706708
Make can create zip files containing all the files that are included in a release.
709+
Zip files are written to the <code>_build/release</code> directory.
707710
</p>
708711

709712
<h4>
@@ -723,13 +726,17 @@ <h4>
723726
<pre class="cmd"><span class="prompt">&gt;</span> Make release</pre>
724727

725728
<p>
726-
By default the release file is named <code>dd-codesnip.zip</code>. You can
729+
By default the release file is named <code>codesnip-exe.zip</code>. You can
727730
change this name by defining the <code>RELEASEFILENAME</code> macro or
728731
enviroment variable. For example, you can name the file
729732
<code>MyRelease.zip</code> by doing:
730733
</p>
731734

732-
<pre class="cmd"><span class="prompt">&gt;</span> Make -DRELEASEFILENAME=MyRelease.zip release</pre>
735+
<pre class="cmd"><span class="prompt">&gt;</span> Make -DRELEASEFILENAME=MyRelease release</pre>
736+
737+
<p>
738+
Note that the <code>.zip</code> extension should not be included in the file name.
739+
</p>
733740

734741
<h4>
735742
Portable edition
@@ -754,7 +761,11 @@ <h4>
754761
<code>MyPortableRelease.zip</code> by doing:
755762
</p>
756763

757-
<pre class="cmd"><span class="prompt">&gt;</span> Make -DPORTABLE -DRELEASEFILENAME=MyPortableRelease.zip release</pre>
764+
<pre class="cmd"><span class="prompt">&gt;</span> Make -DPORTABLE -DRELEASEFILENAME=MyPortableRelease release</pre>
765+
766+
<p>
767+
Once again note that the <code>.zip</code> extension should not be included in the file name.
768+
</p>
758769

759770
<p class="note">
760771
<strong>Warning:</strong> If you are building both the standard and portable
@@ -763,6 +774,35 @@ <h4>
763774
built release will overwrite the first.
764775
</p>
765776

777+
<h4>
778+
Including version numbers in zip file names
779+
</h4>
780+
781+
<p>
782+
A version number can be suffixed to the release zip file name by defining the <code>VERSION</code> macro.
783+
This macro works with both the <code>PORTABLE</code> and <code>RELEASEFILENAME</code> macros.
784+
</p>
785+
786+
<p>
787+
For example to appended version number 4.22.0 to the zip file name on a standard edition build, with the default
788+
file name do:
789+
</p>
790+
791+
<pre class="cmd"><span class="prompt">&gt;</span> Make -DVERSION=4.22.0 release</pre>
792+
793+
<p>
794+
This will create a zip file named <code>codesnip-exe-4.22.0.zip</code>.
795+
</p>
796+
797+
<p>
798+
A more complex example would be to append the same version number to a portable edition build named <code>MyPortableRelease</code>. Do:
799+
</p>
800+
801+
<pre class="cmd"><span class="prompt">&gt;</span> Make -DPORTABLE -DRELEASEFILENAME=MyPortableRelease -DVERSION=4.22.0 release</pre>
802+
803+
<p>
804+
This time the resulting zip file will be named <code>MyPortableRelease-4.22.0.zip</code>.
805+
</p>
766806

767807
<h3>
768808
Build and Release Everything
@@ -784,16 +824,17 @@ <h3>
784824
<span class="prompt">&gt;</span> Make setup
785825
<span class="prompt">&gt;</span> Make release</pre>
786826

787-
<h4>
788-
Portable edition
789-
</h4>
790-
791827
<p>
792828
To perform a complete build of the portable edition of <em>CodeSnip</em> do
793829
</p>
794830

795831
<pre class="cmd"><span class="prompt">&gt;</span> Make -DPORTABLE</pre>
796832

833+
<p>
834+
Note that the <code>RELEASEFILENAME</code> and <code>VERSION</code> macros that can be used for customising
835+
zip file names can be used here too.
836+
</p>
837+
797838
<h3>
798839
Clean Up
799840
</h3>

Diff for: Src/CodeSnip.cfg.tplt

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
-M
3131
-$M16384,1048576
3232
-K$00400000
33-
-E"..\Exe"
34-
-N0"..\Bin"
35-
-U"..\Bin;3rdParty"
36-
-O"..\Bin;3rdParty"
37-
-I"..\Bin;3rdParty"
38-
-R"..\Bin;3rdParty"
33+
-E"..\_build\exe"
34+
-N0"..\_build\bin"
35+
-U"..\_build\bin;3rdParty"
36+
-O"..\_build\bin;3rdParty"
37+
-I"..\_build\bin;3rdParty"
38+
-R"..\_build\bin;3rdParty"
3939
-w-SYMBOL_PLATFORM
4040
-w+EXPLICIT_STRING_CAST_LOSS
4141
-w+CVT_WIDENING_STRING_LOST

Diff for: Src/CodeSnip.dproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<PropertyGroup Condition="'$(Base)'!=''">
1717
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
1818
<DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
19-
<DCC_ExeOutput>..\Exe</DCC_ExeOutput>
20-
<DCC_UnitSearchPath>..\Bin;3rdParty;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
21-
<DCC_DependencyCheckOutputName>..\Exe\CodeSnip.exe</DCC_DependencyCheckOutputName>
19+
<DCC_ExeOutput>..\_build\exe</DCC_ExeOutput>
20+
<DCC_UnitSearchPath>..\_build\bin;3rdParty;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
21+
<DCC_DependencyCheckOutputName>..\_build\exe\CodeSnip.exe</DCC_DependencyCheckOutputName>
2222
<DCC_CVT_WIDENING_STRING_LOST>true</DCC_CVT_WIDENING_STRING_LOST>
2323
<DCC_CVT_ACHAR_TO_WCHAR>true</DCC_CVT_ACHAR_TO_WCHAR>
2424
<DCC_Platform>x86</DCC_Platform>
@@ -29,7 +29,7 @@
2929
<DCC_S>false</DCC_S>
3030
<DCC_F>false</DCC_F>
3131
<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
32-
<DCC_DcuOutput>..\Bin</DCC_DcuOutput>
32+
<DCC_DcuOutput>..\_build\bin</DCC_DcuOutput>
3333
<DCC_E>false</DCC_E>
3434
</PropertyGroup>
3535
<ItemGroup>

Diff for: Src/Help/CodeSnip.hhp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[OPTIONS]
1010
Compatibility=1.1
11-
Compiled file=..\..\Exe\CodeSnip.chm
11+
Compiled file=..\..\_build\exe\CodeSnip.chm
1212
Contents file=TOC.hhc
1313
Default topic=HTML\welcome.htm
1414
Display compile progress=No

Diff for: Src/Install/CodeSnip.iss

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; v. 2.0. If a copy of the MPL was not distributed with this file, You can
33
; obtain one at https://mozilla.org/MPL/2.0/
44
;
5-
; Copyright (C) 2006-2021, Peter Johnson (gravatar.com/delphidabbler).
5+
; Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler).
66
;
77
; Install file generation script for use with Inno Setup.
88

@@ -25,10 +25,10 @@
2525
#define ReadMeFile "ReadMe.txt"
2626
#define LicenseFile "License.rtf"
2727
#define LicenseTextFile "License.html"
28-
#define OutDir SourcePath + "..\..\Exe"
28+
#define OutDir SourcePath + "..\..\_build\exe"
2929
#define SrcDocsPath SourcePath + "..\..\Docs\"
30-
#define SrcAssetsPath SourcePath + '\Assets\"
31-
#define SrcExePath SourcePath + "..\..\Exe\"
30+
#define SrcAssetsPath SourcePath + "\Assets\"
31+
#define SrcExePath SourcePath + "..\..\_build\exe\"
3232
#define ProgDataSubDir AppName + ".4"
3333
#define ExeProg SrcExePath + ExeFile
3434
#define AppVersion DeleteToVerStart(GetFileProductVersion(ExeProg))

0 commit comments

Comments
 (0)