mirror of
https://github.com/QuasarApp/QuasarAppCI.git
synced 2025-04-27 14:24:32 +00:00
added separate builders
This commit is contained in:
parent
f3372b9d41
commit
68fe5db62d
46
BuildBotLib/CrossplatformQmake.py
Normal file
46
BuildBotLib/CrossplatformQmake.py
Normal file
@ -0,0 +1,46 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
from BuildBotLib.qmake import QMake
|
||||
from BuildBotLib.secretManager import SecretManager
|
||||
|
||||
|
||||
class CrossplatformQmake (QMake):
|
||||
|
||||
def __init__(self, platform):
|
||||
QMake.__init__(self, platform)
|
||||
|
||||
def linuxXmakeCmd(self, props):
|
||||
command = [
|
||||
'qmake-linux',
|
||||
"-r",
|
||||
"CONFIG+=qtquickcompiler",
|
||||
'ONLINE="~/repo"'
|
||||
]
|
||||
|
||||
return command
|
||||
|
||||
def windowsXmakeCmd(self, props):
|
||||
command = [
|
||||
'qmake-windows',
|
||||
'-spec', 'win32-g++',
|
||||
"-r",
|
||||
"CONFIG+=qtquickcompiler",
|
||||
'ONLINE="~/repo"'
|
||||
]
|
||||
|
||||
return command
|
||||
|
||||
def androidXmakeCmd(self, props):
|
||||
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
|
||||
|
||||
command = [
|
||||
'qmake-android',
|
||||
'-spec', 'android-clang',
|
||||
"-r",
|
||||
"CONFIG+=qtquickcompiler",
|
||||
'SIGN_PATH="' + secret.getValue('SIGPATH') + '"',
|
||||
'SIGN_ALIES="quasarapp"',
|
||||
'SIGN_STORE_PASSWORD="' + secret.getValue('SIGPASS') + '"'
|
||||
|
||||
]
|
||||
|
||||
return command
|
@ -8,18 +8,23 @@ from pathlib import Path
|
||||
|
||||
class BaseModule:
|
||||
|
||||
def __init__(self):
|
||||
P_Windows = 'Windows'
|
||||
P_Linux = 'Linux'
|
||||
P_Android = 'Android'
|
||||
|
||||
def __init__(self, platform):
|
||||
self.MULTIPLE_SH_COMMAND = ["/bin/bash", "-c"]
|
||||
self.home = str(Path.home())
|
||||
self.platform = platform
|
||||
|
||||
def isWin(self, step):
|
||||
return step.getProperty('Windows')
|
||||
return self.platform == BaseModule.P_Windows
|
||||
|
||||
def isLinux(self, step):
|
||||
return step.getProperty('Linux')
|
||||
return self.platform == BaseModule.P_Linux
|
||||
|
||||
def isAndroid(self, step):
|
||||
return step.getProperty('Android')
|
||||
return self.platform == BaseModule.P_Android
|
||||
|
||||
def generateCmd(self, bashString):
|
||||
|
||||
@ -47,23 +52,6 @@ class BaseModule:
|
||||
|
||||
def getPropertyes(self):
|
||||
return [
|
||||
util.BooleanParameter(
|
||||
name='Windows',
|
||||
label='Windows version project',
|
||||
default=True
|
||||
),
|
||||
|
||||
util.BooleanParameter(
|
||||
name='Linux',
|
||||
label='Linux version project',
|
||||
default=True
|
||||
),
|
||||
|
||||
util.BooleanParameter(
|
||||
name='Android',
|
||||
label='Android version project',
|
||||
default=True
|
||||
),
|
||||
]
|
||||
|
||||
def copyRegExp(self, source, dist):
|
||||
|
@ -26,9 +26,12 @@ class BuildBotShedulers(BuildBotModule):
|
||||
|
||||
self.masterConf['schedulers'] = self.shedulers + [
|
||||
schedulers.AnyBranchScheduler(
|
||||
name='github-tester',
|
||||
name='github',
|
||||
change_filter=util.ChangeFilter(project_re="qmake-*"),
|
||||
builderNames=['github-tester'],
|
||||
builderNames=['LinuxBuilder',
|
||||
'AndroidBuilder',
|
||||
'WindowBuilder',
|
||||
],
|
||||
properties={
|
||||
'clean': True,
|
||||
'test': True,
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
from BuildBotLib.buildBotModule import BuildBotModule
|
||||
from buildbot.plugins import worker
|
||||
from BuildBotLib.secretManager import SecretManager
|
||||
|
||||
|
||||
class BuildBotWorkers(BuildBotModule):
|
||||
@ -14,13 +15,14 @@ class BuildBotWorkers(BuildBotModule):
|
||||
# a Worker object, specifying a unique worker
|
||||
# name and password. The same
|
||||
# worker name and password must be configured on the worker.
|
||||
self.masterConf['workers'] = [
|
||||
worker.Worker("github-worker", "pass"),
|
||||
worker.Worker("github-tester", "pass"),
|
||||
worker.Worker("qtBuilder", "pass"),
|
||||
worker.Worker("NPM", "pass"),
|
||||
worker.Worker("assets-builder", "pass")
|
||||
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
|
||||
|
||||
password = secret.getValue('WorkerPass')
|
||||
|
||||
self.masterConf['workers'] = [
|
||||
worker.Worker("AndroidBuilder", password),
|
||||
worker.Worker("LinuxBuilder", password),
|
||||
worker.Worker("WindowBuilder", password),
|
||||
]
|
||||
|
||||
# 'protocols' contains information
|
||||
|
@ -11,8 +11,8 @@ from BuildBotLib.secretManager import *
|
||||
|
||||
class CMake(Make):
|
||||
|
||||
def __init__(self):
|
||||
Make.__init__(self);
|
||||
def __init__(self, platform):
|
||||
Make.__init__(self, platform);
|
||||
|
||||
def linuxXmakeCmd(self, props):
|
||||
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
|
||||
|
@ -8,8 +8,8 @@ from BuildBotLib.secretManager import SecretManager
|
||||
|
||||
|
||||
class Make(BaseModule):
|
||||
def __init__(self):
|
||||
BaseModule.__init__(self)
|
||||
def __init__(self, platform):
|
||||
BaseModule.__init__(self, platform)
|
||||
|
||||
def isClean(self, step):
|
||||
return step.getProperty('clean')
|
||||
@ -90,25 +90,19 @@ class Make(BaseModule):
|
||||
|
||||
def generateStep(self, cmd, platform, desc, checkFunc):
|
||||
|
||||
platformCgek = {
|
||||
'linux': self.isLinux,
|
||||
'windows': self.isWin,
|
||||
'android': self.isAndroid,
|
||||
}
|
||||
|
||||
@util.renderer
|
||||
def envWraper(step):
|
||||
|
||||
platformEnv = {
|
||||
'linux': self.linuxXmakeEnv,
|
||||
'windows': self.windowsXmakeEnv,
|
||||
'android': self.androidXmakeEnv,
|
||||
BaseModule.P_Linux: self.linuxXmakeEnv,
|
||||
BaseModule.P_Windows: self.windowsXmakeEnv,
|
||||
BaseModule.P_Android: self.androidXmakeEnv,
|
||||
}
|
||||
|
||||
return platformEnv[platform](step)
|
||||
|
||||
def dustepIf(step):
|
||||
return checkFunc(step) and platformCgek[platform](step)
|
||||
return checkFunc(step)
|
||||
|
||||
res = steps.Compile(
|
||||
command=self.getWraper(cmd),
|
||||
@ -126,9 +120,9 @@ class Make(BaseModule):
|
||||
def generatePlatformSteps(self, platform):
|
||||
|
||||
platformXcmd = {
|
||||
'linux': self.linuxXmakeCmd,
|
||||
'windows': self.windowsXmakeCmd,
|
||||
'android': self.androidXmakeCmd,
|
||||
BaseModule.P_Linux: self.linuxXmakeCmd,
|
||||
BaseModule.P_Windows: self.windowsXmakeCmd,
|
||||
BaseModule.P_Android: self.androidXmakeCmd,
|
||||
}
|
||||
|
||||
res = []
|
||||
@ -185,9 +179,7 @@ class Make(BaseModule):
|
||||
)
|
||||
)
|
||||
|
||||
factory.addSteps(self.generatePlatformSteps('linux'))
|
||||
factory.addSteps(self.generatePlatformSteps('windows'))
|
||||
factory.addSteps(self.generatePlatformSteps('android'))
|
||||
factory.addSteps(self.generatePlatformSteps(self.platform))
|
||||
|
||||
factory.addStep(
|
||||
steps.DirectoryUpload(
|
||||
|
@ -6,12 +6,15 @@ from BuildBotLib.secretManager import SecretManager
|
||||
|
||||
class QMake(Make):
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, platform):
|
||||
Make.__init__(self)
|
||||
|
||||
def linuxXmakeCmd(self, props):
|
||||
def makePrefix(self):
|
||||
return "Q"
|
||||
|
||||
def mainCmd(self):
|
||||
command = [
|
||||
'qmake-linux',
|
||||
'qmake',
|
||||
"-r",
|
||||
"CONFIG+=qtquickcompiler",
|
||||
'ONLINE="~/repo"'
|
||||
@ -19,22 +22,17 @@ class QMake(Make):
|
||||
|
||||
return command
|
||||
|
||||
def linuxXmakeCmd(self, props):
|
||||
return self.mainCmd()
|
||||
|
||||
def windowsXmakeCmd(self, props):
|
||||
command = [
|
||||
'qmake-windows',
|
||||
'-spec', 'win32-g++',
|
||||
"-r",
|
||||
"CONFIG+=qtquickcompiler",
|
||||
'ONLINE="~/repo"'
|
||||
]
|
||||
|
||||
return command
|
||||
return self.mainCmd()
|
||||
|
||||
def androidXmakeCmd(self, props):
|
||||
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
|
||||
|
||||
command = [
|
||||
'qmake-android',
|
||||
'qmake',
|
||||
'-spec', 'android-clang',
|
||||
"-r",
|
||||
"CONFIG+=qtquickcompiler",
|
||||
@ -45,8 +43,3 @@ class QMake(Make):
|
||||
]
|
||||
|
||||
return command
|
||||
|
||||
def androidXmakeEnv(self, props):
|
||||
return {'ANDROID_NDK_ROOT': self.home + '/Android/ndk-bundle',
|
||||
'JAVA_HOME': '/usr',
|
||||
'ANDROID_HOME': self.home + '/Android'}
|
||||
|
14
master.cfg
14
master.cfg
@ -8,6 +8,7 @@ from BuildBotLib.cmake import CMake
|
||||
from BuildBotLib.qmake import QMake
|
||||
from BuildBotLib.asssetsinstaller import AsssetsInstaller
|
||||
from BuildBotLib.qtUpdater import QtUpdater
|
||||
from BuildBotLib.basemodule import BaseModule
|
||||
|
||||
# This is a sample buildmaster config file. It must be installed as
|
||||
# 'master.cfg' in your buildmaster's base directory.
|
||||
@ -18,14 +19,13 @@ from BuildBotLib.qtUpdater import QtUpdater
|
||||
|
||||
bot = BuildBot()
|
||||
|
||||
qmake = QMake()
|
||||
asssetsinstaller = AsssetsInstaller()
|
||||
qtUpdater = QtUpdater()
|
||||
qmakeLinux = QMake(BaseModule.P_Linux)
|
||||
qmakeWindows = QMake(BaseModule.P_Windows)
|
||||
qmakeAndroid = QMake(BaseModule.P_Android)
|
||||
|
||||
bot.addBuilder("github-worker", qmake)
|
||||
bot.addBuilder("github-tester", qmake)
|
||||
bot.addBuilder("qtBuilder", qtUpdater)
|
||||
bot.addBuilder("assets-builder", asssetsinstaller)
|
||||
bot.addBuilder("LinuxBuilder", qmakeLinux)
|
||||
bot.addBuilder("WindowBuilder", qmakeWindows)
|
||||
bot.addBuilder("AndroidBuilder", qmakeAndroid)
|
||||
|
||||
|
||||
c = BuildmasterConfig = bot.getMaster()
|
||||
|
Loading…
x
Reference in New Issue
Block a user