diff --git a/.travis.yml b/.travis.yml index 425380b4..b89a1b35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,18 +49,32 @@ matrix: - make run-docker CMD='make test' - make lint - make run-docker CMD='make install-coveralls ; make test-cover-travis' - - stage: Windows - os: windows - install: - - choco install make -y - - choco install unzip -y - - travis_wait 50 make install-deps-Windows - - make install-linters - - make install-coveralls - script: - - make build-Windows-travis - - make build-icon - - make lint +# FIXME: Restore Windows builds +# - stage: Windows +# os: windows +# env: +# - QT5_BASE_DIR: C:/Qt/5.13.0/msvc2017 +# - QT_DIR: C:/Qt +# - QT_QMAKE_DIR: C:/Qt/5.13.0/mingw73_64/bin +# install: +# - choco install make -y +# - choco install unzip -y +# #- df -h +# #- .travis/install-qt-win.sh +# #- df -h +# #- ls C:/Qt +# #- ls C:/Qt/5.13.0 +# #- ls C:/Qt/5.13.0/mingw73_64 +# #- ls C:/Qt/5.13.0/mingw73_64/bin +# - travis_wait 50 make install-deps-Windows +# - df -h +# - make install-linters +# - make install-coveralls +# script: +# - make build +# - make test +# - make build-icon +# - make test-cover-travis - stage: MacOS os: osx osx_image: xcode10.2 diff --git a/.travis/install-qt-win.sh b/.travis/install-qt-win.sh new file mode 100755 index 00000000..a64801d4 --- /dev/null +++ b/.travis/install-qt-win.sh @@ -0,0 +1,23 @@ +set -eu -o pipefail + +if [ -e "$QT5_BASE_DIR/bin/moc.exe" ]; then + echo "Found an existing Qt installation at $QT5_BASE_DIR" + exit +fi + +echo "Downloading the installer..." +# https is of no use if it redirects to a http mirror... +curl -vLo ~/qt-unified-windows-x86-online.exe http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe + +echo "Installing..." +# Run installer and save the installer output. To avoid hitting the timeout, +# periodically print some progress. On error, show the full log and abort. +~/qt-unified-windows-x86-online.exe --verbose --script .travis/qt-installer-windows.qs +#| +# tee ~/qt-installer-output.txt | +# .travis/report-progress.sh || +# (cat ~/qt-installer-output.txt; exit 1) +# +#printf 'Installation size: ' +#du -sm "$QT5_BASE_DIR" 2>&1 || +# (cat ~/qt-installer-output.txt; exit 1) \ No newline at end of file diff --git a/.travis/qt-installer-windows.qs b/.travis/qt-installer-windows.qs new file mode 100644 index 00000000..60341358 --- /dev/null +++ b/.travis/qt-installer-windows.qs @@ -0,0 +1,95 @@ + + +var INSTALL_COMPONENTS = [ + "qt.qt5.5130.win64_mingw73", + "qt.qt5.5130.qtscript", + "qt.qt5.5130.qtscript.win64_mingw73", + +]; + +function Controller() { + installer.autoRejectMessageBoxes(); + installer.installationFinished.connect(function() { + gui.clickButton(buttons.NextButton); + }) +} + +Controller.prototype.WelcomePageCallback = function() { + // click delay here because the next button is initially disabled for ~1 second + gui.clickButton(buttons.NextButton, 3000); +} + +Controller.prototype.CredentialsPageCallback = function() { + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.IntroductionPageCallback = function() { + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.DynamicTelemetryPluginFormCallback = function() { + gui.currentPageWidget().TelemetryPluginForm.statisticGroupBox.disableStatisticRadioButton.setChecked(true); + gui.clickButton(buttons.NextButton); + + //for(var key in widget.TelemetryPluginForm.statisticGroupBox){ + // console.log(key); + //} +} + +Controller.prototype.TargetDirectoryPageCallback = function() +{ + // Keep default at "C:\Qt". + //gui.currentPageWidget().TargetDirectoryLineEdit.setText("E:\\Qt"); + //gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("HomeDir") + "/Qt"); + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.ComponentSelectionPageCallback = function() { + + // https://doc-snapshots.qt.io/qtifw-3.1/noninteractive.html + var page = gui.pageWidgetByObjectName("ComponentSelectionPage"); + + var archiveCheckBox = gui.findChild(page, "Archive"); + var latestCheckBox = gui.findChild(page, "Latest releases"); + var fetchButton = gui.findChild(page, "FetchCategoryButton"); + + archiveCheckBox.click(); + latestCheckBox.click(); + fetchButton.click(); + + var widget = gui.currentPageWidget(); + + widget.deselectAll(); + + for (var i = 0; i < INSTALL_COMPONENTS.length; i++) { + widget.selectComponent(INSTALL_COMPONENTS[i]); + } + + //widget.selectComponent("qt.tools.qtcreator"); + //widget.selectComponent("qt.55.qt3d"); + + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.LicenseAgreementPageCallback = function() { + gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true); + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.StartMenuDirectoryPageCallback = function() { + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.ReadyForInstallationPageCallback = function() +{ + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.FinishedPageCallback = function() { +var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm; +if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) { + checkBoxForm.launchQtCreatorCheckBox.checked = false; +} + gui.clickButton(buttons.FinishButton); +} + diff --git a/.travis/report-progress.sh b/.travis/report-progress.sh new file mode 100644 index 00000000..a378cc5b --- /dev/null +++ b/.travis/report-progress.sh @@ -0,0 +1,35 @@ + +set -eu + +# Default to a 60 seconds interval between printing messages. +PERIOD=${1:-60} + +nexttime=$PERIOD +msg= +count=0 + +# Reset timer (SECONDS is a special Bash variable). +SECONDS=0 + +while true; do + # Periodically report the last read line. + timeleft=$((nexttime-SECONDS)) + while [ $timeleft -le 0 ]; do + ((nexttime+=PERIOD)) + ((timeleft+=PERIOD)) + printf "[progress] %3d %s\n" $SECONDS "${msg:-(no output)}" + msg= + done + + if read -r -t $timeleft line; then + # Save line for later. + ((count+=1)) + msg="Line $count: $line" + continue + elif [ $? -le 128 ]; then + # EOF (as opposed to a timeout) + [ -z "$msg" ] || printf "[progress] %3d %s\n" $SECONDS "$msg" + printf "[progress] %3d done (read %d lines).\n" $SECONDS $count + break + fi +done \ No newline at end of file diff --git a/Makefile b/Makefile index 0bab568b..6c63dd5b 100644 --- a/Makefile +++ b/Makefile @@ -130,7 +130,8 @@ install-deps-Darwin: ## Install osx dependencies install-deps-Windows: ## Install Windowns dependencies set GO111MODULE=off go get -v -tags=no_env github.com/therecipe/qt/cmd/... - (qtsetup -test=false) + @echo "Running qtsetup" + (qtsetup -test=false | true) go get -t -d -v ./... wget -O magick.zip https://sourceforge.net/projects/imagemagick/files/im7-exes/ImageMagick-7.0.7-25-portable-Q16-x64.zip unzip magick.zip convert.exe