подключил комманду патчинга

This commit is contained in:
rzaitov 2013-11-01 14:17:17 +04:00
parent f111d0c2b9
commit 1ecfbe420e
4 changed files with 23 additions and 6 deletions

View File

@ -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

View File

@ -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'

View File

@ -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)

View File

@ -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'