diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -1,35 +1,6 @@ # KDE on Android Docker Image -For building Qt applications on Android, some extra steps are required in comparison to building them directly on Linux. Specifically, one requires a proper build environment for the cross-compilation step. This Docker script enables you to start without the hassle of first setting up the NDK, SDK, Qt-for-Android, environment variables etc. - -This image provides an Ubuntu/Wily with the following extras: -* installed Android NDK -* installed Android SDK -* installed Qt for Android with Linux host -* installed kdesrc-build -* user ''kdeandroid'' with the following environment - * all needed variables for ECM-CMake Toolchain are set - * command "cmakeandroid" that provides a convenience call to CMake with the toolchain enabled -* the image provides two users - * kdeandroid: default user for a developer, no password - * jenkins: default user for CI system, password "jenkins" - -## Proposed Workflow for Image Creation -Create the image -``` -cd image -docker build -t kde-android-sdk . -``` - -Create the container instance for the needed project, see information about volumes. -``` -docker create -ti --name myproject kde-android-sdk bash -``` -If you want to access the local filesystem to access the source code, consider specifying a docker volume (--volume /localpath:/dockerpath). -See [Docker Volumes Documentation](https://docs.docker.com/userguide/dockervolumes/) for more information. - -Start the container for our project. -``` -docker start -i myproject -``` +This repository is no longer maintained, its contents have been deleted. +The current docker image for Qt/KDE applications on Android is called kdeorg/android-sdk +See documentation at https://community.kde.org/Android/Environment_via_Container diff --git a/image/Dockerfile b/image/Dockerfile deleted file mode 100644 --- a/image/Dockerfile +++ /dev/null @@ -1,159 +0,0 @@ -FROM ubuntu:wily - -LABEL Description="KDE on Android SDK" -MAINTAINER Andreas Cord-Landwehr - -ENV ADIR /opt/android -RUN mkdir -p $ADIR - -# set ANDROID_* environment variables globally -RUN echo "\n\ -ANDROID_NDK=/opt/android/android-ndk-r10e\n\ -ANDROID_SDK_ROOT=/opt/android/android-sdk-linux\n\ -" >> /etc/environment - -# skeleton files that are used for all users -RUN echo "\n\ -export ADIR=$ADIR\n\ -export Qt5_android=$ADIR/Qt5.6.0/5.6/android_armv7/\n\ -export PATH=$ADIR/android-sdk-linux/platform-tools/:$PATH\n\ -export ANT=/usr/bin/ant\n\ -export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/\n\ -\n\ -function cmakeandroid {\n\ - cmake \$@ -DCMAKE_INSTALL_PREFIX=$ADIR/kde/install -DCMAKE_PREFIX_PATH=\"$ADIR/Qt5.6.0/5.6/android_armv7/;$ADIR/kde/install\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ADIR/kde/install/share/ECM/toolchain/Android.cmake\n\ -}\n\ -" >> /etc/skel/.bashrc - -RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ wily main universe restricted\n\ -deb-src [arch=armhf] http://ports.ubuntu.com/ wily main universe restricted\n\ -\n\ -deb [arch=armhf] http://ports.ubuntu.com/ wily-updates main universe restricted\n\ -deb-src [arch=armhf] http://ports.ubuntu.com/ wily-updates main universe restricted\n\ -\n\ -deb [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily main universe restricted\n\ -deb-src [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily main universe restricted\n\ -\n\ -deb [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily-updates main universe restricted\n\ -deb-src [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily-updates main universe restricted\n\ -" > /etc/apt/sources.list - -# enable verbose apt-get output -RUN echo 'Debug::pkgProblemResolver "true";' > /etc/apt/apt.conf.d/debug -RUN dpkg --add-architecture i386 && apt update && apt-get install -y \ - ant \ - build-essential \ - cmake \ - curl \ - expect \ - git \ -# required for running kdesrc-build - libxml-simple-perl \ - libjson-perl \ - openjdk-7-jdk \ - openjdk-7-jre \ - qt5-qmake \ - ssh \ - sudo \ -# required for ki18n - gettext \ -# virtual framebuffer to provide X window for the Qt installer and unit tests - xvfb \ -# required for CI unit tests - openbox \ -# required i386 architecture libraries - libgcc1:i386 \ - libc6:i386 \ - zlib1g:i386 \ -# required for CI buildsystem - python3-lxml \ - python2.7 \ - python-lxml \ - gcovr - -RUN groupadd -g 1000 jenkins && \ - useradd -m -u 1000 -g 1000 -d /home/jenkins jenkins && \ - echo 'jenkins:jenkins' | chpasswd && \ - echo "jenkins ALL=NOPASSWD:ALL" >> /etc/sudoers - -RUN addgroup builders && \ - usermod -G builders jenkins - -RUN adduser kdeandroid --ingroup builders --gecos "" --disabled-password && \ - echo "kdeandroid ALL=NOPASSWD:ALL" >> /etc/sudoers && \ - chown -R kdeandroid:builders $ADIR - -# Enable SSH for CI -RUN dpkg-reconfigure ssh && \ - mkdir -p /var/run/sshd && chmod 744 /var/run/sshd - -# Open port for SSH -EXPOSE 22 - -USER kdeandroid -RUN echo "[url \"git://anongit.kde.org/\"]\n\ - insteadOf = kde:\n\ -[url \"ssh://git@git.kde.org/\"]\n\ - pushInsteadOf = kde:\n\ -" > /home/kdeandroid/.gitconfig - -# get SDK -COPY accept-sdk-license.sh $ADIR/accept-sdk-license.sh -RUN sudo chown kdeandroid:builders $ADIR/accept-sdk-license.sh && \ - chmod +x $ADIR/accept-sdk-license.sh -RUN echo "Download SDK..." && \ - curl http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -o $ADIR/android-sdk.tgz && \ - # unpack SDK - echo "SDK: unpacking..." && \ - tar xfl $ADIR/android-sdk.tgz -C $ADIR/ && \ - echo "SDK: updating..." && \ - $ADIR/accept-sdk-license.sh $ADIR && \ - rm $ADIR/accept-sdk-license.sh && \ - rm $ADIR/android-sdk.tgz && \ - echo "SDK: done." - -# get NDK -RUN echo "Download NDK..." && \ - curl http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -o $ADIR/android-ndk.bin && \ - echo "NDK: unpacking..." && \ - chmod +x $ADIR/android-ndk.bin && \ - cd $ADIR && \ - ./android-ndk.bin && \ - cd / && \ - rm $ADIR/android-ndk.bin && \ - echo "NDK: done." - -#get Qt for Android -RUN echo "Qt Installer: downloading..." && \ - curl http://master.qt.io/archive/qt/5.6/5.6.0/qt-opensource-linux-x64-android-5.6.0.run -o $ADIR/qt-installer.run && \ - chmod +x $ADIR/qt-installer.run - -COPY qtinstallerconfig.qs $ADIR/qtinstallerconfig.qs -# run visual installer with simulated X window, filter out all warning messages due to not having a proper window -RUN xvfb-run -a $ADIR/qt-installer.run --script $ADIR/qtinstallerconfig.qs|grep -v "Warning: QPainter" | grep -v "Warning: QWidget" && \ - echo "Qt Installer: done." - -# cleanup -RUN sudo apt-get remove -y\ - expect \ - curl && \ - sudo apt-get autoremove -y && \ - rm $ADIR/qt-installer.run && \ - rm $ADIR/qtinstallerconfig.qs - -# get KDESRC build and android configurations -RUN git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git $ADIR/kdesrc-conf-android && \ - mkdir -p $ADIR/extragear/kdesrc-build && \ - git clone git://anongit.kde.org/kdesrc-build $ADIR/extragear/kdesrc-build && \ - ln -s $ADIR/extragear/kdesrc-build/kdesrc-build $ADIR/kdesrc-build && \ - ln -s $ADIR/kdesrc-conf-android/kdesrc-buildrc $ADIR/kdesrc-buildrc - -RUN cd $ADIR && \ - ./kdesrc-build extra-cmake-modules - -RUN echo "Configuration finished, finalizing Docker image..." - -USER root - -CMD ["/usr/sbin/sshd", "-D"] - diff --git a/image/accept-sdk-license.sh b/image/accept-sdk-license.sh deleted file mode 100644 --- a/image/accept-sdk-license.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/expect -f - -set timeout 1800 - -# spawn update command and let's wait for password question -spawn $env(ADIR)/android-sdk-linux/tools/android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.1,android-22,sys-img-armeabi-v7a-android-22 -expect { - "Do you accept the license '*'*" { - exp_send "y\r" - exp_continue - } - eof -} diff --git a/image/qtinstallerconfig.qs b/image/qtinstallerconfig.qs deleted file mode 100644 --- a/image/qtinstallerconfig.qs +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright 2015-2016 Andreas Cord-Landwehr - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -function Controller() -{ - console.log("Control script loaded: Qt 5.6 Android with Linux 64 bit host.") - installer.autoRejectMessageBoxes -} - -Controller.prototype.WelcomePageCallback = function() -{ - gui.clickButton(buttons.NextButton) -} - -Controller.prototype.LicenseAgreementPageCallback = function() -{ - var page = gui.pageWidgetByObjectName("LicenseAgreementPage") - page.AcceptLicenseRadioButton.setChecked(true) -} - -// skip qt account creation -Controller.prototype.CredentialsPageCallback = function() -{ - var page = gui.pageWidgetByObjectName("CredentialsPage") - page.EmailLineEdit.setText("[no-mail]") - page.PasswordLineEdit.setText("[your_password_here]") - page.ServiceTermsCheckBox.setChecked(true) - // installer logic expects clicked signal to be set - // to enable switch to next page - page.ServiceTermsCheckBox.clicked() - gui.clickButton(buttons.NextButton) -} - -Controller.prototype.IntroductionPageCallback = function() -{ - gui.clickButton(buttons.NextButton) -} - -Controller.prototype.TargetDirectoryPageCallback = function() -{ - var page = gui.pageWidgetByObjectName("TargetDirectoryPage") - // set target directory - page.TargetDirectoryLineEdit.text = "/opt/android/Qt5.6.0" - gui.clickButton(buttons.NextButton) -} - -// accept license agreement -Controller.prototype.LicenseAgreementPageCallback = function() -{ - var pageAgreement = gui.pageWidgetByObjectName("LicenseAgreementPage") - pageAgreement.AcceptLicenseRadioButton.setChecked(true) - gui.clickButton(buttons.NextButton) -} - -// select components -Controller.prototype.ComponentSelectionPageCallback = function() -{ - var page = gui.pageWidgetByObjectName("ComponentSelectionPage") - page.deselectAll() - page.selectComponent("qt.56.android_armv7") - page.selectComponent("qt.56.qtquickcontrols") - page.selectComponent("qt.56.qtscript") - page.selectComponent("qt.56.qtlocation") - page.selectComponent("qt.56.qt3d") - - gui.clickButton(buttons.NextButton) -} - -// confirm selected components -Controller.prototype.ReadyForInstallationPageCallback = function() -{ - gui.clickButton(buttons.CommitButton) -} - -Controller.prototype.PerformInstallationPageCallback = function() -{ - // IMPORTANT: if you ever run this script with "--verbose", - // then you will encounter the "funny" behavior that the - // commit-button is not activated correctly after the installation - // finished. - // A possible workaround is to uncomment the following line, which - // calls the next-button with a 60-second timeout. This means, after - // the button gets enabled in the UI. - // console.log("Timeout for installation: 60 sec, next-button is activated afterward.") - // gui.clickButton(buttons.NextButton, 60000) - gui.clickButton(buttons.CommitButton) -} - -Controller.prototype.FinishedPageCallback = function() -{ - console.log("Installation finished.") - var page = gui.pageWidgetByObjectName("FinishedPage") - console.log(page.LaunchQtCreatorCheckBoxForm.launchQtCreatorCheckBox.setChecked(false)); - gui.clickButton(buttons.FinishButton) -} - diff --git a/scripts/runtests/emulatorstart.sh b/scripts/runtests/emulatorstart.sh deleted file mode 100755 --- a/scripts/runtests/emulatorstart.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -eval `$ANDROID_SDK_ROOT/tools/emulator64-arm -avd myandroid22 -no-skin -no-audio -no-window` - -sleep 1s - -$ANDROID_SDK_ROOT/platform-tools/adb shell ps - -echo "=== Emulator started ===" diff --git a/scripts/runtests/emulatorstop.sh b/scripts/runtests/emulatorstop.sh deleted file mode 100755 --- a/scripts/runtests/emulatorstop.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -$ANDROID_SDK_ROOT/platform-tools/adb -s emulator-5554 emu kill - diff --git a/scripts/runtests/manifest/AndroidManifest.xml b/scripts/runtests/manifest/AndroidManifest.xml deleted file mode 100644 --- a/scripts/runtests/manifest/AndroidManifest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/runtests/runtests.pl b/scripts/runtests/runtests.pl deleted file mode 100644 --- a/scripts/runtests/runtests.pl +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl -w -# -# Copyright 2016 Andreas Cord-Landwehr -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -use Cwd; -use Cwd 'abs_path'; -use File::Basename; -use File::Temp 'tempdir'; -use File::Path 'remove_tree'; -use Getopt::Long; -use Pod::Usage; -use XML::Simple; -use Term::ANSIColor; - -my $host_arch = "linux-x86"; -my $android_sdk_dir = "$ENV{'ANDROID_SDK_ROOT'}"; - -# absolute path for ADB -my $adb_tool="$android_sdk_dir/platform-tools/adb"; - -# make sure we have at least on device attached -system("$adb_tool devices") == 0 or die "No device found, please plug in/start at least one device/emulator\n"; - -# unit test names -my $packageName = "org.kde.frameworkstest"; -my $intentName = "$packageName/org.qtproject.qt5.android.bindings.QtActivity"; - -#TODO find & build tests here - -#FIXME change hardcoded test -print "=== INSTALL TEST... ===\n"; -system("$adb_tool install /opt/android/kde/build/frameworks/attica/persontest_build_apk/bin/QtApp-debug.apk"); -print "=== TEST INSTALLED ===\n"; - -# run test and start logging thread -print "=== STARTING TEST... ===\n"; - -my $testLib="-o /data/data/foo/output.txt,txt"; -system("$adb_tool shell am start -e \QapplicationArguments \Q$testLib\E\E -n ${intentName}"); - -# uncomment to get full debug output -# system("$adb_tool -e logcat"); - -print "=== TEST STARTED ===\n"; -# download -system("$adb_tool pull /data/data/$packageName/output.txt /tmp/baa.txt"); - -# uninstall -print "=== UNINSTALL TEST... ===\n"; -system("$adb_tool uninstall ${packageName}"); -print "=== TEST UNINSTALLED ===\n"; -