-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake.cmd
130 lines (99 loc) · 3.77 KB
/
make.cmd
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
@echo off
setlocal enableextensions enabledelayedexpansion
rem ****************************************************************************
rem * Parameters
rem ****************************************************************************
set project_dir=project\VS2013
set project_name=xbmc-pvr-livestreams
set build_config=Release
set msbuild="%VS120COMNTOOLS%..\..\..\MSBuild\12.0\bin\MSBuild.exe"
set zip="project\BuildDependencies\bin\7za.exe"
rem ****************************************************************************
rem * Call rules
rem ****************************************************************************
if "%*" == "" (
call :all
) else (
for %%x in (%*) do call :%%x
)
goto :eof
rem ****************************************************************************
rem * all
rem ****************************************************************************
:all
call :dist-zip
goto :eof
rem ****************************************************************************
rem * build
rem ****************************************************************************
:build
%msbuild% %project_dir%\%project_name%.sln /t:Build /p:Configuration="%build_config%"
goto :eof
rem ****************************************************************************
rem * rebuild
rem ****************************************************************************
:rebuild
call :clean
call :build
goto :eof
rem ****************************************************************************
rem * clean
rem ****************************************************************************
:clean
%msbuild% %project_dir%\%project_name%.sln /t:Clean /p:Configuration="%build_config%"
del addons\pvr.livestreams\XBMC_LiveStreams_PVR_win32.dll 2>nul
rd /q /s project\VS2013\platform\Debug 2>nul
rd /q /s project\VS2013\platform\Release 2>nul
rd /q /s project\VS2013\livestreamspvr\Debug 2>nul
rd /q /s project\VS2013\livestreamspvr\Release 2>nul
del /q %project_dir%\%project_name%.sdf >nul 2>nul
del /q /a:h %project_dir%\%project_name%.v12.suo >nul 2>nul
goto :eof
rem ****************************************************************************
rem * distr-zip
rem ****************************************************************************
:dist-zip
call :rebuild
if exist addons\pvr.livestreams\changelog.txt del addons\pvr.livestreams\changelog.txt > nul
if exist addons\pvr.livestreams\addon.xml del addons\pvr.livestreams\addon.xml > nul
REM ------- Grab version from configure.ac into addon.xml file--------
setlocal enableextensions enabledelayedexpansion
for /f "usebackq delims=" %%i in ("configure.ac") do (
set "zeile=%%i"
set zeile=!zeile:~11,30!
set zeile1=!zeile:~0,5!
IF !zeile1!==MAJOR (
set maj=!zeile:~8,30!
set maj=!maj:~0,-1!
)
IF !zeile1!==MINOR (
set min=!zeile:~8,30!
set min=!min:~0,-1!
)
IF !zeile1!==MICRO (
set mic=!zeile:~8,30!
set mic=!mic:~0,-1!
echo !maj!.!min!.!mic!>>test.tmp
)
)
for /F "delims=" %%i in (test.tmp) do set "zeile=%%i"
set "Von= version"
set "Nach= version="X""
set Nach=!Nach:X=%zeile%!
for /f "usebackq delims=" %%i in ("addons/pvr.livestreams/addon.xml.in") do (
set "Line=%%i"
set Line=!Line:%Von%=%Nach%!
set Line1=!Line!
set line1=!line1:~0,9!
set line1=!line1:~2,7!
if !Line1!==version set Line=!Line:~0,-12!
echo !Line! >> addons/pvr.livestreams/addon.xml
)
setlocal disabledelayedexpansion
copy changelog.txt addons\pvr.livestreams\changelog.txt
copy %project_dir%\livestreamspvr\%build_config%\XBMC_LiveStreams_PVR_win32.dll addons\pvr.livestreams
set zipfile=pvr.livestreams.%maj%.%min%.%mic%.zip
if exist %zipfile% del %zipfile% > NUL
%zip% a %zipfile% .\addons\pvr.livestreams -xr!*.in -xr!*.am -xr!.gitignore >nul
if exist test.tmp del test.tmp
goto :eof