-
Notifications
You must be signed in to change notification settings - Fork 5
/
release.bat
83 lines (69 loc) · 1.86 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
@echo off
:: This batch file generates a release for the PST File Format SDK. It must
:: be run from the root of the trunk/branch you want to generate a release
:: for. "svn up" will be called.
::
:: To use it, type "release x_y_z" where x, y, and z form the version number
::
:: 7zip must be in your path
:: sfk must be in your path
:: svn must be in your path
:: doxygen must be in your path
::
:: Check preconditions
::
if not exist Doxyfile goto Usage
if %1!==! goto Usage
goto Start
:Usage
echo Release.bat - Generate a release for PST File Format SDK.
echo.
echo This tool must be run from the root of a branch/trunk.
echo.
echo This tool requires that 7zip, sfk, svn, and doxygen are all in the
echo current PATH.
echo.
echo Release.bat will generate a release directory as well as the two release
echo zip files (doc and nodoc) as a sibling of the branch/trunk directory.
echo.
echo Usage: release 1_2_3
echo Creates a release for version 1.2.3
goto Done
:Start
::
:: Update everyone, regenerate documentation
::
svn up
doxygen Doxyfile
::
:: Export to target dir
::
svn export . ..\pstsdk_%1
::
:: Remove unwanted files
::
del ..\pstsdk_%1\Doxyfile
del ..\pstsdk_%1\release.bat
del ..\pstsdk_%1\.gitignore
del /q ..\pstsdk_%1\doc\*.pdf
del ..\pstsdk_%1\pstsdk\ndb\context.h
::
:: Convert everything to windows line endings
::
sfk addcr ..\pstsdk_%1 .h .cpp .txt
::
:: Create release files
::
:: nodoc zip
7za a ..\pstsdk_%1_nodoc.zip ..\pstsdk_%1 -r
7za a ..\pstsdk_%1_nodoc.7z ..\pstsdk_%1 -r
:: copy over docs
copy doc\*.pdf ..\pstsdk_%1\doc
mkdir ..\pstsdk_%1\doc\html
copy doc\html ..\pstsdk_%1\doc\html
mkdir ..\pstsdk_%1\doc\html\search
copy doc\html\search ..\pstsdk_%1\doc\html\search
:: doc zip
7za a ..\pstsdk_%1.zip ..\pstsdk_%1 -r
7za a ..\pstsdk_%1.7z ..\pstsdk_%1 -r
:Done