From b55e52dca53d4f1a1ca0da51856c05ae08938105 Mon Sep 17 00:00:00 2001 From: xiaoxiang Date: Tue, 26 Dec 2023 11:20:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlog=E5=86=99=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaoxiang --- attachment/repos/bootstrap/ohos.py | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/attachment/repos/bootstrap/ohos.py b/attachment/repos/bootstrap/ohos.py index 03373f1b16..61a605a231 100644 --- a/attachment/repos/bootstrap/ohos.py +++ b/attachment/repos/bootstrap/ohos.py @@ -57,11 +57,11 @@ DIR_LOG = safeGetPath("%s/logs" % DIR_OUTPUTS) class BuildInfo: def __init__( - self, - buildType="release", - targetOS="ohos", - targetArch="arm64", - targetTriple="arm64-%s-ohos" % OS_NAME, + self, + buildType="release", + targetOS="ohos", + targetArch="arm64", + targetTriple="arm64-%s-ohos" % OS_NAME, ): self.buildType = buildType self.targetOS = targetOS @@ -128,14 +128,15 @@ def getNdkHome(): logging.info("OHOS_NDK_HOME = %s" % OHOS_NDK_HOME) if ( - (not os.path.exists(OHOS_NDK_HOME)) - or (not os.path.exists(OHOS_NDK_HOME + "/sysroot")) - or (not os.path.exists(OHOS_NDK_HOME + "/llvm/bin")) - or (not os.path.exists(OHOS_NDK_HOME + "/build-tools/cmake/bin")) + (not os.path.exists(OHOS_NDK_HOME)) + or (not os.path.exists(OHOS_NDK_HOME + "/sysroot")) + or (not os.path.exists(OHOS_NDK_HOME + "/llvm/bin")) + or (not os.path.exists(OHOS_NDK_HOME + "/build-tools/cmake/bin")) ): logging.error( """ - Please set the environment variables for HarmonyOS SDK to "HOS_SDK_HOME" or "OHOS_SDK_HOME". + Please set the environment variables for HarmonyOS NDK to "OHOS_NDK_HOME". + Such as 'export OHOS_NDK_HOME=~/ndk/mac/4.0/native'. We will use both native/llvm and native/sysroot. Please ensure that the file "native/llvm/bin/clang" exists and is executable.""" ) @@ -149,9 +150,9 @@ def engineConfig(buildInfo, extraParam=""): # export PATH=$OHOS_NDK_HOME/build-tools/cmake/bin:$OHOS_NDK_HOME/llvm/bin:$PATH lastPath = os.getenv("PATH") os.environ["PATH"] = ( - "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "cmake", "bin"), PATH_SEP) - + "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "llvm", "bin"), PATH_SEP) - + lastPath + "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "cmake", "bin"), PATH_SEP) + + "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "llvm", "bin"), PATH_SEP) + + lastPath ) OPT = "--unoptimized --no-lto " if buildInfo.buildType == "debug" else "" @@ -173,7 +174,7 @@ def engineConfig(buildInfo, extraParam=""): + extraParam.replace("\\", ""), checkCode=False, timeout=600, - ) + ) # 执行engine编译操作 @@ -218,7 +219,7 @@ def harBuild(buildInfo): fileDest = safeGetPath( "%s/src/out/%s/ohos/flutter_embedding.har" % (DIR_ROOT, getOutput(buildInfo)), isDirectory=False, - ) + ) shutil.copy(fileSrc, fileDest) logging.info( "Copy result is %s, from %s to %s" -- Gitee From 8a8c7e4336c3a6505f2dba83089965034da225ef Mon Sep 17 00:00:00 2001 From: xiaoxiang Date: Tue, 26 Dec 2023 11:24:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlog=E5=86=99=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaoxiang --- attachment/repos/bootstrap/ohos.py | 31 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/attachment/repos/bootstrap/ohos.py b/attachment/repos/bootstrap/ohos.py index 61a605a231..03373f1b16 100644 --- a/attachment/repos/bootstrap/ohos.py +++ b/attachment/repos/bootstrap/ohos.py @@ -57,11 +57,11 @@ DIR_LOG = safeGetPath("%s/logs" % DIR_OUTPUTS) class BuildInfo: def __init__( - self, - buildType="release", - targetOS="ohos", - targetArch="arm64", - targetTriple="arm64-%s-ohos" % OS_NAME, + self, + buildType="release", + targetOS="ohos", + targetArch="arm64", + targetTriple="arm64-%s-ohos" % OS_NAME, ): self.buildType = buildType self.targetOS = targetOS @@ -128,15 +128,14 @@ def getNdkHome(): logging.info("OHOS_NDK_HOME = %s" % OHOS_NDK_HOME) if ( - (not os.path.exists(OHOS_NDK_HOME)) - or (not os.path.exists(OHOS_NDK_HOME + "/sysroot")) - or (not os.path.exists(OHOS_NDK_HOME + "/llvm/bin")) - or (not os.path.exists(OHOS_NDK_HOME + "/build-tools/cmake/bin")) + (not os.path.exists(OHOS_NDK_HOME)) + or (not os.path.exists(OHOS_NDK_HOME + "/sysroot")) + or (not os.path.exists(OHOS_NDK_HOME + "/llvm/bin")) + or (not os.path.exists(OHOS_NDK_HOME + "/build-tools/cmake/bin")) ): logging.error( """ - Please set the environment variables for HarmonyOS NDK to "OHOS_NDK_HOME". - Such as 'export OHOS_NDK_HOME=~/ndk/mac/4.0/native'. + Please set the environment variables for HarmonyOS SDK to "HOS_SDK_HOME" or "OHOS_SDK_HOME". We will use both native/llvm and native/sysroot. Please ensure that the file "native/llvm/bin/clang" exists and is executable.""" ) @@ -150,9 +149,9 @@ def engineConfig(buildInfo, extraParam=""): # export PATH=$OHOS_NDK_HOME/build-tools/cmake/bin:$OHOS_NDK_HOME/llvm/bin:$PATH lastPath = os.getenv("PATH") os.environ["PATH"] = ( - "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "cmake", "bin"), PATH_SEP) - + "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "llvm", "bin"), PATH_SEP) - + lastPath + "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "cmake", "bin"), PATH_SEP) + + "%s%s" % (os.path.join(OHOS_NDK_HOME, "build-tools", "llvm", "bin"), PATH_SEP) + + lastPath ) OPT = "--unoptimized --no-lto " if buildInfo.buildType == "debug" else "" @@ -174,7 +173,7 @@ def engineConfig(buildInfo, extraParam=""): + extraParam.replace("\\", ""), checkCode=False, timeout=600, - ) + ) # 执行engine编译操作 @@ -219,7 +218,7 @@ def harBuild(buildInfo): fileDest = safeGetPath( "%s/src/out/%s/ohos/flutter_embedding.har" % (DIR_ROOT, getOutput(buildInfo)), isDirectory=False, - ) + ) shutil.copy(fileSrc, fileDest) logging.info( "Copy result is %s, from %s to %s" -- Gitee From 6b9be7fcd086aa64a5bdf33f75c3f83e02aef965 Mon Sep 17 00:00:00 2001 From: xiaoxiang Date: Tue, 26 Dec 2023 11:33:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlog=E5=86=99=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaoxiang --- attachment/repos/bootstrap/ohos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attachment/repos/bootstrap/ohos.py b/attachment/repos/bootstrap/ohos.py index 03373f1b16..701bd8108f 100644 --- a/attachment/repos/bootstrap/ohos.py +++ b/attachment/repos/bootstrap/ohos.py @@ -135,8 +135,8 @@ def getNdkHome(): ): logging.error( """ - Please set the environment variables for HarmonyOS SDK to "HOS_SDK_HOME" or "OHOS_SDK_HOME". - We will use both native/llvm and native/sysroot. + Please set the environment variables for HarmonyOS NDK to "OHOS_NDK_HOME". + Such as 'export OHOS_NDK_HOME=~/ndk/mac/4.0/native'. Please ensure that the file "native/llvm/bin/clang" exists and is executable.""" ) exit(10) -- Gitee