Skip to content
Snippets Groups Projects
Commit ed86c8be authored by Esben Haabendal's avatar Esben Haabendal
Browse files

Merge branch 'hdc-and-xdevice' into 'kirkstone'

Add openharmony-tools image for host hdc and xdevice tools

Closes #65

See merge request eclipse/oniro-core/meta-openharmony!94
parents 760ede87 b6bb2647
No related branches found
No related tags found
1 merge request!94Add openharmony-tools image for host hdc and xdevice tools
Pipeline #14908 passed
...@@ -331,7 +331,7 @@ build: ...@@ -331,7 +331,7 @@ build:
- DISTRO: [oniro-openharmony-linux] - DISTRO: [oniro-openharmony-linux]
OPENHARMONY_VERSION: ["3.0"] OPENHARMONY_VERSION: ["3.0"]
MACHINE: [qemuarma7] MACHINE: [qemuarma7]
RECIPE: [oniro-openharmony-toolchain, oniro-openharmony-bundle, openharmony-standard-image] RECIPE: [oniro-openharmony-toolchain, oniro-openharmony-bundle, openharmony-standard-image, openharmony-tools]
artifacts: artifacts:
paths: paths:
- build/tmp-*/deploy/images/${MACHINE} - build/tmp-*/deploy/images/${MACHINE}
......
...@@ -116,6 +116,14 @@ quickly building and running OpenHarmony code in QEMU ARM simulator. ...@@ -116,6 +116,14 @@ quickly building and running OpenHarmony code in QEMU ARM simulator.
See [recipes-openharmony/images/README.md](recipes-openharmony/images/README.md) See [recipes-openharmony/images/README.md](recipes-openharmony/images/README.md)
for more information. for more information.
## OpenHarmony host tools
To facilitate working with OpenHarmony systems, an image with various host tools
is provided.
See [recipes-openharmony/tools/README.rst](recipes-openharmony/tools/README.rst)
for more information.
## OpenHarmony prebuilts ## OpenHarmony prebuilts
The meta-openharmony layer enables building of prebuilts for use with the The meta-openharmony layer enables building of prebuilts for use with the
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
BBCLASSEXTEND += "nativesdk"
...@@ -16,4 +16,8 @@ SRC_URI += "file://libusb-include-path.patch" ...@@ -16,4 +16,8 @@ SRC_URI += "file://libusb-include-path.patch"
DEPENDS += "libusb1 libuv openssl lz4 libboundscheck" DEPENDS += "libusb1 libuv openssl lz4 libboundscheck"
BBCLASSEXTEND = "native" do_install:append() {
ln -sfT hdc ${D}${bindir}/hdc_std
}
BBCLASSEXTEND = "native nativesdk"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Handle compare with Python 3.10 and newer.
Signed-off-by: Esben Haabendal <esben@geanix.com>
Upstream-Status: Pending
diff --git a/src/xdevice/_core/command/console.py b/src/xdevice/_core/command/console.py
index 9e448ba8d7e3..122da3c974fb 100644
--- a/src/xdevice/_core/command/console.py
+++ b/src/xdevice/_core/command/console.py
@@ -22,6 +22,7 @@ import platform
import signal
import sys
import threading
+from packaging import version
from _core.config.config_manager import UserConfigManager
from _core.constants import SchedulerType
@@ -84,7 +85,7 @@ class Console(object):
"""
Main xDevice console providing user with the interface to interact
"""
- if sys.version < '3.7':
+ if version.parse(sys.version.split(' ')[0]) < version.parse('3.7'):
LOG.error("Please use python 3.7 or higher version to "
"start project")
sys.exit(0)
diff --git a/src/xdevice/_core/report/__main__.py b/src/xdevice/_core/report/__main__.py
index 33d3a492029c..0a9124f8c2e1 100644
--- a/src/xdevice/_core/report/__main__.py
+++ b/src/xdevice/_core/report/__main__.py
@@ -19,6 +19,7 @@
import os
import sys
import time
+from packaging import version
from _core.logger import platform_logger
from _core.report.reporter_helper import ExecInfo
@@ -29,7 +30,7 @@ LOG = platform_logger("ReportMain")
def main_report():
- if sys.version < '3.7':
+ if version.parse(sys.version.split(' ')[0]) < version.parse('3.7'):
LOG.error("Please use python 3.7 or higher version to start "
"project")
return
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
DESCRIPTION = "XDevice, a core module of the OpenHarmony test framework, provides services on which test case execution depends."
SUMMARY = "Tool for remote test execution in OpenHarmony test framework"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://../LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
SRC_URI += "git://gitee.com/openharmony/test_xdevice.git;protocol=https;branch=OpenHarmony-3.0-LTS;rev=b0845abc4da7c5deef3335f7052ec9fa29ef4c34;lfs=0"
S = "${WORKDIR}/git/extension"
inherit setuptools3
RDEPENDS:${PN} += "python3-setuptools"
BBCLASSEXTEND = "native nativesdk"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
DESCRIPTION = "XDevice, a core module of the OpenHarmony test framework, provides services on which test case execution depends."
SUMMARY = "Tool for remote test execution in OpenHarmony test framework"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
SRC_URI += "git://gitee.com/openharmony/test_xdevice.git;protocol=https;branch=OpenHarmony-3.0-LTS;rev=b0845abc4da7c5deef3335f7052ec9fa29ef4c34;lfs=0"
S = "${WORKDIR}/git"
SRC_URI += "file://python-version-compare-fix.patch"
inherit setuptools3
RDEPENDS:${PN} += "python3-setuptools python3-packaging xdevice-extension"
BBCLASSEXTEND = "native nativesdk"
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. _OpenHarmony SDK:
OpenHarmony Tools
#################
OpenHarmony provides a number of dedicated host tools for working with
OpenHarmony systems.
The `openharmony-tools` recipe bundles up these tools for easy installation of these on a Linux host OS.
Building
********
To build `openharmony-tools` for OpenHarmony 3.0.1, an initialized build
environment is required::
TEMPLATECONF=../meta-openharmony/conf source oe-core/oe-init-build-env
Once that is in place, the `bitbake` command is simply::
DISTRO=oniro-openharmony-linux MACHINE=qemuarma7 bitbake openharmony-tools
Installation
************
To install the tools on a Linux host OS, you need to use the shell script
installer. To install into /opt/openharmony-tools do something like this:
.. code-block:: console
$ ./openharmony-tools-3.0-cortexa7-neon-vfpv4-1.99.99.sh -y -d /opt/openharmony-tools
As the installation above will explain, in order to use the tools you need to do the following:
In order to use the installed tools, you need to setup your shell environment
(this needs to be done each time you create a new shell):
.. code-block:: console
$ . /opt/openharmony-tools/environment-setup-x86_64-oesdk-linux
And with that, you will have access to `hdc` and `xdevice` commands.
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
SUMMARY = "OpenHarmony development tools"
LICENSE = "Apache-2.0"
require sanity-check.inc
TOOLCHAIN_HOST_TASK = "nativesdk-hdc nativesdk-xdevice"
TOOLCHAIN_TARGET_TASK = ""
TOOLCHAIN_OUTPUTNAME = "${PN}-${OPENHARMONY_VERSION}-${TUNE_PKGARCH}-${SDK_VERSION}"
SDK_TITLE = "OpenHarmony tools"
SDK_VERSION ?= "${DISTRO_VERSION}"
RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
inherit populate_sdk
inherit toolchain-scripts-base
inherit nopackages
deltask install
deltask populate_sysroot
do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
create_sdk_files:append () {
rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
# Generate new (mini) sdk-environment-setup file
script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
touch $script
echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${sbindir_nativesdk}:${SDKPATHNATIVE}${base_bindir_nativesdk}:${SDKPATHNATIVE}${base_sbindir_nativesdk}:$PATH' >> $script
echo 'export PYTHONPATH=${SDKPATHNATIVE}${libdir_nativesdk}/python*/site-packages:$PYTHONPATH' >> $script
echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
if [ -e "${SDK_OUTPUT}${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt" ]; then
echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
echo 'export SSL_CERT_FILE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
fi
toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
cat >> $script <<EOF
if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
. \$envfile
done
fi
# We have to unset this else it can confuse oe-selftest and other tools
# which may also use the overlapping namespace.
unset OECORE_NATIVE_SYSROOT
EOF
if [ "${SDKMACHINE}" = "i686" ]; then
echo 'export NO32LIBS="0"' >>$script
echo 'echo "$BB_ENV_PASSTHROUGH_ADDITIONS" | grep -q "NO32LIBS"' >>$script
echo '[ $? != 0 ] && export BB_ENV_PASSTHROUGH_ADDITIONS="NO32LIBS $BB_ENV_PASSTHROUGH_ADDITIONS"' >>$script
fi
}
TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
INHIBIT_DEFAULT_DEPS = "1"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Skip recipe if openharmony is not in DISTRO_FEATURES
inherit features_check
REQUIRED_DISTRO_FEATURES = "openharmony"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment