diff --git a/scripts/IosSteps.txt b/scripts/IosSteps.txt index 16383c3..2305d41 100644 --- a/scripts/IosSteps.txt +++ b/scripts/IosSteps.txt @@ -5,14 +5,14 @@ sh echo '{@builder_path}' 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/BuildSample-{@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/BuildSample-{@version}.ipa' to testflight notes = 'Hello' api_token = '{@tf_api_token}' team_token = '{@tf_team_token}' -restore from backup -delete backup \ No newline at end of file +#restore from backup +#delete backup \ No newline at end of file diff --git a/scripts/TouchinBuild/Core/LineConveyor/CommentRemover.py b/scripts/TouchinBuild/Core/LineConveyor/CommentRemover.py index 7dcb8c1..0628456 100644 --- a/scripts/TouchinBuild/Core/LineConveyor/CommentRemover.py +++ b/scripts/TouchinBuild/Core/LineConveyor/CommentRemover.py @@ -1,6 +1,9 @@ -class CommentRemover: +from Core.LineConveyor.PreprocessorBase import PreprocessorBase + + +class CommentRemover(PreprocessorBase): def __init__(self): - pass + PreprocessorBase.__init__(self) def processText(self, line, conveyorProcessor): assert line is not None diff --git a/scripts/TouchinBuild/Core/LineConveyor/MacroResolver.py b/scripts/TouchinBuild/Core/LineConveyor/MacroResolver.py index 0012c09..e42dba2 100644 --- a/scripts/TouchinBuild/Core/LineConveyor/MacroResolver.py +++ b/scripts/TouchinBuild/Core/LineConveyor/MacroResolver.py @@ -1,5 +1,10 @@ -class MacroResolver: +from Core.LineConveyor.PreprocessorBase import PreprocessorBase + + +class MacroResolver(PreprocessorBase): def __init__(self, macroProcessor, valueProvider): + PreprocessorBase.__init__(self) + assert macroProcessor is not None assert valueProvider is not None diff --git a/scripts/TouchinBuild/Core/LineConveyor/NullPreprocessor.py b/scripts/TouchinBuild/Core/LineConveyor/NullPreprocessor.py new file mode 100644 index 0000000..67824da --- /dev/null +++ b/scripts/TouchinBuild/Core/LineConveyor/NullPreprocessor.py @@ -0,0 +1,9 @@ +from Core.LineConveyor.PreprocessorBase import PreprocessorBase + + +class NullPreprocessor(PreprocessorBase): + def __init__(self): + PreprocessorBase.__init__(self) + + def processText(self, text, conveyorProcessor): + return text diff --git a/scripts/TouchinBuild/Core/LineConveyor/PreprocessorBase.py b/scripts/TouchinBuild/Core/LineConveyor/PreprocessorBase.py new file mode 100644 index 0000000..2a18eda --- /dev/null +++ b/scripts/TouchinBuild/Core/LineConveyor/PreprocessorBase.py @@ -0,0 +1,12 @@ +import abc + + +class PreprocessorBase: + __metaclass__ = abc.ABCMeta + + def __init__(self): + pass + + @abc.abstractmethod + def processText(self, line, conveyorProcessor): + pass \ No newline at end of file diff --git a/scripts/TouchinBuild/Core/LineConveyor/Stripper.py b/scripts/TouchinBuild/Core/LineConveyor/Stripper.py index 8aff211..4c21c3a 100644 --- a/scripts/TouchinBuild/Core/LineConveyor/Stripper.py +++ b/scripts/TouchinBuild/Core/LineConveyor/Stripper.py @@ -1,6 +1,9 @@ -class Stripper: +from Core.LineConveyor.PreprocessorBase import PreprocessorBase + + +class Stripper(PreprocessorBase): def __init__(self): - pass + PreprocessorBase.__init__(self) def processText(self, line, conveyorProcessor): assert line is not None diff --git a/scripts/TouchinBuild/Core/LineConveyor/TextConveyorPreprocessor.py b/scripts/TouchinBuild/Core/LineConveyor/TextConveyorPreprocessor.py index 9f789b4..cf43e00 100644 --- a/scripts/TouchinBuild/Core/LineConveyor/TextConveyorPreprocessor.py +++ b/scripts/TouchinBuild/Core/LineConveyor/TextConveyorPreprocessor.py @@ -1,5 +1,9 @@ -class TextConveyorPreprocessor: +from Core.LineConveyor.PreprocessorBase import PreprocessorBase + + +class TextConveyorPreprocessor(PreprocessorBase): def __init__(self): + PreprocessorBase.__init__(self) self.processors = [] def addProcessor(self, processor): diff --git a/scripts/TouchinBuild/Core/LineConveyor/TextInclude.py b/scripts/TouchinBuild/Core/LineConveyor/TextInclude.py index 144eea8..6c272e2 100644 --- a/scripts/TouchinBuild/Core/LineConveyor/TextInclude.py +++ b/scripts/TouchinBuild/Core/LineConveyor/TextInclude.py @@ -1,5 +1,10 @@ -class TextInclude: +from Core.LineConveyor.PreprocessorBase import PreprocessorBase + + +class TextInclude(PreprocessorBase): def __init__(self, includeProcessor, contentProvider): + PreprocessorBase.__init__(self) + assert includeProcessor is not None assert contentProvider is not None diff --git a/scripts/TouchinBuild/Tests/UnitTests/SettingsParser/test_SettingsParser.py b/scripts/TouchinBuild/Tests/UnitTests/SettingsParser/test_SettingsParser.py index c8081f5..8da6dd4 100644 --- a/scripts/TouchinBuild/Tests/UnitTests/SettingsParser/test_SettingsParser.py +++ b/scripts/TouchinBuild/Tests/UnitTests/SettingsParser/test_SettingsParser.py @@ -1,11 +1,13 @@ import unittest +from Core.LineConveyor.NullPreprocessor import NullPreprocessor from parsers.SettingsParser.SettingsParser import SettingsParser class TestSettingsParser(unittest.TestCase): def setUp(self): - self.parser = SettingsParser() + self.preprocessor = NullPreprocessor() + self.parser = SettingsParser(self.preprocessor) def test_processLine(self): line1 = "x.y.name1 = 'value1'" @@ -38,15 +40,17 @@ class TestSettingsParser(unittest.TestCase): self.assertEqual('value8', self.parser.settings['a']['z']['name2']) def test_emptyLinesAndComments(self): + class PartialSettingsParser(SettingsParser): - def __init__(self): - SettingsParser.__init__(self) + def __init__(self, textPreprocessor): + SettingsParser.__init__(self, textPreprocessor) self.processLineCall = 0 def processLine(self, line): self.processLineCall += 1 + print '{0} {1}'.format(self.processLineCall, line) - self.parser = PartialSettingsParser() + self.parser = PartialSettingsParser(self.preprocessor) content = """ valid.line.with.setting = 'some value' # this is comment @@ -56,6 +60,8 @@ valid.line.with.setting = 'some value' self.parser.parse(content) + # всего 6 строк, 2 из которых пустые + # NullPreprocessor не уберет комментарии, поэтому будет 4 вызова processLine self.assertEqual(2, self.parser.processLineCall) diff --git a/scripts/TouchinBuild/parsers/SettingsParser/SettingsParser.py b/scripts/TouchinBuild/parsers/SettingsParser/SettingsParser.py index 10c2ba4..92454f2 100644 --- a/scripts/TouchinBuild/parsers/SettingsParser/SettingsParser.py +++ b/scripts/TouchinBuild/parsers/SettingsParser/SettingsParser.py @@ -24,8 +24,6 @@ class SettingsParser: else: self.processLine(processedLine) - self.processLine(processedLine) - def processLine(self, line): assert line is not None diff --git a/scripts/settings.txt b/scripts/settings.txt index 17963b1..cd028a0 100644 --- a/scripts/settings.txt +++ b/scripts/settings.txt @@ -1,6 +1,6 @@ # global settings build_tool = '/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool' -version = '0.0.0' +version = '0.0.0' # комментарий в тойже строке configs = 'appstore, staging' # ios platform settings