|
| 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