Skip to content

Commit a20e7fb

Browse files
committed
Merge branch 'feature/128-create-release-batch-file' into develop
2 parents b52c785 + 101592f commit a20e7fb

File tree

2 files changed

+144
-13
lines changed

2 files changed

+144
-13
lines changed

Build.html

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
77
* obtain one at https://mozilla.org/MPL/2.0/
88
*
9-
* Copyright (C) 2009-2023, Peter Johnson (gravatar.com/delphidabbler).
9+
* Copyright (C) 2009-2024, Peter Johnson (gravatar.com/delphidabbler).
1010
*
1111
* Instructions for building CodeSnip from source.
1212
-->
@@ -513,12 +513,14 @@ <h3>
513513
| +-- exe - receives executable code and compiled help file
514514
| |
515515
| +-- release - receives release files
516+
| |
517+
| +-- ~tmp~ - store for temp files ceated in release process
516518
|
517519
...</pre>
518520

519521
<p>
520522
If the <code>_build/bin</code> folder already existed, it will have been emptied.
521-
In addition, <code>Make</code> will have created a <code>.cfg</code> file from
523+
In addition, <code>Make</code> will have created a <code>.cfg</code> file from a
522524
template in the <code>Src</code> folder. This <code>.cfg</code> file is needed
523525
for DCC32 to run correctly. The file will be ignored by Git.
524526
</p>
@@ -580,7 +582,7 @@ <h2>
580582
You have several options:
581583
</p>
582584

583-
<ul class="spaced">
585+
<ol class="spaced">
584586
<li>
585587
Build the <em>CodeSnip</em> Executable
586588
</li>
@@ -599,10 +601,10 @@ <h2>
599601
<li>
600602
Clean Up.
601603
</li>
602-
</ul>
604+
</ol>
603605

604606
<p>
605-
Each of these options is described below. All except the last assume that
607+
Each of these options is described below. All except options 5 and 6 assume that
606608
<code>Make config</code> has been run.
607609
</p>
608610

@@ -648,7 +650,7 @@ <h4>
648650
<pre class="cmd"><span class="prompt">&gt;</span> Make -DPORTABLE codesnip</pre>
649651

650652
<p>
651-
Again the executable is placed in the <code>_build/exe</code> folder, but this time
653+
Again the executable is placed in the <code>_build\exe</code> folder, but this time
652654
it is named <code>CodeSnip-p.exe</code>
653655
</p>
654656

@@ -665,12 +667,17 @@ <h3>
665667
<p>
666668
The compiled help file will be written to the <code>_build\exe</code> folder.
667669
</p>
670+
671+
<p>
672+
The same help file is used for the standard and portable editions.
673+
</p>
674+
668675
<h3>
669676
Build the Setup Program
670677
</h3>
671678

672679
<p>
673-
The setup program requires that the <em>CodeSnip</em> excutable and the
680+
The setup program requires that the <em>CodeSnip</em> executable and the
674681
compiled help file are already present in the <code>_build\exe</code> directory.
675682
</p>
676683

@@ -690,7 +697,7 @@ <h3>
690697
<p>
691698
The setup program is named <code>CodeSnip-Setup-x.x.x.exe</code>, where
692699
x.x.x is the version number extracted from <em>CodeSnip</em>'s version
693-
information. It is placed in the <code>_build/exe</code> directory.
700+
information. It is placed in the <code>_build\exe</code> directory.
694701
</p>
695702

696703
<p>
@@ -715,7 +722,7 @@ <h3>
715722

716723
<p>
717724
Make can create zip files containing all the files that are included in a release.
718-
Zip files are written to the <code>_build/release</code> directory.
725+
Zip files are written to the <code>_build\release</code> directory.
719726
</p>
720727

721728
<h4>
@@ -724,12 +731,12 @@ <h4>
724731

725732
<p>
726733
The release zip file for the standard edition requires that the setup files is already
727-
present in the <code>_build/exe</code> directory.
734+
present in the <code>_build\exe</code> directory.
728735
</p>
729736

730737
<p>
731738
The release file includes the setup file along with <code>ReadMe.txt</code>
732-
that is automatically generated from <code>Docs/ReadMe-standard.txt</code>.
739+
that is automatically generated from <code>Docs\ReadMe-standard.txt</code>.
733740
</p>
734741

735742
<p>
@@ -763,9 +770,9 @@ <h4>
763770

764771
<p>
765772
The release file includes the portable executable file, <code>CodeSnip-p.exe</code>,
766-
the help file <code>CodeSnip.chm</code>, <code>Docs/License.html</code> and
773+
the help file <code>CodeSnip.chm</code>, <code>Docs\License.html</code> and
767774
<code>ReadMe.txt</code> that is automatically generated from
768-
<code>Docs/ReadMe-portable.txt</code>.
775+
<code>Docs\ReadMe-portable.txt</code>.
769776
</p>
770777

771778
<p>
@@ -855,6 +862,31 @@ <h3>
855862
zip file names can be used here too.
856863
</p>
857864

865+
<p>
866+
There is also a quicker way to build a release, but you must provide a version number to use it. First navigate up
867+
to the repository root. Then run
868+
</p>
869+
870+
<pre class="cmd"><span class="prompt">&gt;</span> Deploy 9.9.9</pre>
871+
872+
<p>
873+
where <code>9.9.9</code> is the release version number.
874+
</p>
875+
876+
<p>
877+
This command will build both the standard and portable executables, the help file, the standard edition setup file
878+
and finally create the release zip files for both editions, with the release version number incorporated in the file names.
879+
</p>
880+
881+
<p>
882+
Using <code>Deploy 9.9.9</code> is the equivalent of doing:
883+
</p>
884+
885+
<pre class="cmd"><span class="prompt">&gt;</span> cd Src
886+
<span class="prompt">&gt;</span> Make -DVERSION=9.9.9
887+
<span class="prompt">&gt;</span> Make -DPORTABLE -DVERSION=9.9.9
888+
<span class="prompt">&gt;</span> cd ..</pre>
889+
858890
<h3>
859891
Clean Up
860892
</h3>

Deploy.bat

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
:: This Source Code Form is subject to the terms of the Mozilla Public License,
2+
:: v. 2.0. If a copy of the MPL was not distributed with this file, You can
3+
:: obtain one at https://mozilla.org/MPL/2.0/
4+
::
5+
:: Copyright (C) 2024, Peter Johnson (gravatar.com/delphidabbler).
6+
::
7+
:: Deploy script for CodeSnip.
8+
::
9+
:: This script compiles release versions of the standard and portable editions
10+
:: of CodeSnip and places them into two different zip files ready for release.
11+
::
12+
:: This script uses Embarcadero Make. Various other programs are required to
13+
:: run Make. See Src/Makefile for details.
14+
::
15+
:: To use the script:
16+
:: 1) Set the environment variables required for Make to succeed. See
17+
:: Src/Makefile for details
18+
:: 2) Change directory to that where this script is located.
19+
:: 3) Run the script.
20+
::
21+
:: Usage:
22+
:: Deploy <version>
23+
:: where
24+
:: <version> is the version number of the release, e.g. 0.5.3-beta or 1.2.0.
25+
26+
@echo off
27+
28+
setlocal
29+
30+
:: Check for required parameter
31+
if "%1"=="" goto paramerror
32+
33+
:: Store parameter
34+
set Version=%1
35+
36+
:: Store common make parameters
37+
set CommonParams=-DVERSION=%Version%
38+
39+
:: Store standard edition make parameters
40+
set StandardParams=%CommonParams%
41+
42+
:: Store portable edition make parameters
43+
set PortableParams=-DPORTABLE %CommonParams%
44+
45+
:: Set command line
46+
set MakeCmd=Make
47+
set StandardMakeCmd=%MakeCmd% %StandardParams%
48+
set PortableMakeCmd=%MakeCmd% %PortableParams%
49+
50+
echo ----------------------------------------------
51+
echo Deploying CodeSnip Standard And Portable Builds
52+
echo -----------------------------------------------
53+
echo.
54+
echo Standard edition Make command: %StandardMakeCmd%
55+
echo Portable edition Make command: %PortableMakeCmd%
56+
57+
cd Src
58+
59+
echo.
60+
echo.
61+
echo.
62+
echo =========================
63+
echo Building Standard edition
64+
echo =========================
65+
echo.
66+
echo.
67+
%StandardMakeCmd%
68+
69+
echo.
70+
echo.
71+
echo.
72+
echo =========================
73+
echo Building Portable edition
74+
echo =========================
75+
echo.
76+
echo.
77+
%PortableMakeCmd%
78+
79+
echo.
80+
echo.
81+
echo.
82+
echo ====================
83+
echo Deployment completed
84+
echo ====================
85+
86+
goto end
87+
88+
:: Error messages
89+
90+
:paramerror
91+
echo.
92+
echo ***ERROR: Please specify a version number as a parameter
93+
echo.
94+
goto end
95+
96+
:: End
97+
:end
98+
99+
endlocal

0 commit comments

Comments
 (0)