aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-06-02 16:40:07 -0700
committerJake Petroules <jake.petroules@qt.io>2017-06-09 09:49:54 +0000
commitec3ef366a389ec9e6b23d9e3adf38988f2cceac2 (patch)
tree56e82992664087cf612606f81237845b6bfb6576 /scripts
parenta6c9fc50fbddd7d05db89dfe23c279ef70b722a5 (diff)
Add a script to create the release packages for Windows
This is a simple script which invokes a build of Qbs using the specific configuration we intend to use for creating official Windows release packages. It only requires an existing qbs.exe in the PATH as well as the QTDIR and QTDIR64 environment variables set to 32-bit and 64-bit installations of Qt, respectively. It does not use or modify the current environment outside of temporary directories. The intent is to use this script in conjunction with a Docker container although that is not required; instructions for using which will follow in a subsequent patch. Change-Id: I3f150d53c5b4afffdb4d5f5f7d64bf322b263a78 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make-release-archives.bat75
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/make-release-archives.bat b/scripts/make-release-archives.bat
new file mode 100644
index 000000000..d4b5301f6
--- /dev/null
+++ b/scripts/make-release-archives.bat
@@ -0,0 +1,75 @@
+@echo off
+
+REM Copyright (C) 2017 The Qt Company Ltd.
+REM Contact: https://www.qt.io/licensing/
+REM
+REM This file is part of Qbs.
+REM
+REM $QT_BEGIN_LICENSE:LGPL$
+REM Commercial License Usage
+REM Licensees holding valid commercial Qt licenses may use this file in
+REM accordance with the commercial license agreement provided with the
+REM Software or, alternatively, in accordance with the terms contained in
+REM a written agreement between you and The Qt Company. For licensing terms
+REM and conditions see https://www.qt.io/terms-conditions. For further
+REM information use the contact form at https://www.qt.io/contact-us.
+REM
+REM GNU Lesser General Public License Usage
+REM Alternatively, this file may be used under the terms of the GNU Lesser
+REM General Public License version 3 as published by the Free Software
+REM Foundation and appearing in the file LICENSE.LGPL3 included in the
+REM packaging of this file. Please review the following information to
+REM ensure the GNU Lesser General Public License version 3 requirements
+REM will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+REM
+REM GNU General Public License Usage
+REM Alternatively, this file may be used under the terms of the GNU
+REM General Public License version 2.0 or (at your option) the GNU General
+REM Public license version 3 or any later version approved by the KDE Free
+REM Qt Foundation. The licenses are as published by the Free Software
+REM Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+REM included in the packaging of this file. Please review the following
+REM information to ensure the GNU General Public License requirements will
+REM be met: https://www.gnu.org/licenses/gpl-2.0.html and
+REM https://www.gnu.org/licenses/gpl-3.0.html.
+REM
+REM $QT_END_LICENSE$
+
+setlocal enabledelayedexpansion || exit /b
+if not exist VERSION ( echo This script must be run from the qbs source directory 1>&2 && exit /b 1 )
+for /f %%j in (VERSION) do ( set "version=!version!%%j," )
+set "version=%version:~0,-1%"
+
+set builddir=%TEMP%\qbs-release-%version%
+if exist "%builddir%" ( del /s /q "%builddir%" || exit /b )
+
+qbs setup-toolchains --settings-dir "%builddir%\.settings" --detect || exit /b
+
+if exist "%QTDIR%" (
+ qbs setup-qt --settings-dir "%builddir%\.settings"^
+ "%QTDIR%\bin\qmake.exe" qt || exit /b
+) else (
+ echo QTDIR environment variable not set or does not exist: %QTDIR%
+ exit /b 1
+)
+if exist "%QTDIR64%" (
+ qbs setup-qt --settings-dir "%builddir%\.settings"^
+ "%QTDIR64%\bin\qmake.exe" qt64 || exit /b
+) else (
+ echo QTDIR64 environment variable not set or does not exist: %QTDIR64%
+ exit /b 1
+)
+
+REM Work around QBS-1142, where symlinks to UNC named paths aren't resolved
+REM properly, for example if this command is being run in a Docker container
+REM where the current directory is a symlink
+(robocopy "%CD%" "%builddir%\source" /e /njh /njs /ndl /nc /ns /xd .git) ^& IF %ERRORLEVEL% GTR 1 exit %ERRORLEVEL%
+
+qbs build --settings-dir "%builddir%\.settings"^
+ -f "%builddir%\source" -d "%builddir%\build"^
+ -p dist qbs.buildVariant:release dist.includeTopLevelDir:true^
+ release "qbs.installRoot:%builddir%\qbs-windows-x86-%version%" profile:qt^
+ release-64 "qbs.installRoot:%builddir%\qbs-windows-x86_64-%version%" profile:qt64 || exit /b
+
+copy /y "%builddir%\build\release\qbs-windows-x86-%version%.zip" dist || exit /b
+copy /y "%builddir%\build\release-64\qbs-windows-x86_64-%version%.zip" dist || exit /b