From 785bc499037d134619812a1b6e2ddf31cb8eacac Mon Sep 17 00:00:00 2001 From: Andrei Yankovich Date: Sat, 2 Nov 2019 00:05:26 +0300 Subject: [PATCH 01/59] Update qtUpdater.py --- BuildBotLib/qtUpdater.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index de94c50..c7525ff 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -172,8 +172,8 @@ def getAndroidConfigOptions(props): list = [ "-xplatform", "android-clang", "--disable-rpath", - # "-android-ndk", "/home/andrei/Android/NDK/android-ndk-r19c", - # "-android-sdk", "/home/andrei/Android/SDK", + "-android-ndk", "/home/andrei/Android/NDK/android-ndk-r19c", + "-android-sdk", "/home/andrei/Android/SDK", "-skip", "qttranslations", "-skip", "qtserialport", "-no-warnings-are-errors", From 5607df30aba17bb832df1c69c04ed488496bdd21 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:09:43 +0300 Subject: [PATCH 02/59] added module for installer assets --- .gitignore | 3 ++ BuildBotLib/BuildBot.pyproject | 4 +- BuildBotLib/asssetsinstaller.py | 76 +++++++++++++++++++++++++++++++++ BuildBotLib/buildBotWorkers.py | 3 +- master.cfg | 1 + 5 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 BuildBotLib/asssetsinstaller.py diff --git a/.gitignore b/.gitignore index 6bb50a5..854715a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ gitpoller-workdir/ *.user *__pycache__* *.pyc + +*.pyproject.user.* +*~ diff --git a/BuildBotLib/BuildBot.pyproject b/BuildBotLib/BuildBot.pyproject index 5ffc9f2..370b36e 100644 --- a/BuildBotLib/BuildBot.pyproject +++ b/BuildBotLib/BuildBot.pyproject @@ -18,7 +18,7 @@ "qtUpdater.py", "secretManager.py", "NPM.py", - "git/gitBin.sh" - + "git/gitBin.sh", + "asssetsinstaller.py" ] } diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py new file mode 100644 index 0000000..8b3fa80 --- /dev/null +++ b/BuildBotLib/asssetsinstaller.py @@ -0,0 +1,76 @@ +# This Python file uses the following encoding: utf-8 + +import BuildBotLib.basemodule as base +from buildbot.plugins import util, steps +import os +import shutil + + +@util.renderer +def NDKDownloadCMD(props): + link = props.getProperty("revision") + module = props.getProperty("module") + + shutil.rmtree(module) + + res = [] + format = link[link.rfind('.'):] + + if module == "AndroidNDK": + res = ["curl", link, "--output", "temp." + format] + return res + + +@util.renderer +def ExtractCMD(props): + + arr = os.listdir() + format = "" + module = props.getProperty("module") + + for file in arr: + ix = file.find("temp.") + if ix == 0: + format = file[file.rfind('.'):] + + res = [] + + if format == "zip": + res = ["unsip", "-d", module] + return res + + +def getFactory(): + factory = base.getFactory(); + + factory.addStep( + steps.ShellCommand( + command = NDKDownloadCMD, + name = 'download new item', + description = 'download new item', + ) + ); + + factory.addStep( + steps.ShellCommand( + command = ExtractCMD, + name = 'extract new item', + description = 'extract new item', + ) + ); + + return factory + + +def getRepo(): + return ""; + + +def getPropertyes(): + return [ + util.ChoiceStringParameter( + name = 'module', + choices=["AndroidNDK", "AndroidSDK"], + default = "AndroidNDK" + ), + ] diff --git a/BuildBotLib/buildBotWorkers.py b/BuildBotLib/buildBotWorkers.py index e6ddbe7..ebc7ec1 100644 --- a/BuildBotLib/buildBotWorkers.py +++ b/BuildBotLib/buildBotWorkers.py @@ -16,7 +16,8 @@ class buildBotWorkers(BuildBotModule): worker.Worker("github-worker", "pass"), worker.Worker("Tester", "pass"), worker.Worker("qtBuilder", "pass"), - worker.Worker("NPM", "pass") + worker.Worker("NPM", "pass"), + worker.Worker("AssetsInstaller", "pass") ] diff --git a/master.cfg b/master.cfg index 1ba0274..b94c14a 100644 --- a/master.cfg +++ b/master.cfg @@ -17,6 +17,7 @@ bot.addBuilder("github-worker", "qmake"); bot.addBuilder("Tester", "qmake"); bot.addBuilder("qtBuilder", "qtUpdater"); bot.addBuilder("NPM", "NPM"); +bot.addBuilder("AssetsInstaller", "asssetsinstaller"); c = BuildmasterConfig = bot.getMaster() From 10cb5727740888bded9e281ea2b573006e85b8fc Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:15:04 +0300 Subject: [PATCH 03/59] added assetsBuilder --- BuildBotLib/buildBotWorkers.py | 2 +- master.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/buildBotWorkers.py b/BuildBotLib/buildBotWorkers.py index ebc7ec1..24f8684 100644 --- a/BuildBotLib/buildBotWorkers.py +++ b/BuildBotLib/buildBotWorkers.py @@ -17,7 +17,7 @@ class buildBotWorkers(BuildBotModule): worker.Worker("Tester", "pass"), worker.Worker("qtBuilder", "pass"), worker.Worker("NPM", "pass"), - worker.Worker("AssetsInstaller", "pass") + worker.Worker("assets-builder", "pass") ] diff --git a/master.cfg b/master.cfg index b94c14a..6f1ae22 100644 --- a/master.cfg +++ b/master.cfg @@ -17,7 +17,7 @@ bot.addBuilder("github-worker", "qmake"); bot.addBuilder("Tester", "qmake"); bot.addBuilder("qtBuilder", "qtUpdater"); bot.addBuilder("NPM", "NPM"); -bot.addBuilder("AssetsInstaller", "asssetsinstaller"); +bot.addBuilder("assets-builder", "asssetsinstaller"); c = BuildmasterConfig = bot.getMaster() From 328cf4f45c1c3e218dc2b91f2da9a206ca673fd6 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:32:18 +0300 Subject: [PATCH 04/59] fix remove tree --- BuildBotLib/asssetsinstaller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 8b3fa80..e4ab70f 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -11,7 +11,8 @@ def NDKDownloadCMD(props): link = props.getProperty("revision") module = props.getProperty("module") - shutil.rmtree(module) + if os.path.isfile(module): + shutil.rmtree(module) res = [] format = link[link.rfind('.'):] From a6ccc2b8017bdaf95726b0e8d0b39de4f1c74518 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:37:22 +0300 Subject: [PATCH 05/59] fix remove old files --- BuildBotLib/asssetsinstaller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index e4ab70f..7927e20 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -18,7 +18,9 @@ def NDKDownloadCMD(props): format = link[link.rfind('.'):] if module == "AndroidNDK": + os.remove("temp." + format) res = ["curl", link, "--output", "temp." + format] + return res From 2fb65ac2b7a97598b11a31835e62cdf7db796ac3 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:39:15 +0300 Subject: [PATCH 06/59] added warning --- BuildBotLib/asssetsinstaller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 7927e20..20d6fd5 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -36,10 +36,11 @@ def ExtractCMD(props): if ix == 0: format = file[file.rfind('.'):] - res = [] + res = ["echo", "format '" + format + "' not supported"] if format == "zip": res = ["unsip", "-d", module] + return res From 5405dacb1266a99271eaea1d48db2df09f750555 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:42:47 +0300 Subject: [PATCH 07/59] fix --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 20d6fd5..0fbcc15 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -18,8 +18,8 @@ def NDKDownloadCMD(props): format = link[link.rfind('.'):] if module == "AndroidNDK": - os.remove("temp." + format) - res = ["curl", link, "--output", "temp." + format] + os.remove("temp" + format) + res = ["curl", link, "--output", "temp" + format] return res From 323b90952bbb6d1712d3f3d0f9078d60d8e6da38 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:44:16 +0300 Subject: [PATCH 08/59] added check of file --- BuildBotLib/asssetsinstaller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 0fbcc15..7c20436 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -18,7 +18,8 @@ def NDKDownloadCMD(props): format = link[link.rfind('.'):] if module == "AndroidNDK": - os.remove("temp" + format) + if os.path.isfile(module): + os.remove("temp" + format) res = ["curl", link, "--output", "temp" + format] return res From 24ad9c810d774a7ba572f84a3db6f0ba32925924 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 16:48:52 +0300 Subject: [PATCH 09/59] fix O --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 7c20436..3a637fe 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -28,7 +28,7 @@ def NDKDownloadCMD(props): @util.renderer def ExtractCMD(props): - arr = os.listdir() + arr = os.listdir("./") format = "" module = props.getProperty("module") @@ -39,7 +39,7 @@ def ExtractCMD(props): res = ["echo", "format '" + format + "' not supported"] - if format == "zip": + if format == ".zip": res = ["unsip", "-d", module] return res From 9b547b4860227105f97e1d4201dbf47930f10b84 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 17:00:59 +0300 Subject: [PATCH 10/59] fix --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 3a637fe..8b8733a 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -15,7 +15,7 @@ def NDKDownloadCMD(props): shutil.rmtree(module) res = [] - format = link[link.rfind('.'):] + format = link[link.rfind('.'):].lower() if module == "AndroidNDK": if os.path.isfile(module): From d61e2d65ede00faffb4065bfa93e96e9929559b3 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 17:05:49 +0300 Subject: [PATCH 11/59] fix format --- BuildBotLib/asssetsinstaller.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 8b8733a..3b79275 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -5,6 +5,8 @@ from buildbot.plugins import util, steps import os import shutil +LAST_FORMAT = [""] + @util.renderer def NDKDownloadCMD(props): @@ -16,6 +18,7 @@ def NDKDownloadCMD(props): res = [] format = link[link.rfind('.'):].lower() + LAST_FORMAT[0] = format if module == "AndroidNDK": if os.path.isfile(module): @@ -28,15 +31,9 @@ def NDKDownloadCMD(props): @util.renderer def ExtractCMD(props): - arr = os.listdir("./") - format = "" + format = LAST_FORMAT[0] module = props.getProperty("module") - for file in arr: - ix = file.find("temp.") - if ix == 0: - format = file[file.rfind('.'):] - res = ["echo", "format '" + format + "' not supported"] if format == ".zip": From 497f2a315c87404883f52c51548508e3659b7abf Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 17:09:58 +0300 Subject: [PATCH 12/59] fix unzip command --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 3b79275..69a11b8 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -37,7 +37,7 @@ def ExtractCMD(props): res = ["echo", "format '" + format + "' not supported"] if format == ".zip": - res = ["unsip", "-d", module] + res = ["unzip", "-d", module] return res From c2e3fa2344a71d923e91a9dfe713b115cd7d6963 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 17:15:39 +0300 Subject: [PATCH 13/59] fix --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 69a11b8..3287d7c 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -37,7 +37,7 @@ def ExtractCMD(props): res = ["echo", "format '" + format + "' not supported"] if format == ".zip": - res = ["unzip", "-d", module] + res = ["unzip", "temp" + format, "-d", module] return res From 654bbd511064b6cf08c50c111f2d56c79d125cce Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 17:46:43 +0300 Subject: [PATCH 14/59] fix for create links --- BuildBotLib/asssetsinstaller.py | 41 +++++++++++++++++++++------------ BuildBotLib/basemodule.py | 21 ++++++++++++++--- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 3287d7c..d4c264c 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -4,13 +4,14 @@ import BuildBotLib.basemodule as base from buildbot.plugins import util, steps import os import shutil +import subprocess LAST_FORMAT = [""] @util.renderer def NDKDownloadCMD(props): - link = props.getProperty("revision") + link = props.getProperty("link") module = props.getProperty("module") if os.path.isfile(module): @@ -39,40 +40,50 @@ def ExtractCMD(props): if format == ".zip": res = ["unzip", "temp" + format, "-d", module] + all_subdirs = base.allSubdirsOf(module) + latest_subdir = max(all_subdirs, key=os.path.getmtime) + subprocess.getoutput(["ln -sf " + latest_subdir + " current"]) + return res def getFactory(): - factory = base.getFactory(); + factory = base.getFactory() factory.addStep( - steps.ShellCommand( - command = NDKDownloadCMD, - name = 'download new item', - description = 'download new item', + steps.ShellCommand( + command=NDKDownloadCMD, + name='download new item', + description='download new item', ) - ); + ) factory.addStep( - steps.ShellCommand( - command = ExtractCMD, - name = 'extract new item', - description = 'extract new item', + steps.ShellCommand( + command=ExtractCMD, + name='extract new item', + description='extract new item', ) - ); + ) return factory def getRepo(): - return ""; + return "" def getPropertyes(): return [ util.ChoiceStringParameter( - name = 'module', + name='module', choices=["AndroidNDK", "AndroidSDK"], - default = "AndroidNDK" + default="AndroidNDK" + ), + + util.StringParameter( + name='link', + label="url to download item", + default="" ), ] diff --git a/BuildBotLib/basemodule.py b/BuildBotLib/basemodule.py index 5465676..d3a8f45 100644 --- a/BuildBotLib/basemodule.py +++ b/BuildBotLib/basemodule.py @@ -1,18 +1,22 @@ -import sys +import os from buildbot.plugins import util import multiprocessing import glob import shutil + def getFactory(): return util.BuildFactory() + def getRepo(): - return ""; + return "" + def getPropertyes(): return [] + @util.renderer def makeCommand(props): command = ['make'] @@ -24,6 +28,7 @@ def makeCommand(props): command.extend(['-j', '1']) return command + def copyRegExp(source, dist): res = [] @@ -32,4 +37,14 @@ def copyRegExp(source, dist): res.append(file) shutil.copy(file, dist) - return res; + return res + + +def allSubdirsOf(b='.'): + result = [] + for d in os.listdir(b): + bd = os.path.join(b, d) + if os.path.isdir(bd): + result.append(bd) + + return result From b39ce6fafa9cef4c8baac0521a48202d58d009fc Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 17:53:24 +0300 Subject: [PATCH 15/59] fix --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index d4c264c..b109946 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -40,9 +40,9 @@ def ExtractCMD(props): if format == ".zip": res = ["unzip", "temp" + format, "-d", module] - all_subdirs = base.allSubdirsOf(module) + all_subdirs = base.allSubdirsOf("./" + module) latest_subdir = max(all_subdirs, key=os.path.getmtime) - subprocess.getoutput(["ln -sf " + latest_subdir + " current"]) + subprocess.getoutput(["ln -sf " + latest_subdir + " ./current"]) return res From 11451454a41e5e85ec9ed6d0fe16a94e49302d0e Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Fri, 13 Dec 2019 18:08:57 +0300 Subject: [PATCH 16/59] fix --- BuildBotLib/asssetsinstaller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index b109946..83f2567 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -40,9 +40,9 @@ def ExtractCMD(props): if format == ".zip": res = ["unzip", "temp" + format, "-d", module] - all_subdirs = base.allSubdirsOf("./" + module) - latest_subdir = max(all_subdirs, key=os.path.getmtime) - subprocess.getoutput(["ln -sf " + latest_subdir + " ./current"]) + all_subdirs = base.allSubdirsOf("./" + module) + latest_subdir = max(all_subdirs, key=os.path.getmtime) + subprocess.getoutput(["ln -sf " + latest_subdir + " ./current"]) return res From deb7098cb8e89c96cc7c0f2319b0e99a11807a49 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 14:49:30 +0300 Subject: [PATCH 17/59] fix build Assets --- BuildBotLib/asssetsinstaller.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 83f2567..18cf0eb 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -40,9 +40,12 @@ def ExtractCMD(props): if format == ".zip": res = ["unzip", "temp" + format, "-d", module] - all_subdirs = base.allSubdirsOf("./" + module) + dirpath = props.getProperty("builddir") + + all_subdirs = base.allSubdirsOf(dirpath + "/" + module) latest_subdir = max(all_subdirs, key=os.path.getmtime) - subprocess.getoutput(["ln -sf " + latest_subdir + " ./current"]) + subprocess.getoutput(["ln -sf " + latest_subdir + " " + + dirpath + "/current"]) return res From fc5b76aa17a7df1f580f331f523e0216a583821f Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:11:58 +0300 Subject: [PATCH 18/59] fix --- BuildBotLib/asssetsinstaller.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 18cf0eb..b3e46fd 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -40,6 +40,18 @@ def ExtractCMD(props): if format == ".zip": res = ["unzip", "temp" + format, "-d", module] + return res + + +@util.renderer +def ConfigureCMD(props): + + format = LAST_FORMAT[0] + module = props.getProperty("module") + + res = ["echo", "Configure " + module + " failed"] + + if format == ".zip": dirpath = props.getProperty("builddir") all_subdirs = base.allSubdirsOf(dirpath + "/" + module) @@ -47,6 +59,8 @@ def ExtractCMD(props): subprocess.getoutput(["ln -sf " + latest_subdir + " " + dirpath + "/current"]) + res = ["echo", "Configure " + module] + return res @@ -69,6 +83,14 @@ def getFactory(): ) ) + factory.addStep( + steps.ShellCommand( + command=ConfigureCMD, + name='configure new item', + description='configure new item', + ) + ) + return factory From e56a880e82963f5c41c48e0f60bf0cfc129d2ad6 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:16:55 +0300 Subject: [PATCH 19/59] fix pathes --- BuildBotLib/asssetsinstaller.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index b3e46fd..cb9aa36 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -13,17 +13,18 @@ LAST_FORMAT = [""] def NDKDownloadCMD(props): link = props.getProperty("link") module = props.getProperty("module") + dirpath = props.getProperty("builddir") - if os.path.isfile(module): - shutil.rmtree(module) + if os.path.isfile(dirpath + "/" + module): + shutil.rmtree(dirpath + "/" + module) res = [] format = link[link.rfind('.'):].lower() LAST_FORMAT[0] = format if module == "AndroidNDK": - if os.path.isfile(module): - os.remove("temp" + format) + if os.path.isfile(dirpath + "/temp" + format): + os.remove(dirpath + "/temp" + format) res = ["curl", link, "--output", "temp" + format] return res From 66600a70daf399b0258d30b8bc74bf39cdc96f98 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:24:18 +0300 Subject: [PATCH 20/59] fix --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index cb9aa36..2b36b82 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -15,7 +15,7 @@ def NDKDownloadCMD(props): module = props.getProperty("module") dirpath = props.getProperty("builddir") - if os.path.isfile(dirpath + "/" + module): + if os.path.isdir(dirpath + "/" + module): shutil.rmtree(dirpath + "/" + module) res = [] From fe31a866fe67fb153d843d4e9c6465330d9279f2 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:36:39 +0300 Subject: [PATCH 21/59] fix O --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 2b36b82..3b8d388 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -15,7 +15,7 @@ def NDKDownloadCMD(props): module = props.getProperty("module") dirpath = props.getProperty("builddir") - if os.path.isdir(dirpath + "/" + module): + if os.path.exists(dirpath + "/" + module): shutil.rmtree(dirpath + "/" + module) res = [] @@ -23,7 +23,7 @@ def NDKDownloadCMD(props): LAST_FORMAT[0] = format if module == "AndroidNDK": - if os.path.isfile(dirpath + "/temp" + format): + if os.path.exists(dirpath + "/temp" + format): os.remove(dirpath + "/temp" + format) res = ["curl", link, "--output", "temp" + format] From 5246df9695a24dbd7181e46e7c75fdb2edf31513 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:40:53 +0300 Subject: [PATCH 22/59] git --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 3b8d388..a1749bd 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -16,7 +16,7 @@ def NDKDownloadCMD(props): dirpath = props.getProperty("builddir") if os.path.exists(dirpath + "/" + module): - shutil.rmtree(dirpath + "/" + module) + shutil.rmtree(dirpath + "/" + module, ignore_errors=True) res = [] format = link[link.rfind('.'):].lower() From 2dd9dfda36d29ad488efd0d895be3b520d0f837b Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:48:24 +0300 Subject: [PATCH 23/59] fix --- BuildBotLib/asssetsinstaller.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index a1749bd..6ffca28 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -10,21 +10,28 @@ LAST_FORMAT = [""] @util.renderer -def NDKDownloadCMD(props): - link = props.getProperty("link") +def RemoveOldData(props): module = props.getProperty("module") dirpath = props.getProperty("builddir") + res = [dirpath + "/" + module + " not exits"] + if os.path.exists(dirpath + "/" + module): - shutil.rmtree(dirpath + "/" + module, ignore_errors=True) + res = ["rm", "-rdf", dirpath + "/" + module] + + return res + + +@util.renderer +def NDKDownloadCMD(props): + link = props.getProperty("link") + module = props.getProperty("module") res = [] format = link[link.rfind('.'):].lower() LAST_FORMAT[0] = format if module == "AndroidNDK": - if os.path.exists(dirpath + "/temp" + format): - os.remove(dirpath + "/temp" + format) res = ["curl", link, "--output", "temp" + format] return res @@ -68,6 +75,14 @@ def ConfigureCMD(props): def getFactory(): factory = base.getFactory() + factory.addStep( + steps.ShellCommand( + command=RemoveOldData, + name='rm old item', + description='rm old', + ) + ) + factory.addStep( steps.ShellCommand( command=NDKDownloadCMD, From b1dc9cd1090f48f37b64ef3447913c9cad7f89ca Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 15:54:35 +0300 Subject: [PATCH 24/59] fix --- BuildBotLib/asssetsinstaller.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 6ffca28..a070c2b 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -3,7 +3,6 @@ import BuildBotLib.basemodule as base from buildbot.plugins import util, steps import os -import shutil import subprocess LAST_FORMAT = [""] @@ -12,7 +11,7 @@ LAST_FORMAT = [""] @util.renderer def RemoveOldData(props): module = props.getProperty("module") - dirpath = props.getProperty("builddir") + dirpath = props.getProperty("builddir") + "/build" res = [dirpath + "/" + module + " not exits"] @@ -60,7 +59,7 @@ def ConfigureCMD(props): res = ["echo", "Configure " + module + " failed"] if format == ".zip": - dirpath = props.getProperty("builddir") + dirpath = props.getProperty("builddir") + "/build" all_subdirs = base.allSubdirsOf(dirpath + "/" + module) latest_subdir = max(all_subdirs, key=os.path.getmtime) @@ -80,6 +79,7 @@ def getFactory(): command=RemoveOldData, name='rm old item', description='rm old', + haltOnFailure=True, ) ) @@ -88,6 +88,7 @@ def getFactory(): command=NDKDownloadCMD, name='download new item', description='download new item', + haltOnFailure=True, ) ) @@ -96,6 +97,7 @@ def getFactory(): command=ExtractCMD, name='extract new item', description='extract new item', + haltOnFailure=True, ) ) @@ -104,6 +106,7 @@ def getFactory(): command=ConfigureCMD, name='configure new item', description='configure new item', + haltOnFailure=True, ) ) From f174120f473969c63bb10ac79f93902fdc402b79 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 16:00:22 +0300 Subject: [PATCH 25/59] fix --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index a070c2b..e5ba97c 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -13,7 +13,7 @@ def RemoveOldData(props): module = props.getProperty("module") dirpath = props.getProperty("builddir") + "/build" - res = [dirpath + "/" + module + " not exits"] + res = ["echo", dirpath + "/" + module + " not exits"] if os.path.exists(dirpath + "/" + module): res = ["rm", "-rdf", dirpath + "/" + module] From a7c4179676918fdaf1608965c3de3b9d050a099c Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 16:07:55 +0300 Subject: [PATCH 26/59] fix --- BuildBotLib/asssetsinstaller.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index e5ba97c..a8baedf 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -59,14 +59,11 @@ def ConfigureCMD(props): res = ["echo", "Configure " + module + " failed"] if format == ".zip": - dirpath = props.getProperty("builddir") + "/build" + dirpath = props.getProperty("builddir") + "/build/" + module - all_subdirs = base.allSubdirsOf(dirpath + "/" + module) + all_subdirs = base.allSubdirsOf(dirpath) latest_subdir = max(all_subdirs, key=os.path.getmtime) - subprocess.getoutput(["ln -sf " + latest_subdir + " " + - dirpath + "/current"]) - - res = ["echo", "Configure " + module] + res = ["mv", latest_subdir, dirpath + "/current"] return res From 7441a38f45e090338fc7781196fcd91204266af8 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 16:14:32 +0300 Subject: [PATCH 27/59] fix --- BuildBotLib/qtUpdater.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index c7525ff..107a521 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -172,12 +172,11 @@ def getAndroidConfigOptions(props): list = [ "-xplatform", "android-clang", "--disable-rpath", - "-android-ndk", "/home/andrei/Android/NDK/android-ndk-r19c", + "-android-ndk", "/home/andrei/worker/Assets/assets-builder/build/AndroidNDK/current", "-android-sdk", "/home/andrei/Android/SDK", "-skip", "qttranslations", "-skip", "qtserialport", - "-no-warnings-are-errors", - "-android-arch","arm64-v8a" + "-no-warnings-are-errors" ]; list += getGeneralConfigureOptions(props); From 727d86e32b5d8f500811c6aaf8c5d74bb73823e7 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 18:42:18 +0300 Subject: [PATCH 28/59] added base support of sdk manager tool --- BuildBotLib/asssetsinstaller.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index a8baedf..dfdb238 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -3,7 +3,6 @@ import BuildBotLib.basemodule as base from buildbot.plugins import util, steps import os -import subprocess LAST_FORMAT = [""] @@ -24,14 +23,12 @@ def RemoveOldData(props): @util.renderer def NDKDownloadCMD(props): link = props.getProperty("link") - module = props.getProperty("module") res = [] format = link[link.rfind('.'):].lower() LAST_FORMAT[0] = format - if module == "AndroidNDK": - res = ["curl", link, "--output", "temp" + format] + res = ["curl", link, "--output", "temp" + format] return res From abc4512e3bfee59a03a3982c36c2f58ecdd895dc Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Mon, 16 Dec 2019 18:54:30 +0300 Subject: [PATCH 29/59] fix #sdk android --- BuildBotLib/qtUpdater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index 107a521..625f822 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -173,7 +173,7 @@ def getAndroidConfigOptions(props): "-xplatform", "android-clang", "--disable-rpath", "-android-ndk", "/home/andrei/worker/Assets/assets-builder/build/AndroidNDK/current", - "-android-sdk", "/home/andrei/Android/SDK", + "-android-sdk", "/worker/Assets/assets-builder/build/AndroidSDK", "-skip", "qttranslations", "-skip", "qtserialport", "-no-warnings-are-errors" From b952eb22da622f89dd1e75481d5665f7ef6624a4 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 10:37:56 +0300 Subject: [PATCH 30/59] fix assets --- BuildBotLib/asssetsinstaller.py | 69 ++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index dfdb238..660d16e 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -6,16 +6,20 @@ import os LAST_FORMAT = [""] +AndroidBaseDir = "~/Android" + + +def isInit(step): + return step.getProperty('module') == 'init' + @util.renderer def RemoveOldData(props): - module = props.getProperty("module") - dirpath = props.getProperty("builddir") + "/build" - res = ["echo", dirpath + "/" + module + " not exits"] + res = ['echo', 'is first init run'] - if os.path.exists(dirpath + "/" + module): - res = ["rm", "-rdf", dirpath + "/" + module] + if os.path.exists(AndroidBaseDir): + res = ["rm", "-rdf", AndroidBaseDir] return res @@ -28,7 +32,7 @@ def NDKDownloadCMD(props): format = link[link.rfind('.'):].lower() LAST_FORMAT[0] = format - res = ["curl", link, "--output", "temp" + format] + res = ["curl", link, "--output", AndroidBaseDir + "/temp" + format] return res @@ -37,12 +41,11 @@ def NDKDownloadCMD(props): def ExtractCMD(props): format = LAST_FORMAT[0] - module = props.getProperty("module") res = ["echo", "format '" + format + "' not supported"] if format == ".zip": - res = ["unzip", "temp" + format, "-d", module] + res = ["unzip", "temp" + format, "-d", AndroidBaseDir] return res @@ -50,17 +53,34 @@ def ExtractCMD(props): @util.renderer def ConfigureCMD(props): - format = LAST_FORMAT[0] module = props.getProperty("module") + version = props.getProperty("version") - res = ["echo", "Configure " + module + " failed"] + res = ["sdkmanager"] + + unit_to_multiplier = { + 'SDK': ["platforms;android-"+version], + 'NDK': ["ndk-bundle"], + 'buildTools': ["platform-tools;tools;build-tools"+version] + } + + return res + unit_to_multiplier[module] + + +@util.renderer +def InstallCMD(props): + + format = LAST_FORMAT[0] + + res = ["echo", "Configure failed"] if format == ".zip": - dirpath = props.getProperty("builddir") + "/build/" + module - all_subdirs = base.allSubdirsOf(dirpath) + all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) - res = ["mv", latest_subdir, dirpath + "/current"] + res = ["mv", latest_subdir, AndroidBaseDir + "/tools", ";", + "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", + "~/.local/bin/sdkmanager"] return res @@ -72,6 +92,7 @@ def getFactory(): steps.ShellCommand( command=RemoveOldData, name='rm old item', + doStepIf=isInit, description='rm old', haltOnFailure=True, ) @@ -81,6 +102,7 @@ def getFactory(): steps.ShellCommand( command=NDKDownloadCMD, name='download new item', + doStepIf=isInit, description='download new item', haltOnFailure=True, ) @@ -90,6 +112,7 @@ def getFactory(): steps.ShellCommand( command=ExtractCMD, name='extract new item', + doStepIf=isInit, description='extract new item', haltOnFailure=True, ) @@ -99,6 +122,17 @@ def getFactory(): steps.ShellCommand( command=ConfigureCMD, name='configure new item', + doStepIf=isInit, + description='configure new item', + haltOnFailure=True, + ) + ) + + factory.addStep( + steps.ShellCommand( + command=InstallCMD, + name='install module', + doStepIf=lambda step: not isInit(step), description='configure new item', haltOnFailure=True, ) @@ -115,8 +149,8 @@ def getPropertyes(): return [ util.ChoiceStringParameter( name='module', - choices=["AndroidNDK", "AndroidSDK"], - default="AndroidNDK" + choices=["init", "SDK", "NDK", "buildTools"], + default="init" ), util.StringParameter( @@ -124,4 +158,9 @@ def getPropertyes(): label="url to download item", default="" ), + util.StringParameter( + name='version', + label="Version", + default="" + ), ] From 1b75db6ef183b75e89728025110fb494dcbef055 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 11:24:32 +0300 Subject: [PATCH 31/59] fix pathes --- BuildBotLib/asssetsinstaller.py | 5 +++-- BuildBotLib/qtUpdater.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 660d16e..9aa0854 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -16,10 +16,11 @@ def isInit(step): @util.renderer def RemoveOldData(props): - res = ['echo', 'is first init run'] + res = ["mkdir", "-p", AndroidBaseDir] if os.path.exists(AndroidBaseDir): - res = ["rm", "-rdf", AndroidBaseDir] + res = ["rm", "-rdf", AndroidBaseDir, ";", + "mkdir", "-p", AndroidBaseDir] return res diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index 625f822..ae6d805 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -172,8 +172,8 @@ def getAndroidConfigOptions(props): list = [ "-xplatform", "android-clang", "--disable-rpath", - "-android-ndk", "/home/andrei/worker/Assets/assets-builder/build/AndroidNDK/current", - "-android-sdk", "/worker/Assets/assets-builder/build/AndroidSDK", + "-android-ndk", "~/Android/NDK", + "-android-sdk", "~/Android", "-skip", "qttranslations", "-skip", "qtserialport", "-no-warnings-are-errors" From 4d1ad52ac4e1a5ed14bc33f482d8e8284e384a9d Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:24:48 +0300 Subject: [PATCH 32/59] fix home path see https://github.com/buildbot/buildbot/issues/5111 --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 9aa0854..3c8e745 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -6,7 +6,7 @@ import os LAST_FORMAT = [""] -AndroidBaseDir = "~/Android" +AndroidBaseDir = os.path.expanduserpath + "/Android" def isInit(step): @@ -81,7 +81,7 @@ def InstallCMD(props): latest_subdir = max(all_subdirs, key=os.path.getmtime) res = ["mv", latest_subdir, AndroidBaseDir + "/tools", ";", "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", - "~/.local/bin/sdkmanager"] + os.path.expanduserpath + "/.local/bin/sdkmanager"] return res From bb8f9c963a71687ccf172a85a46e2ab65fb8f9e6 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:28:01 +0300 Subject: [PATCH 33/59] fix --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 3c8e745..80baf54 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -6,7 +6,7 @@ import os LAST_FORMAT = [""] -AndroidBaseDir = os.path.expanduserpath + "/Android" +AndroidBaseDir = os.path.expanduserpath() + "/Android" def isInit(step): @@ -81,7 +81,7 @@ def InstallCMD(props): latest_subdir = max(all_subdirs, key=os.path.getmtime) res = ["mv", latest_subdir, AndroidBaseDir + "/tools", ";", "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", - os.path.expanduserpath + "/.local/bin/sdkmanager"] + os.path.expanduserpath() + "/.local/bin/sdkmanager"] return res From 8a0cacee263274efa9c16513c01a2e24f545b9ba Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:31:34 +0300 Subject: [PATCH 34/59] fix os pathes --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 80baf54..4b24bca 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -6,7 +6,7 @@ import os LAST_FORMAT = [""] -AndroidBaseDir = os.path.expanduserpath() + "/Android" +AndroidBaseDir = os.path.expanduserpath("~/Android") def isInit(step): @@ -81,7 +81,7 @@ def InstallCMD(props): latest_subdir = max(all_subdirs, key=os.path.getmtime) res = ["mv", latest_subdir, AndroidBaseDir + "/tools", ";", "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", - os.path.expanduserpath() + "/.local/bin/sdkmanager"] + os.path.expanduserpath("/.local/bin/sdkmanager")] return res From f65e9f639a0e3d8ea82498d1ba856a2b9348fff1 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:35:28 +0300 Subject: [PATCH 35/59] fix user path --- BuildBotLib/asssetsinstaller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 4b24bca..6e708e1 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -3,10 +3,11 @@ import BuildBotLib.basemodule as base from buildbot.plugins import util, steps import os +from pathlib import Path LAST_FORMAT = [""] -AndroidBaseDir = os.path.expanduserpath("~/Android") +AndroidBaseDir = str(Path.home()) + "/Android" def isInit(step): @@ -81,7 +82,7 @@ def InstallCMD(props): latest_subdir = max(all_subdirs, key=os.path.getmtime) res = ["mv", latest_subdir, AndroidBaseDir + "/tools", ";", "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", - os.path.expanduserpath("/.local/bin/sdkmanager")] + str(Path.home()) + "/.local/bin/sdkmanager"] return res From 08fbf3edcd379788e27c73f95675d3571094da3b Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:38:10 +0300 Subject: [PATCH 36/59] fix extract zip file --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 6e708e1..ef3fad4 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -47,7 +47,7 @@ def ExtractCMD(props): res = ["echo", "format '" + format + "' not supported"] if format == ".zip": - res = ["unzip", "temp" + format, "-d", AndroidBaseDir] + res = ["unzip", AndroidBaseDir "/temp" + format, "-d", AndroidBaseDir] return res From 81ea264ec6e26d1d4bb8c5e3b5af793c17529b01 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:39:35 +0300 Subject: [PATCH 37/59] fix sytaxs errors --- BuildBotLib/asssetsinstaller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index ef3fad4..28a984c 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -47,7 +47,8 @@ def ExtractCMD(props): res = ["echo", "format '" + format + "' not supported"] if format == ".zip": - res = ["unzip", AndroidBaseDir "/temp" + format, "-d", AndroidBaseDir] + res = ["unzip", AndroidBaseDir + "/temp" + format, + "-d", AndroidBaseDir] return res From 2beb4a424c8ea4fc27c23a903ffb18a62465fd48 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:44:16 +0300 Subject: [PATCH 38/59] fix bash error --- BuildBotLib/asssetsinstaller.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 28a984c..90f91d4 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -20,8 +20,8 @@ def RemoveOldData(props): res = ["mkdir", "-p", AndroidBaseDir] if os.path.exists(AndroidBaseDir): - res = ["rm", "-rdf", AndroidBaseDir, ";", - "mkdir", "-p", AndroidBaseDir] + res = ["rm", "-rdf", AndroidBaseDir, + ";mkdir", "-p", AndroidBaseDir] return res @@ -81,8 +81,8 @@ def InstallCMD(props): all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) - res = ["mv", latest_subdir, AndroidBaseDir + "/tools", ";", - "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", + res = ["mv", latest_subdir, AndroidBaseDir + "/tools", + ";ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", str(Path.home()) + "/.local/bin/sdkmanager"] return res From b8b780989a8e09fc48c0f196dc1cc7a213d2ee26 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:45:49 +0300 Subject: [PATCH 39/59] rty fix --- BuildBotLib/asssetsinstaller.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 90f91d4..7bd7f2a 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -20,8 +20,8 @@ def RemoveOldData(props): res = ["mkdir", "-p", AndroidBaseDir] if os.path.exists(AndroidBaseDir): - res = ["rm", "-rdf", AndroidBaseDir, - ";mkdir", "-p", AndroidBaseDir] + res = ["rm", "-rdf", AndroidBaseDir, "&", + "mkdir", "-p", AndroidBaseDir] return res @@ -81,8 +81,8 @@ def InstallCMD(props): all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) - res = ["mv", latest_subdir, AndroidBaseDir + "/tools", - ";ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", + res = ["mv", latest_subdir, AndroidBaseDir + "/tools", "&", + "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", str(Path.home()) + "/.local/bin/sdkmanager"] return res From a7a79189d1bcb63aac7c2b88be868006fea526cf Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:52:50 +0300 Subject: [PATCH 40/59] fix --- BuildBotLib/asssetsinstaller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 7bd7f2a..38c49ba 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -20,8 +20,8 @@ def RemoveOldData(props): res = ["mkdir", "-p", AndroidBaseDir] if os.path.exists(AndroidBaseDir): - res = ["rm", "-rdf", AndroidBaseDir, "&", - "mkdir", "-p", AndroidBaseDir] + res = "rm -rdf" + AndroidBaseDir + " & " + res += "mkdir -p", AndroidBaseDir return res @@ -81,9 +81,9 @@ def InstallCMD(props): all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) - res = ["mv", latest_subdir, AndroidBaseDir + "/tools", "&", - "ln", "-sf", AndroidBaseDir + "/tools/bin/sdkmanager", - str(Path.home()) + "/.local/bin/sdkmanager"] + res = "mv " + latest_subdir + " " + AndroidBaseDir + "/tools & " + res += "ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + res += str(Path.home()) + "/.local/bin/sdkmanager" return res From 951bad14c96ca364305f552717af528a3e536e58 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 18:55:10 +0300 Subject: [PATCH 41/59] fix --- BuildBotLib/asssetsinstaller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 38c49ba..5d6e488 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -92,7 +92,7 @@ def getFactory(): factory = base.getFactory() factory.addStep( - steps.ShellCommand( + steps.SubunitShellCommand( command=RemoveOldData, name='rm old item', doStepIf=isInit, @@ -102,7 +102,7 @@ def getFactory(): ) factory.addStep( - steps.ShellCommand( + steps.SubunitShellCommand( command=NDKDownloadCMD, name='download new item', doStepIf=isInit, @@ -112,7 +112,7 @@ def getFactory(): ) factory.addStep( - steps.ShellCommand( + steps.SubunitShellCommand( command=ExtractCMD, name='extract new item', doStepIf=isInit, @@ -122,7 +122,7 @@ def getFactory(): ) factory.addStep( - steps.ShellCommand( + steps.SubunitShellCommand( command=ConfigureCMD, name='configure new item', doStepIf=isInit, @@ -132,7 +132,7 @@ def getFactory(): ) factory.addStep( - steps.ShellCommand( + steps.SubunitShellCommand( command=InstallCMD, name='install module', doStepIf=lambda step: not isInit(step), From 3f432743b17183b4a3de72aecc66ce935758c605 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 17 Dec 2019 19:01:01 +0300 Subject: [PATCH 42/59] fix build --- BuildBotLib/asssetsinstaller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 5d6e488..38c49ba 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -92,7 +92,7 @@ def getFactory(): factory = base.getFactory() factory.addStep( - steps.SubunitShellCommand( + steps.ShellCommand( command=RemoveOldData, name='rm old item', doStepIf=isInit, @@ -102,7 +102,7 @@ def getFactory(): ) factory.addStep( - steps.SubunitShellCommand( + steps.ShellCommand( command=NDKDownloadCMD, name='download new item', doStepIf=isInit, @@ -112,7 +112,7 @@ def getFactory(): ) factory.addStep( - steps.SubunitShellCommand( + steps.ShellCommand( command=ExtractCMD, name='extract new item', doStepIf=isInit, @@ -122,7 +122,7 @@ def getFactory(): ) factory.addStep( - steps.SubunitShellCommand( + steps.ShellCommand( command=ConfigureCMD, name='configure new item', doStepIf=isInit, @@ -132,7 +132,7 @@ def getFactory(): ) factory.addStep( - steps.SubunitShellCommand( + steps.ShellCommand( command=InstallCMD, name='install module', doStepIf=lambda step: not isInit(step), From ff3b6ddd284e4e4fef13fb81d346002b04f11108 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 09:42:47 +0300 Subject: [PATCH 43/59] fix #x --- BuildBotLib/asssetsinstaller.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 38c49ba..4ee308d 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -17,11 +17,11 @@ def isInit(step): @util.renderer def RemoveOldData(props): - res = ["mkdir", "-p", AndroidBaseDir] + res = "mkdir -p " + AndroidBaseDir if os.path.exists(AndroidBaseDir): - res = "rm -rdf" + AndroidBaseDir + " & " - res += "mkdir -p", AndroidBaseDir + res = "rm -rdf" + AndroidBaseDir + res += " & mkdir -p", AndroidBaseDir return res @@ -30,13 +30,10 @@ def RemoveOldData(props): def NDKDownloadCMD(props): link = props.getProperty("link") - res = [] format = link[link.rfind('.'):].lower() LAST_FORMAT[0] = format - res = ["curl", link, "--output", AndroidBaseDir + "/temp" + format] - - return res + return "curl " + link + " --output " + AndroidBaseDir + "/temp" + format @util.renderer @@ -44,11 +41,11 @@ def ExtractCMD(props): format = LAST_FORMAT[0] - res = ["echo", "format '" + format + "' not supported"] + res = "echo format '" + format + "' not supported" if format == ".zip": - res = ["unzip", AndroidBaseDir + "/temp" + format, - "-d", AndroidBaseDir] + res = "unzip " + AndroidBaseDir + "/temp" + format + + " -d " + AndroidBaseDir return res @@ -59,12 +56,12 @@ def ConfigureCMD(props): module = props.getProperty("module") version = props.getProperty("version") - res = ["sdkmanager"] + res = "sdkmanager " unit_to_multiplier = { - 'SDK': ["platforms;android-"+version], - 'NDK': ["ndk-bundle"], - 'buildTools': ["platform-tools;tools;build-tools"+version] + 'SDK': '"platforms;android-'+version+'"', + 'NDK': '"ndk-bundle"', + 'buildTools': '"platform-tools;tools;build-tools'+version+'"' } return res + unit_to_multiplier[module] @@ -75,15 +72,15 @@ def InstallCMD(props): format = LAST_FORMAT[0] - res = ["echo", "Configure failed"] + res = "echo Configure failed" if format == ".zip": all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) - res = "mv " + latest_subdir + " " + AndroidBaseDir + "/tools & " - res += "ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " - res += str(Path.home()) + "/.local/bin/sdkmanager" + res = "mv " + latest_subdir + " " + AndroidBaseDir + "/tools" + + " & ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + + str(Path.home()) + "/.local/bin/sdkmanager" return res From 59f9a6a221a14766c2274059cc05985d07f68b5d Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:02:30 +0300 Subject: [PATCH 44/59] try fix commnad --- BuildBotLib/asssetsinstaller.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 4ee308d..cb37bd7 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -17,11 +17,11 @@ def isInit(step): @util.renderer def RemoveOldData(props): - res = "mkdir -p " + AndroidBaseDir + res = ["/bin/sh", "mkdir -p " + AndroidBaseDir] if os.path.exists(AndroidBaseDir): - res = "rm -rdf" + AndroidBaseDir - res += " & mkdir -p", AndroidBaseDir + res = ["/bin/sh", "rm -rdf" + AndroidBaseDir + + " & mkdir -p " + AndroidBaseDir] return res @@ -33,7 +33,7 @@ def NDKDownloadCMD(props): format = link[link.rfind('.'):].lower() LAST_FORMAT[0] = format - return "curl " + link + " --output " + AndroidBaseDir + "/temp" + format + return ["curl", link, "--output", AndroidBaseDir + "/temp" + format] @util.renderer @@ -41,11 +41,11 @@ def ExtractCMD(props): format = LAST_FORMAT[0] - res = "echo format '" + format + "' not supported" + res = ["echo", "format '" + format + "' not supported"] if format == ".zip": - res = "unzip " + AndroidBaseDir + "/temp" + format - + " -d " + AndroidBaseDir + res = ["unzip", AndroidBaseDir + "/temp" + format, + "-d", AndroidBaseDir] return res @@ -64,7 +64,7 @@ def ConfigureCMD(props): 'buildTools': '"platform-tools;tools;build-tools'+version+'"' } - return res + unit_to_multiplier[module] + return ["/bin/sh", res + unit_to_multiplier[module]] @util.renderer @@ -72,7 +72,7 @@ def InstallCMD(props): format = LAST_FORMAT[0] - res = "echo Configure failed" + res = ["echo", "Configure failed"] if format == ".zip": @@ -82,7 +82,7 @@ def InstallCMD(props): + " & ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + str(Path.home()) + "/.local/bin/sdkmanager" - return res + return ["/bin/sh", res] def getFactory(): From 4159b8243ad18d0246e1103ba143271c32043f68 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:12:49 +0300 Subject: [PATCH 45/59] fix cmd --- BuildBotLib/asssetsinstaller.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index cb37bd7..457f339 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -8,6 +8,7 @@ from pathlib import Path LAST_FORMAT = [""] AndroidBaseDir = str(Path.home()) + "/Android" +MULTIPLE_SH_COMMAND = ["/bin/sh", "-c"] def isInit(step): @@ -17,13 +18,13 @@ def isInit(step): @util.renderer def RemoveOldData(props): - res = ["/bin/sh", "mkdir -p " + AndroidBaseDir] + cmd = "mkdir" + " -p " + AndroidBaseDir if os.path.exists(AndroidBaseDir): - res = ["/bin/sh", "rm -rdf" + AndroidBaseDir - + " & mkdir -p " + AndroidBaseDir] + cmd = "rm -rdf " + AndroidBaseDir + + " & " + cmd - return res + return MULTIPLE_SH_COMMAND + [cmd] @util.renderer @@ -64,7 +65,7 @@ def ConfigureCMD(props): 'buildTools': '"platform-tools;tools;build-tools'+version+'"' } - return ["/bin/sh", res + unit_to_multiplier[module]] + return MULTIPLE_SH_COMMAND + [res + unit_to_multiplier[module]] @util.renderer From b552033dca513109eef7caef3c6d0235dd3e2232 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:17:00 +0300 Subject: [PATCH 46/59] test --- BuildBotLib/asssetsinstaller.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 457f339..892b676 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -18,11 +18,10 @@ def isInit(step): @util.renderer def RemoveOldData(props): - cmd = "mkdir" + " -p " + AndroidBaseDir + cmd = "mkdir -p " + AndroidBaseDir if os.path.exists(AndroidBaseDir): - cmd = "rm -rdf " + AndroidBaseDir - + " & " + cmd + cmd = "rm -rdf " + AndroidBaseDir + " & " + cmd return MULTIPLE_SH_COMMAND + [cmd] From 82c96e808109c598f2dd15345a19326e7389c61e Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:22:56 +0300 Subject: [PATCH 47/59] fix --- BuildBotLib/asssetsinstaller.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 892b676..9e9e34a 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -51,24 +51,22 @@ def ExtractCMD(props): @util.renderer -def ConfigureCMD(props): +def InstallCMD(props): module = props.getProperty("module") version = props.getProperty("version") - res = "sdkmanager " - unit_to_multiplier = { 'SDK': '"platforms;android-'+version+'"', 'NDK': '"ndk-bundle"', 'buildTools': '"platform-tools;tools;build-tools'+version+'"' } - return MULTIPLE_SH_COMMAND + [res + unit_to_multiplier[module]] + return ["sdkmanager", + unit_to_multiplier[module]] @util.renderer -def InstallCMD(props): +def ConfigureCMD(props): format = LAST_FORMAT[0] @@ -82,7 +80,7 @@ def InstallCMD(props): + " & ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + str(Path.home()) + "/.local/bin/sdkmanager" - return ["/bin/sh", res] + return MULTIPLE_SH_COMMAND + [res] def getFactory(): From bbd4dfca9e4794ac0ef42b737bd4f538c9edcfd0 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:27:30 +0300 Subject: [PATCH 48/59] replace sh to bash --- BuildBotLib/asssetsinstaller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 9e9e34a..1e52502 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -8,7 +8,7 @@ from pathlib import Path LAST_FORMAT = [""] AndroidBaseDir = str(Path.home()) + "/Android" -MULTIPLE_SH_COMMAND = ["/bin/sh", "-c"] +MULTIPLE_SH_COMMAND = ["/bin/bash", "-c"] def isInit(step): @@ -21,7 +21,7 @@ def RemoveOldData(props): cmd = "mkdir -p " + AndroidBaseDir if os.path.exists(AndroidBaseDir): - cmd = "rm -rdf " + AndroidBaseDir + " & " + cmd + cmd = "rm -rdf " + AndroidBaseDir + " ; " + cmd return MULTIPLE_SH_COMMAND + [cmd] @@ -77,7 +77,7 @@ def ConfigureCMD(props): all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) res = "mv " + latest_subdir + " " + AndroidBaseDir + "/tools" - + " & ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + + " ; ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + str(Path.home()) + "/.local/bin/sdkmanager" return MULTIPLE_SH_COMMAND + [res] From 350443b61cf3072d9b43686e88102a0a033dc104 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:31:10 +0300 Subject: [PATCH 49/59] fix last step --- BuildBotLib/asssetsinstaller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 1e52502..2f59f13 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -77,8 +77,8 @@ def ConfigureCMD(props): all_subdirs = base.allSubdirsOf(AndroidBaseDir) latest_subdir = max(all_subdirs, key=os.path.getmtime) res = "mv " + latest_subdir + " " + AndroidBaseDir + "/tools" - + " ; ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " - + str(Path.home()) + "/.local/bin/sdkmanager" + res += " ; ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " + res += str(Path.home()) + "/.local/bin/sdkmanager" return MULTIPLE_SH_COMMAND + [res] From 95ae95136b2eae8f9cc8a7ed3b42aee97c06570c Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:33:51 +0300 Subject: [PATCH 50/59] fix install cmd --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 2f59f13..7f73936 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -62,7 +62,7 @@ def InstallCMD(props): 'buildTools': '"platform-tools;tools;build-tools'+version+'"' } - return ["sdkmanager", + unit_to_multiplier[module]] + return ["sdkmanager", unit_to_multiplier[module]] @util.renderer From 05dea0a533c788015e8b1510b9bc2c6238f3f523 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:39:47 +0300 Subject: [PATCH 51/59] added default value of install cmd --- BuildBotLib/asssetsinstaller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 7f73936..7ff2cf8 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -62,7 +62,7 @@ def InstallCMD(props): 'buildTools': '"platform-tools;tools;build-tools'+version+'"' } - return ["sdkmanager", unit_to_multiplier[module]] + return ["sdkmanager", unit_to_multiplier.get(module, "--list")] @util.renderer From e1aa5b810f54859c6519bcbd09f9a434da033a29 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:44:38 +0300 Subject: [PATCH 52/59] fix packages labels --- BuildBotLib/asssetsinstaller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 7ff2cf8..7251d59 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -57,9 +57,9 @@ def InstallCMD(props): version = props.getProperty("version") unit_to_multiplier = { - 'SDK': '"platforms;android-'+version+'"', - 'NDK': '"ndk-bundle"', - 'buildTools': '"platform-tools;tools;build-tools'+version+'"' + 'SDK': 'platforms;android-'+version, + 'NDK': 'ndk-bundle', + 'buildTools': 'platform-tools;tools;build-tools'+version } return ["sdkmanager", unit_to_multiplier.get(module, "--list")] From fca74010c6a4588872addaa4881b07d2bffece7a Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:47:36 +0300 Subject: [PATCH 53/59] fix license of sdk --- BuildBotLib/asssetsinstaller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 7251d59..49677d7 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -79,6 +79,7 @@ def ConfigureCMD(props): res = "mv " + latest_subdir + " " + AndroidBaseDir + "/tools" res += " ; ln -sf " + AndroidBaseDir + "/tools/bin/sdkmanager " res += str(Path.home()) + "/.local/bin/sdkmanager" + res += " ; yes | sdkmanager --licenses" return MULTIPLE_SH_COMMAND + [res] From 53ce61a776cc2ff06531904e406a3fcc3b49f728 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 10:54:01 +0300 Subject: [PATCH 54/59] fix home path of bot --- BuildBotLib/asssetsinstaller.py | 7 +++---- BuildBotLib/qtUpdater.py | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/BuildBotLib/asssetsinstaller.py b/BuildBotLib/asssetsinstaller.py index 49677d7..61a2d98 100644 --- a/BuildBotLib/asssetsinstaller.py +++ b/BuildBotLib/asssetsinstaller.py @@ -57,9 +57,8 @@ def InstallCMD(props): version = props.getProperty("version") unit_to_multiplier = { - 'SDK': 'platforms;android-'+version, - 'NDK': 'ndk-bundle', - 'buildTools': 'platform-tools;tools;build-tools'+version + 'SDK': 'platform-tools;tools;platforms;android-'+version, + 'NDK': 'ndk-bundle' } return ["sdkmanager", unit_to_multiplier.get(module, "--list")] @@ -148,7 +147,7 @@ def getPropertyes(): return [ util.ChoiceStringParameter( name='module', - choices=["init", "SDK", "NDK", "buildTools"], + choices=["init", "SDK", "NDK"], default="init" ), diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index ae6d805..0aa423c 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -76,15 +76,15 @@ def getHelp(props): @util.renderer def lsLinux(props): - return ["ln", "-sf", LAST_TARGET_DIR[0] + "/bin/qmake", "/home/andrei/.local/bin/qmake-linux"]; + return ["ln", "-sf", LAST_TARGET_DIR[0] + "/bin/qmake", str(Path.home()) + "/.local/bin/qmake-linux"]; @util.renderer def lsWindows(props): - return ["ln", "-sf", LAST_TARGET_DIR[0] + "/bin/qmake", "/home/andrei/.local/bin/qmake-windows"]; + return ["ln", "-sf", LAST_TARGET_DIR[0] + "/bin/qmake", str(Path.home()) + "/.local/bin/qmake-windows"]; @util.renderer def lsAndroid(props): - return ["ln", "-sf", LAST_TARGET_DIR[0] + "/bin/qmake", "/home/andrei/.local/bin/qmake-android"]; + return ["ln", "-sf", LAST_TARGET_DIR[0] + "/bin/qmake", str(Path.home()) + "/.local/bin/qmake-android"]; @util.renderer def cpGCCWindows(props): @@ -134,7 +134,7 @@ def getTargetDir(configureOptions, branch, platform): if (not len(platform)) : branch = "Unknown"; - LAST_TARGET_DIR[0] = "/home/andrei/Qt/Qt-" + branch + "/" + platform; + LAST_TARGET_DIR[0] = str(Path.home()) + "/Qt/Qt-" + branch + "/" + platform; return ["-prefix", LAST_TARGET_DIR[0]]; @util.renderer @@ -172,8 +172,8 @@ def getAndroidConfigOptions(props): list = [ "-xplatform", "android-clang", "--disable-rpath", - "-android-ndk", "~/Android/NDK", - "-android-sdk", "~/Android", + "-android-ndk", str(Path.home()) + "/Android/NDK", + "-android-sdk", str(Path.home()) + "/Android", "-skip", "qttranslations", "-skip", "qtserialport", "-no-warnings-are-errors" From 0adea2a6cc40e3e97f7063094881cb4f6df96575 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 11:22:47 +0300 Subject: [PATCH 55/59] fix android host --- BuildBotLib/qtUpdater.py | 1 + 1 file changed, 1 insertion(+) diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index 0aa423c..aa4088b 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -174,6 +174,7 @@ def getAndroidConfigOptions(props): "--disable-rpath", "-android-ndk", str(Path.home()) + "/Android/NDK", "-android-sdk", str(Path.home()) + "/Android", + "-android-ndk-host", "linux-x86_64", "-skip", "qttranslations", "-skip", "qtserialport", "-no-warnings-are-errors" From 187824f431c3fea527878658499352c1f1de3717 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Wed, 18 Dec 2019 11:49:22 +0300 Subject: [PATCH 56/59] fix --- BuildBotLib/qtUpdater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildBotLib/qtUpdater.py b/BuildBotLib/qtUpdater.py index aa4088b..e83183b 100644 --- a/BuildBotLib/qtUpdater.py +++ b/BuildBotLib/qtUpdater.py @@ -172,7 +172,7 @@ def getAndroidConfigOptions(props): list = [ "-xplatform", "android-clang", "--disable-rpath", - "-android-ndk", str(Path.home()) + "/Android/NDK", + "-android-ndk", str(Path.home()) + "/Android/ndk-bundle", "-android-sdk", str(Path.home()) + "/Android", "-android-ndk-host", "linux-x86_64", "-skip", "qttranslations", From 582bf00877c31e4a3227735b334df767032bfecf Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 24 Dec 2019 16:56:31 +0300 Subject: [PATCH 57/59] android --- BuildBotLib/qmake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BuildBotLib/qmake.py b/BuildBotLib/qmake.py index 6595d91..6929272 100644 --- a/BuildBotLib/qmake.py +++ b/BuildBotLib/qmake.py @@ -126,6 +126,9 @@ def androidQmake(props): '-spec', 'android-clang', "-r", "CONFIG+=qtquickcompiler", + 'ANDROID_NDK_ROOT=/home/andrei/Android/ndk-bundle', + 'JAVA_HOME=/usr', + 'ANDROID_HOME=/home/andrei/Android', 'SIGN_PATH="' + secret.getValue('SIGPATH') + '"', 'SIGN_ALIES="quasarapp"', 'SIGN_STORE_PASSWORD="' + secret.getValue('SIGPASS') + '"' From 4d2548fb199e8c8647348003f48df2ea85f45bd1 Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 24 Dec 2019 17:09:52 +0300 Subject: [PATCH 58/59] fix env --- BuildBotLib/qmake.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/BuildBotLib/qmake.py b/BuildBotLib/qmake.py index 6929272..197b60e 100644 --- a/BuildBotLib/qmake.py +++ b/BuildBotLib/qmake.py @@ -126,9 +126,6 @@ def androidQmake(props): '-spec', 'android-clang', "-r", "CONFIG+=qtquickcompiler", - 'ANDROID_NDK_ROOT=/home/andrei/Android/ndk-bundle', - 'JAVA_HOME=/usr', - 'ANDROID_HOME=/home/andrei/Android', 'SIGN_PATH="' + secret.getValue('SIGPATH') + '"', 'SIGN_ALIES="quasarapp"', 'SIGN_STORE_PASSWORD="' + secret.getValue('SIGPASS') + '"' @@ -144,7 +141,9 @@ def AndroidSteps() : command = androidQmake, haltOnFailure = True, doStepIf = lambda step : isAndroid(step), - + env={{'ANDROID_NDK_ROOT': '/home/andrei/Android/ndk-bundle', + 'JAVA_HOME': '/usr', + 'ANDROID_HOME': '/home/andrei/Android'}}, name = 'QMake Android', description = 'create a make files for projects', ), From e6051bdb69816f98e0669ccb3343dabd6d802d2c Mon Sep 17 00:00:00 2001 From: "a.yankovich" Date: Tue, 24 Dec 2019 17:11:30 +0300 Subject: [PATCH 59/59] fix syntaxis error --- BuildBotLib/qmake.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BuildBotLib/qmake.py b/BuildBotLib/qmake.py index 197b60e..2e7c20e 100644 --- a/BuildBotLib/qmake.py +++ b/BuildBotLib/qmake.py @@ -141,9 +141,9 @@ def AndroidSteps() : command = androidQmake, haltOnFailure = True, doStepIf = lambda step : isAndroid(step), - env={{'ANDROID_NDK_ROOT': '/home/andrei/Android/ndk-bundle', - 'JAVA_HOME': '/usr', - 'ANDROID_HOME': '/home/andrei/Android'}}, + env={'ANDROID_NDK_ROOT': '/home/andrei/Android/ndk-bundle', + 'JAVA_HOME': '/usr', + 'ANDROID_HOME': '/home/andrei/Android'}, name = 'QMake Android', description = 'create a make files for projects', ),