Browse Source

More build script tweaking

recurring 0.4.0
Aditya Kulkarni 6 years ago
parent
commit
ba257e2d40
  1. 2
      src/main.cpp
  2. 3
      src/mainwindow.cpp
  3. 28
      src/scripts/dobuild.ps1
  4. 22
      src/scripts/mkmacdmg.sh
  5. 2
      src/scripts/mkrelease.sh
  6. 1
      src/version.h
  7. 6
      zec-qt-wallet.pro

2
src/main.cpp

@ -2,6 +2,8 @@
#include "settings.h"
#include "turnstile.h"
#include "version.h"
#include "precompiled.h"
int main(int argc, char *argv[])

3
src/mainwindow.cpp

@ -11,12 +11,11 @@
#include "rpc.h"
#include "balancestablemodel.h"
#include "settings.h"
#include "version.h"
#include "turnstile.h"
#include "senttxstore.h"
#include "connection.h"
using json = nlohmann::json;
MainWindow::MainWindow(QWidget *parent) :

28
src/scripts/dobuild.ps1

@ -2,7 +2,8 @@
param (
[Parameter(Mandatory=$true)][string]$version,
[Parameter(Mandatory=$true)][string]$prev,
[Parameter(Mandatory=$true)][string]$server
[Parameter(Mandatory=$true)][string]$server,
[Parameter(Mandatory=$true)][string]$macserver
)
Write-Host "[Initializing]"
@ -15,6 +16,28 @@ Remove-Item -Recurse -Force -ErrorAction Ignore ./bin
Remove-Item -Recurse -Force -ErrorAction Ignore ./debug
Remove-Item -Recurse -Force -ErrorAction Ignore ./release
# Create the version.h file
echo "#define APP_VERSION `"$version`"" > src/version.h
echo ""
echo "[Building on Mac]"
Write-Host -NoNewline "Copying files.........."
ssh $macserver "rm -rf /tmp/zqwbuild"
ssh $macserver "mkdir /tmp/zqwbuild"
scp -r * ${macserver}:/tmp/zqwbuild | Out-Null
Write-Host "[OK]"
ssh $macserver "cd /tmp/zqwbuild && APP_VERSION=$version QT_PATH=~/Qt/5.11.2/clang_64/ ZCASH_DIR=~/github/zcash bash src/scripts/mkmacdmg.sh"
if (!$?) {
Write-Output "[Error]"
exit 1;
}
New-Item artifacts -itemtype directory -Force | Out-Null
scp ${macserver}:/tmp/zqwbuild/artifacts/* artifacts/ | Out-Null
Write-Host ""
echo "[Building Linux/Windows]"
Write-Host -NoNewline "Copying files.........."
ssh $server "rm -rf /tmp/zqwbuild"
ssh $server "mkdir /tmp/zqwbuild"
@ -45,7 +68,8 @@ Write-Host -NoNewline "Checking Build........."
if (! (Test-Path ./artifacts/linux-zec-qt-wallet-v$version.tar.gz) -or
! (Test-Path ./artifacts/Windows-zec-qt-wallet-v$version.zip) -or
! (Test-Path ./artifacts/zec-qt-wallet-v$version.deb) -or
! (Test-Path ./artifacts/zec-qt-wallet-v$version.msi)) {
! (Test-Path ./artifacts/zec-qt-wallet-v$version.msi) -or
! (Test-Path ./artifacts/zec-qt-wallet-v$version.dmg) ) {
Write-Host "[Error]"
exit 1;
}

22
src/scripts/mkmacdmg.sh

@ -5,40 +5,48 @@ if [ -z $QT_PATH ]; then
exit 1;
fi
if [ -z $ZCASH_DIR ]; then
echo "ZCASH_PATH is not set. Please set it to the base directory of a compiled zcashd";
exit 1;
fi
if [ -z $APP_VERSION ]; then
echo "APP_VERSION is not set. Please set it to the current release version of the app";
exit 1;
fi
if [ ! -f ../zcash/src/zcashd ]; then
echo "Could not find compiled zcashd in ../zcash/src/.";
if [ ! -f $ZCASH_DIR/src/zcashd ]; then
echo "Could not find compiled zcashd in $ZCASH_DIR/src/.";
exit 1;
fi
export PATH=$PATH:/usr/local/bin
#Clean
echo -n "Cleaning............"
echo -n "Cleaning..............."
make distclean >/dev/null 2>&1
rm -f artifacts/zec-qt-wallet-v$APP_VERSION.dmg
echo "[OK]"
echo -n "Building............"
echo -n "Building..............."
# Build
$QT_PATH/bin/qmake zec-qt-wallet.pro CONFIG+=release >/dev/null
make -j4 >/dev/null
echo "[OK]"
#Qt deploy
echo -n "Deploying..........."
echo -n "Deploying.............."
mkdir artifacts >/dev/null 2>&1
rm -f artifcats/zec-qt-wallet.dmg >/dev/null 2>&1
rm -f artifacts/rw* >/dev/null 2>&1
cp ../zcash/src/zcashd zec-qt-wallet.app/Contents/MacOS/
cp $ZCASH_DIR/src/zcashd zec-qt-wallet.app/Contents/MacOS/
cp $ZCASH_DIR/src/zcash-cli zec-qt-wallet.app/Contents/MacOS/
$QT_PATH/bin/macdeployqt zec-qt-wallet.app
echo "[OK]"
echo -n "Building dmg........"
echo -n "Building dmg..........."
# create-dmg --volname "zec-qt-wallet-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "zec-qt-wallet.app" 200 190 --app-drop-link 600 185 --hide-extension "zec-qt-wallet.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/zec-qt-wallet.dmg zec-qt-wallet.app >/dev/null
mkdir bin/dmgbuild >/dev/null 2>&1
sed "s/RELEASE_VERSION/${APP_VERSION}/g" res/appdmg.json > bin/dmgbuild/appdmg.json

2
src/scripts/mkrelease.sh

@ -56,7 +56,7 @@ make distclean >/dev/null 2>&1
echo "[OK]"
echo ""
echo "[Linux " `lsb_release -r` "]"
echo "[Building on" `lsb_release -r` "]"
echo -n "Configuring............"
$QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null

1
src/version.h

@ -0,0 +1 @@
#define APP_VERSION "0.4.0"

6
zec-qt-wallet.pro

@ -13,8 +13,6 @@ PRECOMPILED_HEADER = src/precompiled.h
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = zec-qt-wallet
APP_VERSION=\\\"0.3.2\\\"
TEMPLATE = app
@ -23,9 +21,7 @@ TEMPLATE = app
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += \
QT_DEPRECATED_WARNINGS \
APP_VERSION=$$APP_VERSION
QT_DEPRECATED_WARNINGS
INCLUDEPATH += src/3rdparty/

Loading…
Cancel
Save