forked from tud-cd/tudscr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.bat
177 lines (177 loc) · 7.77 KB
/
release.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
@echo off
cd %~dp0
echo =========================================================================
echo Festlegen der Version, welche erstellt werden soll
echo =========================================================================
for /f "tokens=1,2,3 delims= " %%a in (
'findstr /r \TUD@Version@Check{[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] source\tudscr-version.dtx'
) do (
if "%%c" == "TUD-Script}" (
set version=%%b
) else (
set version=%%b-%%c
)
)
if exist temp rmdir temp /s /q > nul
if exist release-%version% rmdir release-%version% /s /q > nul
echo.
echo TUD-Script %version%
echo.
echo =========================================================================
echo Erzeugen der Klassen und der inline-Dokumentation fuer %version%
echo =========================================================================
echo.
rem call update_classes.bat
xcopy source temp\ /s
cd temp
call clearsource.bat
del clearsource.bat
cd doc
call cleardoc.bat
del cleardoc.bat
cd ..
if exist test rmdir test/s /q > nul
mkdir tex\latex\tudscr
mkdir source\latex\tudscr
mkdir doc\latex\tudscr\tutorials
echo \BaseDirectory{.}> docstrip.cfg
echo \UseTDS>> docstrip.cfg
tex tudscr.ins
pdflatex "\def\tudfinalflag{}\input{tudscrsource.tex}"
pdflatex --shell-escape "\def\tudfinalflag{}\input{tudscrsource.tex}"
pdflatex --shell-escape "\def\tudfinalflag{}\input{tudscrsource.tex}"
pdflatex "\def\tudfinalflag{}\input{tudscrsource.tex}"
move *.dtx source\latex\tudscr\
move tudscr.ins source\latex\tudscr\
move tudscrsource.tex source\latex\tudscr\
xcopy doc source\latex\tudscr\doc\ /s
del source\latex\tudscr\test.tex /s > nul
rem for /f %%f in ('dir /b ..\*.md') do copy ..\%%f doc\latex\tudscr\%%~nf
copy ..\*.md doc\latex\tudscr\
move tudscrsource.pdf doc\latex\tudscr\
move logo tex\latex\tudscr\
del *.* /q > nul
echo.
echo =========================================================================
echo Erzeugen des Benutzerhandbuchs
echo =========================================================================
echo.
cd doc
pdflatex --shell-escape "\def\tudfinalflag{}\input{tudscr.tex}"
pdflatex "\def\tudfinalflag{}\input{tudscr.tex}"
pdflatex "\def\tudfinalflag{}\input{tudscr.tex}"
pdflatex "\def\tudfinalflag{}\input{tudscr.tex}"
pdflatex --shell-escape "\def\tudfinalflag{}\input{tudscr.tex}"
pdflatex "\def\tudfinalflag{}\input{tudscr.tex}"
pdflatex "\def\tudfinalflag{}\def\tudprintflag{}\input{tudscr.tex}"
copy tudscr.pdf tudscr_print.pdf
pdflatex "\def\tudfinalflag{}\input{tudscr.tex}"
del tutorials\*autopp*.* /q > nul
attrib +h "tutorials\*-standalone-*.pdf"
attrib +h "tutorials\*-pics.pdf"
move tudscr*.pdf latex\tudscr\
move tutorials\*.pdf latex\tudscr\tutorials\
move tutorials\*-example.tex ..\source\latex\tudscr\doc\examples\
del *.* /q > nul
rmdir examples /s /q > nul
rmdir tutorials /s /q > nul
echo.
echo =========================================================================
echo Erzeugen der Installationdateien
echo =========================================================================
echo.
cd ..\install
tex tudscr-metrics.dtx
copy ..\source\latex\tudscr\tudscr-version.dtx ..\.
tex tudscr-scripts.dtx
rename *.bxt *.bat
setlocal enabledelayedexpansion
set "pattern=_V_"
set "replace=_%version%_"
for %%a in (*.*) do (
set "file=%%~a"
rename "%%a" "!file:%pattern%=%replace%!"
)
endlocal
del ..\tudscr-version.dtx
echo.
echo =========================================================================
echo Release fuer GitHub
echo =========================================================================
echo.
cd %~dp0
mkdir release-%version%\temp
mkdir release-%version%\GitHub\fonts
mkdir release-%version%\GitHub\oldfonts
mkdir release-%version%\GitHub\uninstall
mkdir release-%version%\GitHub\addon
copy *.md release-%version%\temp\
xcopy addon release-%version%\temp\ /s
copy development\fonts\*.* release-%version%\temp\
copy development\tools\*.* release-%version%\temp\
copy temp\doc\latex\tudscr\tudscr.pdf release-%version%\temp\
copy temp\doc\latex\tudscr\tudscr_print.pdf release-%version%\temp\
move temp\install\*.* release-%version%\temp\
rmdir temp\install /s /q > nul
rmdir temp\cwl /s /q > nul
cd release-%version%\temp
for /f %%f in ('dir /b *.bat') do unix2dos -k %%f
7za a -tzip tudscr_%version%.zip .\..\..\temp\*
7za a -tzip tudscr_fonts_install.zip @7za_files_metrics.txt
REM call tudscr_fonts_convert.bat
REM 7za a -tzip tudscr_fonts_converted.zip @7za_files_fonts.txt
for /f %%f in ('dir /b *.md') do unix2dos -n -k %%f %%~nf.txt
7za a -tzip .\..\GitHub\TUD-Script_%version%_Windows.zip -x!*.sh @7za_files_bundle.txt
7za a -tzip .\..\GitHub\fonts\TUD-Script_fonts_Windows.zip -x!*.sh @7za_files_fonts_install.txt
REM 7za a -tzip .\..\GitHub\TUD-Script_%version%_Windows_full.zip -x!*.sh @7za_files_bundle.txt @7za_files_fonts_install.txt
REM 7za a -tzip .\..\TUD-Script_%version%_Windows_all.zip -x!*.sh @7za_files_bundle.txt @7za_files_fonts_install.txt @7za_files_postscript.txt
REM 7za a -tzip .\..\TUD-Script_fonts_converted_Windows.zip -x!*.sh @7za_files_fonts_converted.txt
for /f %%f in ('dir /b *.md') do copy %%f %%~nf.txt
7za a -tzip .\..\GitHub\TUD-Script_%version%_Unix.zip -x!*.bat -x!7za.exe @7za_files_bundle.txt
7za a -tzip .\..\GitHub\fonts\TUD-Script_fonts_Unix.zip -x!*.bat -x!7za.exe @7za_files_fonts_install.txt
REM 7za a -tzip .\..\GitHub\TUD-Script_%version%_Unix_full.zip -x!*.bat -x!7za.exe @7za_files_bundle.txt @7za_files_fonts_install.txt
REM 7za a -tzip .\..\TUD-Script_%version%_Unix_all.zip -x!*.bat -x!7za.exe @7za_files_bundle.txt @7za_files_fonts_install.txt @7za_files_postscript.txt
REM 7za a -tzip .\..\TUD-Script_fonts_converted_Unix.zip -x!*.bat -x!7za.exe @7za_files_fonts_converted.txt
7za a -tzip .\..\GitHub\addon\tudscr4lyx.zip .\tudscr4lyx\*
7za a -tzip .\..\GitHub\addon\tudscr4texstudio.zip .\tudscr4texstudio\*
cd..
move temp\tudscr_%version%.zip GitHub\tudscr_%version%.zip
move temp\tud_fonts_install.* GitHub\oldfonts\
move temp\tudscr_uninstall.* GitHub\uninstall\
echo.
echo =========================================================================
echo Release fuer CTAN
echo =========================================================================
echo.
mkdir CTAN\tudscr\doc
mkdir CTAN\tudscr\source
mkdir CTAN\tudscr\logo
xcopy ..\temp\doc\latex\tudscr\*.* CTAN\tudscr\doc\ /s
xcopy ..\temp\source\latex\tudscr\*.* CTAN\tudscr\source\ /s
xcopy ..\temp\tex\latex\tudscr\logo\*.* CTAN\tudscr\logo\ /s
move CTAN\tudscr\doc\README.md CTAN\tudscr\README.md
cd temp
(
echo With WScript
echo ZipFile = .Arguments^(0^)
echo Folder = .Arguments^(1^)
echo End With
echo CreateObject^("Scripting.FileSystemObject"^).CreateTextFile^(ZipFile, True^).Write "PK" ^& Chr^(5^) ^& Chr^(6^) ^& String^(18, vbNullChar^)
echo With CreateObject^("Shell.Application"^)
echo .NameSpace^(ZipFile^).CopyHere .NameSpace^(Folder^).Items
echo End With
echo wScript.Sleep 2000
) > winzip.vbs
cd ..
CScript temp\winzip.vbs %cd%\tudscr.zip %cd%\CTAN
move %cd%\tudscr.zip %cd%\CTAN\
echo.
echo =========================================================================
echo Loeschen aller temporaeren Dateien
echo =========================================================================
echo.
pause.
cd %~dp0
if exist release-%version%\temp rmdir release-%version%\temp /s /q > nul
if exist release-%version%\CTAN\tudscr rmdir release-%version%\CTAN\tudscr /s /q > nul
if exist temp rmdir temp /s /q > nul