ref #9 fix seecret manager

This commit is contained in:
Andrei Yankovich 2021-04-06 00:33:46 +03:00
parent cc062a6232
commit b768975a48
5 changed files with 19 additions and 14 deletions

View File

@ -55,7 +55,8 @@ class CMake(Make):
return ' '.join(options)
def androidXmakeCmd(self, props):
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
file = self.home + "/buildBotSecret/secret.json"
secret = SecretManager(file, props)
toochainFile = 'build/cmake/android.toolchain.cmake'
options = [

View File

@ -30,7 +30,8 @@ class CrossplatformQmake (QMake):
return command
def androidXmakeCmd(self, props):
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
file = self.home + "/buildBotSecret/secret.json"
secret = SecretManager(file, props)
command = [
'qmake-android',

View File

@ -85,7 +85,8 @@ class Make(BaseModule):
return command
def androidXmakeCmd(self, props):
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
file = self.home + "/buildBotSecret/secret.json"
secret = SecretManager(file, props)
command = [
'qmake-android',

View File

@ -31,7 +31,8 @@ class QMake(Make):
return self.mainCmd()
def androidXmakeCmd(self, props):
secret = SecretManager(self.home + "/buildBotSecret/secret.json")
file = self.home + "/buildBotSecret/secret.json"
secret = SecretManager(file, props)
command = [
'qmake',

View File

@ -5,15 +5,16 @@ from pathlib import Path
class SecretManager:
def __init__(self, jsFile):
try:
contents = Path(jsFile).read_text()
self.jsfile = json.loads(contents)
except:
pass
def __init__(self, jsFile, properties=None):
contents = Path(jsFile).read_text()
self.jsfile = json.loads(contents)
self.prop = properties
def getValue(self, key):
try:
return self.jsfile[key]
except:
pass
value = self.jsfile[key]
if self.prop:
self.prop.useSecret(value, key)
return value