@@ -0,0 +1,63 | |||||
|
1 | @echo off | |||
|
2 | ||||
|
3 | SETLOCAL | |||
|
4 | ||||
|
5 | set CHARTS_TEMP_DIR=temp_dir | |||
|
6 | set CHARTS_TEMP_DIR_FULL=..\%CHARTS_TEMP_DIR% | |||
|
7 | ||||
|
8 | if "%1"=="" ( | |||
|
9 | echo Usage: generate_package_win version [branch or SHA] | |||
|
10 | echo Branch defaults to master. | |||
|
11 | echo Creates the package in parent dir. | |||
|
12 | echo A temporary dir %CHARTS_TEMP_DIR_FULL% is utilized for intermediate steps. | |||
|
13 | goto :end | |||
|
14 | ) | |||
|
15 | ||||
|
16 | if "%2"=="" ( | |||
|
17 | set CHARTS_BRANCH=origin/master | |||
|
18 | ) else ( | |||
|
19 | set CHARTS_BRANCH=%2 | |||
|
20 | ) | |||
|
21 | ||||
|
22 | set CHARTS_VERSION=%1 | |||
|
23 | set CHARTS_BUILD_DIR=%CHARTS_TEMP_DIR_FULL%\tempbuild | |||
|
24 | set CHARTS_PACKAGE_UNZIP_DIR=%CHARTS_TEMP_DIR_FULL%\qtcharts-%CHARTS_VERSION% | |||
|
25 | set CHARTS_TEMP_ZIP=qtcharts_temp_%CHARTS_VERSION%.zip | |||
|
26 | set CHARTS_TEMP_ZIP_FULL=%CHARTS_TEMP_DIR_FULL%\%CHARTS_TEMP_ZIP% | |||
|
27 | set CHARTS_XCOPY_CMD=xcopy /s /i /q | |||
|
28 | set CHARTS_FINAL_ZIP=..\qt-enterprise-charts-src-%CHARTS_VERSION%.zip | |||
|
29 | ||||
|
30 | echo Exporting %CHARTS_BRANCH% to %CHARTS_TEMP_ZIP_FULL%... | |||
|
31 | rmdir /q /s %CHARTS_TEMP_DIR_FULL% 2> NUL | |||
|
32 | md %CHARTS_TEMP_DIR_FULL% 2> NUL | |||
|
33 | call git fetch | |||
|
34 | call git archive --format zip --output ../%CHARTS_TEMP_DIR%/%CHARTS_TEMP_ZIP% %CHARTS_BRANCH% | |||
|
35 | ||||
|
36 | echo Unzipping %CHARTS_TEMP_ZIP_FULL% to %CHARTS_PACKAGE_UNZIP_DIR% and %CHARTS_BUILD_DIR%... | |||
|
37 | md %CHARTS_PACKAGE_UNZIP_DIR% 2> NUL | |||
|
38 | md %CHARTS_BUILD_DIR% 2> NUL | |||
|
39 | call 7z x -y -o%CHARTS_PACKAGE_UNZIP_DIR% %CHARTS_TEMP_ZIP_FULL% > NUL | |||
|
40 | call 7z x -y -o%CHARTS_BUILD_DIR% %CHARTS_TEMP_ZIP_FULL% > NUL | |||
|
41 | ::Workaround for git archive bug | |||
|
42 | rmdir /q /s %CHARTS_PACKAGE_UNZIP_DIR%\tests 2> NUL | |||
|
43 | rmdir /q /s %CHARTS_PACKAGE_UNZIP_DIR%\tools 2> NUL | |||
|
44 | rmdir /q /s %CHARTS_BUILD_DIR%\tests 2> NUL | |||
|
45 | rmdir /q /s %CHARTS_BUILD_DIR%\tools 2> NUL | |||
|
46 | ||||
|
47 | echo Generating includes, mkspecs, and docs in %CHARTS_BUILD_DIR%... | |||
|
48 | pushd %CHARTS_BUILD_DIR% | |||
|
49 | ::Fake git build to get syncqt to run | |||
|
50 | md .git 2> NUL | |||
|
51 | qmake > NUL 2> NUL | |||
|
52 | nmake docs > NUL 2> NUL | |||
|
53 | popd | |||
|
54 | ||||
|
55 | echo Copying generated files to %CHARTS_PACKAGE_UNZIP_DIR% | |||
|
56 | %CHARTS_XCOPY_CMD% %CHARTS_BUILD_DIR%\doc\qch %CHARTS_PACKAGE_UNZIP_DIR%\doc\qch | |||
|
57 | %CHARTS_XCOPY_CMD% %CHARTS_BUILD_DIR%\doc\html %CHARTS_PACKAGE_UNZIP_DIR%\doc\html | |||
|
58 | ||||
|
59 | echo Repackaging %CHARTS_PACKAGE_UNZIP_DIR% to %CHARTS_FINAL_ZIP% | |||
|
60 | del /q %CHARTS_FINAL_ZIP% 2> NUL | |||
|
61 | call 7z a -r -y -tzip %CHARTS_FINAL_ZIP% %CHARTS_PACKAGE_UNZIP_DIR% >NUL | |||
|
62 | ||||
|
63 | :end |
General Comments 0
You need to be logged in to leave comments.
Login now