Пофиксил баг переопределения настроек из коммандной строки
This commit is contained in:
parent
d7e11e39f5
commit
8aa91598b5
|
|
@ -3,16 +3,16 @@ sh echo 'IosSetupSteps.txt'
|
|||
# restore from backup # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными)
|
||||
# create backup
|
||||
|
||||
#sh echo '{@sln_config}'
|
||||
sh echo '{@sln_config}'
|
||||
|
||||
#inside 'BuildSample/BuildSample.sln' remove NotCompileApp project
|
||||
inside 'BuildSample/BuildSample.sln' remove NotCompileApp project
|
||||
|
||||
#inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
|
||||
#inside 'BuildSample/BuildSample/CoolApp.csproj' set AssemblyName to 'CoolApp' for ''
|
||||
inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
|
||||
inside 'BuildSample/BuildSample/CoolApp.csproj' set AssemblyName to '{@assembly_name}' for ''
|
||||
|
||||
#inside 'BuildSample/BuildSample/Info.plist' set CFBundleVersion to '{@version}'
|
||||
#inside 'BuildSample/BuildSample/Info.plist' set CFBundleDisplayName to 'CoolApp'
|
||||
inside 'BuildSample/BuildSample/Info.plist' set CFBundleVersion to '{@version}'
|
||||
inside 'BuildSample/BuildSample/Info.plist' set CFBundleDisplayName to 'CoolApp'
|
||||
|
||||
#inside 'BuildSample/BuildSample/Info.plist' set CFBundleIconFiles with values '{@icons}'
|
||||
inside 'BuildSample/BuildSample/Info.plist' set CFBundleIconFiles with values '{@icons}'
|
||||
|
||||
#install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'
|
||||
install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
sh echo 'IosSteps.txt'
|
||||
#sh echo '{@builder_path}'
|
||||
sh echo '{@builder_path}'
|
||||
|
||||
<include 'scripts/{@setup_steps}'>
|
||||
|
||||
#sh echo hello from '{@author}'
|
||||
#sh echo version: '{@version}'
|
||||
sh echo hello from '{@author}'
|
||||
sh echo version: '{@version}'
|
||||
|
||||
#clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||
#build 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||
clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||
build 'BuildSample/BuildSample.sln' for '{@sln_config}'
|
||||
|
||||
#create dirs 'Output/Appstore/Artifacts'
|
||||
#copy 'BuildSample/BuildSample/Output/BuildSample-{@version}.ipa' to 'Output/Appstore/Artifacts'
|
||||
#sh cp -a BuildSample/BuildSample/Output/ Output/Appstore/
|
||||
create dirs 'Output/Appstore/Artifacts'
|
||||
copy 'BuildSample/BuildSample/Output/{@assembly_name}-{@version}.ipa' to 'Output/Appstore/Artifacts'
|
||||
sh cp -a BuildSample/BuildSample/Output/ Output/Appstore/
|
||||
|
||||
#publish 'Output/Appstore/Artifacts/BuildSample-{@version}.ipa' to testflight notes = 'Hello' api_token = '{@tf_api_token}' team_token = '{@tf_team_token}'
|
||||
publish 'Output/Appstore/Artifacts/{@assembly_name}-{@version}.ipa' to testflight notes = 'Hello' api_token = '{@tf_api_token}' team_token = '{@tf_team_token}'
|
||||
|
||||
#restore from backup
|
||||
#delete backup
|
||||
|
|
@ -5,19 +5,23 @@ from parsers.SettingsParser.SettingsMerger import SettingsMerger
|
|||
class TestSettingsMerger(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.merger = SettingsMerger()
|
||||
|
||||
self.child1 = {
|
||||
'sub_key1': 'value3',
|
||||
'sub_key2': 'value4',
|
||||
}
|
||||
|
||||
self.child2 = {
|
||||
'sub_key3': 'value5',
|
||||
'sub_key4': 'value6',
|
||||
}
|
||||
|
||||
self.globalSettings = {
|
||||
'top_level_key1': 'value1',
|
||||
'top_level_key2': 'value2',
|
||||
|
||||
'child1': {
|
||||
'sub_key1': 'value3',
|
||||
'sub_key2': 'value4',
|
||||
},
|
||||
|
||||
'child2': {
|
||||
'sub_key3': 'value5',
|
||||
'sub_key4': 'value6',
|
||||
}
|
||||
'child1': self.child1,
|
||||
'child2': self.child2
|
||||
}
|
||||
|
||||
def test_mergeTopLevelSettings(self):
|
||||
|
|
@ -64,13 +68,44 @@ class TestSettingsMerger(unittest.TestCase):
|
|||
|
||||
self.assertListEqual(expectedPath, path)
|
||||
|
||||
def test_mergeNotExistSetting(self):
|
||||
def test_mergeNotExistTopLevelSetting(self):
|
||||
description = {
|
||||
'segments': ['new_key'],
|
||||
'value': 'new_value'
|
||||
}
|
||||
|
||||
print self.globalSettings
|
||||
self.merger.merge(self.globalSettings, description)
|
||||
self.assertEqual('new_value', self.globalSettings['new_key'])
|
||||
|
||||
def test_mergeNotExistSubSetting(self):
|
||||
description = {
|
||||
'segments': ['child1', 'new_key'],
|
||||
'value': 'new_value'
|
||||
}
|
||||
|
||||
self.merger.merge(self.globalSettings, description)
|
||||
self.assertEqual('new_value', self.globalSettings['child1']['new_key'])
|
||||
|
||||
|
||||
def test_mergeNotExistSub(self):
|
||||
description = {
|
||||
'segments': ['child3', 'new_key'],
|
||||
'value': 'new_value'
|
||||
}
|
||||
|
||||
self.merger.merge(self.globalSettings, description)
|
||||
self.assertEqual('new_value', self.globalSettings['child3']['new_key'])
|
||||
|
||||
|
||||
def test_getSettingsDictionaryByPath(self):
|
||||
dictionary1 = self.merger.getSettingsDictByPath(self.globalSettings, [])
|
||||
self.assertEqual(self.globalSettings, dictionary1)
|
||||
self.assertTrue(self.globalSettings == dictionary1)
|
||||
|
||||
dictionary2 = self.merger.getSettingsDictByPath(self.globalSettings, ['child1'])
|
||||
self.assertTrue(self.child1 == dictionary2)
|
||||
|
||||
dictionary3 = self.merger.getSettingsDictByPath(self.globalSettings, ['child2'])
|
||||
self.assertTrue(self.child2 == dictionary3)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ from parsers.SettingsParser.SettingsMerger import SettingsMerger
|
|||
|
||||
|
||||
class SettingsParser:
|
||||
def __init__(self, compositeLineProcessor, settings=None):
|
||||
def __init__(self, compositeLineProcessor, settings):
|
||||
assert compositeLineProcessor is not None
|
||||
assert settings is None or type(settings) == dict
|
||||
|
||||
self.compositeLineProcessor = compositeLineProcessor
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if __name__ == "__main__":
|
|||
# TODO: перенести в корень комапановки
|
||||
settingsPath = 'scripts/settings.txt'
|
||||
fromFileSettingsProvider = FromFileSettingsProvider(settingsPath, linePreprocessor)
|
||||
overrideWithCmdSetProvider = CmdArgsOverriderSettingsProvider(fromFileSettingsProvider, overrideArgs)
|
||||
overrideWithCmdSetProvider = CmdArgsOverriderSettingsProvider(fromFileSettingsProvider, overrideArgs, linePreprocessor)
|
||||
|
||||
fContentProvider = FileContentProvider()
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@ from parsers.SettingsParser.SettingsParser import SettingsParser
|
|||
|
||||
|
||||
class CmdArgsOverriderSettingsProvider(SettingsProviderBase):
|
||||
def __init__(self, settingsProvider, settingLines):
|
||||
def __init__(self, settingsProvider, settingLines, compositeLineProcessor):
|
||||
SettingsProviderBase.__init__(self)
|
||||
assert settingsProvider is not None
|
||||
assert compositeLineProcessor is not None
|
||||
|
||||
self.inner = settingsProvider
|
||||
self.overrideSettings = settingLines
|
||||
self.compositeLineProcessor = compositeLineProcessor
|
||||
|
||||
def fetchSettings(self):
|
||||
settings = self.inner.fetchSettings()
|
||||
|
|
@ -16,7 +18,7 @@ class CmdArgsOverriderSettingsProvider(SettingsProviderBase):
|
|||
if self.overrideSettings:
|
||||
for s in self.overrideSettings:
|
||||
line = self.normalizeLine(s)
|
||||
settingParser = SettingsParser(settings)
|
||||
settingParser = SettingsParser(self.compositeLineProcessor, settings)
|
||||
settingParser.processLine(line)
|
||||
|
||||
return settings
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class FromFileSettingsProvider(SettingsProviderBase):
|
|||
settingsFile = open(self.pathToSettings)
|
||||
content = settingsFile.read()
|
||||
|
||||
parser = SettingsParser(self.compositeLineProcessor)
|
||||
parser = SettingsParser(self.compositeLineProcessor, None)
|
||||
parser.parse(content)
|
||||
|
||||
return parser.settings
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ configs = 'appstore, staging'
|
|||
ios.sln_config = 'Release|iPhone'
|
||||
ios.steps = 'scripts/IosSteps.txt'
|
||||
ios.setup_steps = 'IosSetupSteps.txt'
|
||||
ios.assembly_name = 'CoolApp'
|
||||
|
||||
ios.tf_api_token = '0e6925075d4fc10fed0e7bbf43fa6894_NjQ0OTI2MjAxMi0wOS0yNSAxMTo0MDozNi40OTY5MjU'
|
||||
ios.tf_team_token = 'c5c3cf7a6dae2bea4382dfbd181a2075_Mjc4ODkwMjAxMy0wOS0yOSAxNDowOTo1OC40Mzg5MTY'
|
||||
|
|
|
|||
Loading…
Reference in New Issue