diff --git a/scripts/CommandBuilders/PatchCsprojCommandBuilder.py b/scripts/CommandBuilders/PatchCsprojCommandBuilder.py index ac130b7..1901be6 100644 --- a/scripts/CommandBuilders/PatchCsprojCommandBuilder.py +++ b/scripts/CommandBuilders/PatchCsprojCommandBuilder.py @@ -3,13 +3,11 @@ from parser.InsideParser.InsideSetParser import InsideSetParser class PatchCsprojCommandBuilder: - def __init__(self, config, pathProvider, valueProvider): + def __init__(self, config, valueProvider): assert config is not None - assert pathProvider is not None assert valueProvider is not None self.__config = config - self.__pathProvider = pathProvider self.__valueProvider = valueProvider def getCommandFor(self, line): @@ -18,12 +16,20 @@ class PatchCsprojCommandBuilder: parser = InsideSetParser(self.__valueProvider, 'csproj') result = parser.parseLine(line) - relPath = result[0] + csprojPath = result[0] key = result[1] value = self.__valueProvider.getValueFor(result[2]) - csprojAbsPath = self.__pathProvider.resolveAbsPath(relPath) slnConfig = self.__config['sln_config'] - command = PatchCsprojCommand(csprojAbsPath, key, value, slnConfig) + command = PatchCsprojCommand(csprojPath, key, value, slnConfig) return command + + def isPatchCsproj(self, line): + assert line is not None + + parser = InsideSetParser(self.__valueProvider, 'csproj') + isValid = parser.isValidLine(line) + + return isValid + diff --git a/scripts/IosSteps.txt b/scripts/IosSteps.txt index 0f3a448..18709fd 100644 --- a/scripts/IosSteps.txt +++ b/scripts/IosSteps.txt @@ -1,5 +1,6 @@ create backup for 'BuildSample' inside 'BuildSample/BuildSample.sln' remove NotCompileApp project +inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' clean 'BuildSample/BuildSample.sln' for 'Release|iPhone' build 'BuildSample/BuildSample.sln' for 'Release|iPhone' create dirs 'Output/Appstore/Artifacts' diff --git a/scripts/StepRunner/StepsRunner.py b/scripts/StepRunner/StepsRunner.py index f3605dd..247042c 100644 --- a/scripts/StepRunner/StepsRunner.py +++ b/scripts/StepRunner/StepsRunner.py @@ -1,18 +1,24 @@ from CommandBuilders.CleanBuildCommandBuilder import CleanBuildCommandBuilder from CommandBuilders.CreateBackupCommandBuilder import CreateBackupCommandBuilder from CommandBuilders.MakeDirsCommandBuilder import MakeDirsCommandBuilder +from CommandBuilders.PatchCsprojCommandBuilder import PatchCsprojCommandBuilder from CommandBuilders.RemoveProjectCommandBuilder import RemoveProjectCommandBuilder from CommandBuilders.ShCommandBuilder import ShCommandBuilder +from commands.PatchCsprojCommand import PatchCsprojCommand +from commands.ValueProvider import ValueProvider class StepsRunner: def __init__(self, config): assert config is not None + self.valueProvider = ValueProvider(config) + self.shCommandBuilder = ShCommandBuilder() self.removeProjectBuilder = RemoveProjectCommandBuilder() self.createBackupBuilder = CreateBackupCommandBuilder() self.createDirs = MakeDirsCommandBuilder() + self.pathcCsproj = PatchCsprojCommandBuilder(config, self.valueProvider) buildUtilPath = config['build_tool'] self.cleanBuilder = CleanBuildCommandBuilder(buildUtilPath, 'clean') @@ -51,6 +57,9 @@ class StepsRunner: elif self.createDirs.isMakeDirsCommand(line): cmd = self.createDirs.getCommandFor(line) cmd.execute() + elif self.pathcCsproj.isPatchCsproj(line): + cmd = self.pathcCsproj.getCommandFor(line) + cmd.execute() else: msg = "unrecognised step. Line: '{0}'".format(line) raise Exception(msg) \ No newline at end of file diff --git a/scripts/settings.txt b/scripts/settings.txt index a7e69ea..ae50dd1 100644 --- a/scripts/settings.txt +++ b/scripts/settings.txt @@ -11,6 +11,7 @@ ios.steps = 'scripts/IosSteps.txt' # config settings ios.appstore.build_ready = 'true' ios.appstore.app_name = 'CoolApp' +ios.appstore.sln_config = 'Release|iPhone' #ios.staging.build_ready = 'true' ios.staging.app_name = 'CoolApp staging'