forked from mumurik/xyzzy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdist.bat
57 lines (46 loc) · 1.41 KB
/
dist.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@echo off
setlocal
cd /d %~dp0
if "%1"=="" goto usage
set VERSION=%1
set TAG=v%VERSION%
set APPNAME=xyzzy
set BASEDIR=%~dp0
set GIT_REPO=%BASEDIR%
set DISTROOT=%BASEDIR%\_dist
set DISTDIR=%BASEDIR%\_dist\%APPNAME%
set SRCDIR=%BASEDIR%\_dist\%APPNAME%-src-%VERSION%
set DIST_ARCHIVE=%DISTROOT%\%APPNAME%-%VERSION%.zip
set SRC_ARCHIVE=%DISTROOT%\%APPNAME%-src-%VERSION%.zip
call git tag %TAG% -a -m "%APPNAME% %VERSION% released!" || exit /b 1
call git tag
cd %BASEDIR%
rd /S /Q %DISTROOT% 2> nul
mkdir %DISTROOT%
mkdir %SRCDIR%
mkdir %DISTDIR%
mkdir %DISTDIR%\lisp
mkdir %DISTDIR%\etc
mkdir %DISTDIR%\docs
mkdir %DISTDIR%\reference
mkdir %DISTDIR%\site-lisp
cd %SRCDIR%
call git clone %GIT_REPO% %SRCDIR% || exit /b 1
call git checkout %TAG% || git tag exit /b 1
rd /S /Q .git 2> nul
7za a %SRC_ARCHIVE% %SRCDIR%
call build.bat Release Build normal "/p:GenerateDebugInformation=false" || exit /b 1
call bytecompile.bat || exit /b 1
xcopy /F /G /H /R /K /Y *.exe %DISTDIR%
xcopy /F /G /H /R /K /Y LICENSE %DISTDIR%\docs\
xcopy /F /G /H /R /K /Y LEGAL.md %DISTDIR%\docs\
xcopy /F /G /H /R /K /Y /S /E lisp %DISTDIR%\lisp\
xcopy /F /G /H /R /K /Y /S /E etc %DISTDIR%\etc\
xcopy /F /G /H /R /K /Y /S /E docs %DISTDIR%\docs\
xcopy /F /G /H /R /K /Y /S /E reference %DISTDIR%\reference\
cd %DISTROOT%
7za a %DIST_ARCHIVE% %DISTDIR%
goto :eof
:usage
echo Usage: %0 VERSION
goto :eof