đ Build scripts for the desktop client
This allows you to easily build the desktop client for 64-bit and 32-bit Windows.
âšī¸ It assumes you have installed the dependencies as explained in nextcloud/desktop-client-blueprints/README.
KDE Craft: https://community.kde.org/Get_Involved/development/Windows
Git bash (it comes with Git): https://git-scm.com/download/win
png2ico - PNG to icon converter:
C:/Nextcloud/tools/png2ico.exe
Inkscape: https://inkscape.org/release
đ Assumed working folders
C:\Nextcloud
C:\Nextcloud\tools
âšī¸ Don't use white spaces in the build (project) paths, since this breaks support for some tools like png2ico!
âšī¸ If you prefer to, you may specify a project directory outside of the cloned client-building repo.
BUILD_INSTALLER_MSI=1
â ī¸ NSIS is not required anymore since we use MSI, without NSIS set: BUILD_INSTALLER=0
â Don't forget to manually connect via ssh for the first time in order to trust the host key!
This has to be done ONLY ONCE to create the build folder structure and fetch the required repos (qtkeychain, zlib and Nextcloud's desktop):
cd /c/Nextcloud
git clone https://github.com/nextcloud/client-building.git client-building
C:\Nextcloud\client-building\defaults.inc.bat
cd client-building
./init.bat
TEST_RUN=1 ./build.bat
â ī¸ This only tests for the existence of all variables, no other file or folder checks will be perfomed.
đĨ If the real build fails the scripts will stop and return an error code which is pretty helpful for automated builds. It appears for example in the Task Scheduler.
When the initial setup is done, only the following needs to be done if you want to build the client at any time later:
In Git Bash again:
./build.bat
./task-build-log.bat
By default the commands above will build Release for 64-bit and 32-bit.
âšī¸ Examples:
./build.bat Release
./task-build-log.bat Debug
To build Release, collect all files but build no installer, don't sign and don't upload:
BUILD_INSTALLER=0 USE_CODE_SIGNING=0 UPLOAD_BUILD=0 ./build.bat Release
build.bat invokes all the other build scripts, stages are:
build-qtkeychain.bat
build-zlib.bat
build-desktop.bat
build-installer-collect.bat
build-installer-exe.bat
âšī¸ They need to be run in the correct order above and all the previous scripts should have succeeded. The parameter syntax is the same as for build.bat.
âšī¸ These scripts contain a loop which invoke their single-build-*.bat helpers and they also set the required environment variables you normally would have to specify manually. Exception: build-installer-exe.bat doesn't need a loop since it builds a combined installer package, so there is no single-build-installer-exe.bat. Of course you could do this, e.g. calling syntax to only build for 32-bit would be:
./single-build-desktop.bat Release Win32
Upon every new invocation the build scripts fetch the newest version of their repo.
đ Take a look at the scripts if you want to know how they work, which resources they collect and the CMake options and generators they use.
init.bat
defaults.inc.bat
common.inc.bat
datetime.inc.bat + datetime.inc.callee
build-installer-collect.bat
task-build-log.bat
task-build-job.sh
sign.bat
upload.bat
Copyright (c) 2019 Michael Schuster
Parts based on work at: https://github.com/nextcloud/client-building/tree/6b2d7d34f7d79ccb7fcbc6b285da1f6f8f2bbfc8
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.