Exemplo n.º 1
0
	def __init__(self, config, compositeLineProcessor, valueProvider):
		assert config is not None
		assert compositeLineProcessor is not None
		assert valueProvider is not None

		self.lineConveyor = compositeLineProcessor
		self.valueProvider = valueProvider

		self.shCommandBuilder = ShCommandBuilder()
		self.removeProjectBuilder = RemoveProjectCommandBuilder()
		self.createDirs = MakeDirsCommandBuilder()
		self.patchCsproj = PatchCsprojCommandBuilder()
		self.patchInfoPlist = PatchInfoplistCommandBuilder(self.valueProvider)
		self.patchInfoPlistArray = PatchInfoPlistArrayCommandBuilder()
		self.patchManifest = PatchManifestCommandBuilder()
		self.copyBuilder = CopyCommandBuilder()
		self.testflightBuilder = TestflightCommandBuilder()

		ignoreBackup = config.get('backup_ignore', None)
		self.createBackupBuilder = CreateBackupCommandBuilder(ignoreBackup)
		self.restoreFromBackupBuilder = RestoreBackupCommandBuilder(ignoreBackup)
		self.deleteBackupBuilder = DeleteBackupCommandBuilder(ignoreBackup)


		profilePrefix = config['project_name']
		self.installProfileBuilder = InstallProfileCommandBuilder(profilePrefix)

		buildUtilPath = config['build_tool']
		self.cleanBuilder = CleanBuildCommandBuilder(buildUtilPath, 'clean')
		self.buildBuilder = CleanBuildCommandBuilder(buildUtilPath, 'build')
		self.signAndroid = SignApkCommandBuilder(buildUtilPath)
from CommandBuilders.PatchInfoPlistArrayCommandBuilder import PatchInfoPlistArrayCommandBuilder

line = "inside 'BuildSample/BuildSample/Info.plist' set UISupportedInterfaceOrientations with values 'value1:value2:value3'"

cmdBuilder = PatchInfoPlistArrayCommandBuilder()
command = cmdBuilder.getCommandFor(line)
command.execute()

Exemplo n.º 3
0
class StepsRunner:
	def __init__(self, config, compositeLineProcessor, valueProvider):
		assert config is not None
		assert compositeLineProcessor is not None
		assert valueProvider is not None

		self.lineConveyor = compositeLineProcessor
		self.valueProvider = valueProvider

		self.shCommandBuilder = ShCommandBuilder()
		self.removeProjectBuilder = RemoveProjectCommandBuilder()
		self.createDirs = MakeDirsCommandBuilder()
		self.patchCsproj = PatchCsprojCommandBuilder()
		self.patchInfoPlist = PatchInfoplistCommandBuilder(self.valueProvider)
		self.patchInfoPlistArray = PatchInfoPlistArrayCommandBuilder()
		self.patchManifest = PatchManifestCommandBuilder()
		self.copyBuilder = CopyCommandBuilder()
		self.testflightBuilder = TestflightCommandBuilder()

		ignoreBackup = config.get('backup_ignore', None)
		self.createBackupBuilder = CreateBackupCommandBuilder(ignoreBackup)
		self.restoreFromBackupBuilder = RestoreBackupCommandBuilder(ignoreBackup)
		self.deleteBackupBuilder = DeleteBackupCommandBuilder(ignoreBackup)


		profilePrefix = config['project_name']
		self.installProfileBuilder = InstallProfileCommandBuilder(profilePrefix)

		buildUtilPath = config['build_tool']
		self.cleanBuilder = CleanBuildCommandBuilder(buildUtilPath, 'clean')
		self.buildBuilder = CleanBuildCommandBuilder(buildUtilPath, 'build')
		self.signAndroid = SignApkCommandBuilder(buildUtilPath)

	def run(self, content):
		assert content is not None

		lines = content.splitlines()
		for line in lines:
			processedLine = self.lineConveyor.processText(line, self.lineConveyor)

			if len(processedLine) == 0:
				continue
			else:
				self.processLine(processedLine)

	def processLine(self, line):
		if self.shCommandBuilder.isShCommand(line):
			cmd = self.shCommandBuilder.getCommandFor(line)
		elif self.removeProjectBuilder.isRemoveProject(line):
			cmd = self.removeProjectBuilder.getCommandFor(line)
		elif self.cleanBuilder.isCleanBuild(line):
			cmd = self.cleanBuilder.getCommandFor(line)
		elif self.buildBuilder.isCleanBuild(line):
			cmd = self.buildBuilder.getCommandFor(line)
		elif self.signAndroid.isSignApk(line):
			cmd = self.signAndroid.getCommandFor(line)
		elif self.createBackupBuilder.isCreateBackup(line):
			cmd = self.createBackupBuilder.getCommandFor(line)
		elif self.createDirs.isMakeDirsCommand(line):
			cmd = self.createDirs.getCommandFor(line)
		elif self.patchCsproj.isPatchCsproj(line):
			cmd = self.patchCsproj.getCommandFor(line)
		elif self.patchInfoPlist.isPatchInfoPlist(line):
			cmd = self.patchInfoPlist.getCommandFor(line)
		elif self.patchInfoPlistArray.isPatchInfoPlist(line):
			cmd = self.patchInfoPlistArray.getCommandFor(line)
		elif self.patchManifest.isManifestCommand(line):
			cmd = self.patchManifest.getCommandFor(line)
		elif self.copyBuilder.isCopy(line):
			cmd =self.copyBuilder.getCommandFor(line)
		elif self.restoreFromBackupBuilder.isRestoreBackup(line):
			cmd = self.restoreFromBackupBuilder.getCommandFor(line)
		elif self.deleteBackupBuilder.isDeleteBackup(line):
			cmd =self.deleteBackupBuilder.getCommandFor(line)
		elif self.testflightBuilder.isTestflight(line):
			cmd = self.testflightBuilder.getCommandFor(line)
		elif self.installProfileBuilder.isInstallProfile(line):
			cmd = self.installProfileBuilder.getCommandFor(line)
		else:
			msg = "unrecognised step. Line: '{0}'".format(line)
			raise Exception(msg)

		print 'start: {0}'.format(line)
		cmd.execute()
		print 'finish: {0}'.format(line)