Merge branch 'BS-52'

This commit is contained in:
rzaitov 2013-11-18 15:51:01 +04:00
commit b772326d82
19 changed files with 88 additions and 45 deletions

View File

@ -1,7 +1,19 @@
restore from backup
create backup
inside 'BuildSample/BuildSample.sln' remove 'CoolApp:NotCompileApp:Domain' project
inside 'BuildSample/DroidApp/DroidApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
inside 'BuildSample/DroidApp/Properties/AndroidManifest.xml' set android:versionCode to '17'
inside 'BuildSample/DroidApp/Properties/AndroidManifest.xml' set android:versionName to '1.2.3'
clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
sign android 'BuildSample/BuildSample.sln' for '{@sln_config}' project 'DroidApp'
sign android 'BuildSample/BuildSample.sln' for '{@sln_config_build}' project 'DroidApp'
create dirs 'Output/GooglePlay/Artifacts'
sh cp BuildSample/DroidApp/Output/*.apk Output/GooglePlay/Artifacts
sh cp -a BuildSample/DroidApp/Output/ Output/GooglePlay/
restore from backup
delete backup

View File

@ -1,7 +1,7 @@
# restore from backup # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными)
# create backup
restore from backup # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными)
create backup
sh echo '{@sln_config}'
sh echo 'Hello from setup.txt'
inside 'BuildSample/BuildSample.sln' remove 'NotCompileApp:DroidApp' project

View File

@ -7,7 +7,7 @@ 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/{@assembly_name}-{@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
restore from backup
delete backup

View File

@ -0,0 +1,12 @@
from parsers.ValuesStriper import ValuesStripper
class BaseBackupCommandBuilder:
def __init__(self, ignoreBackupStr):
if ignoreBackupStr:
splitter = ValuesStripper(',')
values = splitter.strip(ignoreBackupStr)
self.ignoreBackup = values
else:
self.ignoreBackup = []

View File

@ -1,10 +1,11 @@
from CommandBuilders.BuilderBackupCommands.BaseBackupCommandBuilder import BaseBackupCommandBuilder
from commands.BaseBackupCommand.CreateBackupCommand import CreateBackupCommand
from parsers.ParserBackup.CreateBackupParser import CreateBackupParser
class CreateBackupCommandBuilder:
def __init__(self):
pass
class CreateBackupCommandBuilder(BaseBackupCommandBuilder):
def __init__(self, ignoreBackupStr):
BaseBackupCommandBuilder.__init__(self, ignoreBackupStr)
def isCreateBackup(self, line):
assert line is not None
@ -18,5 +19,5 @@ class CreateBackupCommandBuilder:
parser = CreateBackupParser()
parser.parseLine(line)
command = CreateBackupCommand()
command = CreateBackupCommand(self.ignoreBackup)
return command

View File

@ -1,10 +1,11 @@
from CommandBuilders.BuilderBackupCommands.BaseBackupCommandBuilder import BaseBackupCommandBuilder
from commands.BaseBackupCommand.DeleteBackupCommand import DeleteBackupCommand
from parsers.ParserBackup.DeleteBackupParser import DeleteBackupParser
class DeleteBackupCommandBuilder:
def __init__(self):
pass
class DeleteBackupCommandBuilder(BaseBackupCommandBuilder):
def __init__(self, ignoreBackupStr):
BaseBackupCommandBuilder.__init__(self, ignoreBackupStr)
def isDeleteBackup(self, line):
assert line is not None
@ -20,5 +21,5 @@ class DeleteBackupCommandBuilder:
parser = DeleteBackupParser()
parser.parseLine(line)
command = DeleteBackupCommand()
command = DeleteBackupCommand(self.ignoreBackup)
return command

View File

@ -1,10 +1,11 @@
from CommandBuilders.BuilderBackupCommands.BaseBackupCommandBuilder import BaseBackupCommandBuilder
from commands.BaseBackupCommand.RestoreBackupCommand import RestoreBackupCommand
from parsers.ParserBackup.RestoreBackupParser import RestoreBackupParser
class RestoreBackupCommandBuilder:
def __init__(self):
pass
class RestoreBackupCommandBuilder(BaseBackupCommandBuilder):
def __init__(self, ignoreBackupStr):
BaseBackupCommandBuilder.__init__(self, ignoreBackupStr)
def isRestoreBackup(self, line):
assert line is not None
@ -20,5 +21,5 @@ class RestoreBackupCommandBuilder:
parser = RestoreBackupParser()
parser.parseLine(line)
command = RestoreBackupCommand()
command = RestoreBackupCommand(self.ignoreBackup)
return command

View File

@ -0,0 +1 @@
__author__ = 'rzaitov'

View File

@ -1,7 +1,9 @@
from CommandBuilders.BuilderBackupCommands.CreateBackupCommandBuilder import CreateBackupCommandBuilder
from CommandBuilders.BuilderBackupCommands.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
from CommandBuilders.BuilderBackupCommands.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
from CommandBuilders.CleanBuildCommandBuilder import CleanBuildCommandBuilder
from CommandBuilders.CopyCommandBuilder import CopyCommandBuilder
from CommandBuilders.CreateBackupCommandBuilder import CreateBackupCommandBuilder
from CommandBuilders.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
from CommandBuilders.InstallProfileCommandBuilder import InstallProfileCommandBuilder
from CommandBuilders.MakeDirsCommandBuilder import MakeDirsCommandBuilder
from CommandBuilders.PatchCsprojCommandBuilder import PatchCsprojCommandBuilder
@ -9,7 +11,6 @@ from CommandBuilders.PatchInfoPlistArrayCommandBuilder import PatchInfoPlistArra
from CommandBuilders.PatchInfoplistCommandBuilder import PatchInfoplistCommandBuilder
from CommandBuilders.PatchManifestCommandBuilder import PatchManifestCommandBuilder
from CommandBuilders.RemoveProjectCommandBuilder import RemoveProjectCommandBuilder
from CommandBuilders.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
from CommandBuilders.ShCommandBuilder import ShCommandBuilder
from CommandBuilders.SignApkBuilder import SignApkCommandBuilder
from CommandBuilders.TestflightCommandBuilder import TestflightCommandBuilder
@ -26,9 +27,6 @@ class StepsRunner:
self.shCommandBuilder = ShCommandBuilder()
self.removeProjectBuilder = RemoveProjectCommandBuilder()
self.createBackupBuilder = CreateBackupCommandBuilder()
self.restoreFromBackupBuilder = RestoreBackupCommandBuilder()
self.deleteBackupBuilder = DeleteBackupCommandBuilder()
self.createDirs = MakeDirsCommandBuilder()
self.patchCsproj = PatchCsprojCommandBuilder()
self.patchInfoPlist = PatchInfoplistCommandBuilder(self.valueProvider)
@ -37,6 +35,12 @@ class StepsRunner:
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)

View File

@ -1,8 +1,8 @@
from CommandBuilders.CreateBackupCommandBuilder import CreateBackupCommandBuilder
from CommandBuilders.BuilderBackupCommands.CreateBackupCommandBuilder import CreateBackupCommandBuilder
line = "create backup"
cmdBuilder = CreateBackupCommandBuilder()
cmdBuilder = CreateBackupCommandBuilder(None)
command = cmdBuilder.getCommandFor(line)
command.execute()

View File

@ -1,8 +1,8 @@
from CommandBuilders.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
from CommandBuilders.BuilderBackupCommands.DeleteBackupCommandBuilder import DeleteBackupCommandBuilder
line = "delete backup"
cmdBuilder = DeleteBackupCommandBuilder()
cmdBuilder = DeleteBackupCommandBuilder(None)
command = cmdBuilder.getCommandFor(line)
command.execute()

View File

@ -1,8 +1,8 @@
from CommandBuilders.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
from CommandBuilders.BuilderBackupCommands.RestoreBackupCommandBuilder import RestoreBackupCommandBuilder
line = "restore from backup"
builder = RestoreBackupCommandBuilder()
builder = RestoreBackupCommandBuilder(None)
command = builder.getCommandFor(line)
command.execute()

View File

@ -4,8 +4,14 @@ from commands.CommandBase import CommandBase
class BaseBackupCommand(CommandBase):
def __init__(self):
def __init__(self, ignoreBackup):
CommandBase.__init__(self)
assert ignoreBackup is not None
self.backupIgnore = ['.git', '.gitignore', '.DS_Store', 'backup']
self.backupIgnore.extend(ignoreBackup)
self.folderPath = '.'
# вычислять абсолютные пути надо на этапе создания комманды
@ -13,7 +19,6 @@ class BaseBackupCommand(CommandBase):
self.srcAbsDirPath = self.getAbsSrc()
self.backupDirAbsPath = self.getAbsDst()
self.backupIgnore = ['.git', '.gitignore', '.DS_Store', 'backup']
def getAbsSrc(self):
return self.getAbs(self.folderPath)

View File

@ -4,8 +4,8 @@ from commands.BaseBackupCommand.BaseBackupCommand import BaseBackupCommand
class CreateBackupCommand(BaseBackupCommand):
def __init__(self):
BaseBackupCommand.__init__(self)
def __init__(self, ignoreBackup):
BaseBackupCommand.__init__(self, ignoreBackup)
def execute(self):
#if os.path.exists(self.backupDirAbsPath):

View File

@ -4,8 +4,8 @@ from commands.BaseBackupCommand.BaseBackupCommand import BaseBackupCommand
class DeleteBackupCommand(BaseBackupCommand):
def __init__(self):
BaseBackupCommand.__init__(self)
def __init__(self, ignoreBackup):
BaseBackupCommand.__init__(self, ignoreBackup)
def execute(self):
if not os.path.exists(self.backupDirAbsPath):

View File

@ -4,8 +4,8 @@ from commands.BaseBackupCommand.BaseBackupCommand import BaseBackupCommand
class RestoreBackupCommand(BaseBackupCommand):
def __init__(self):
BaseBackupCommand.__init__(self)
def __init__(self, ignoreBackup):
BaseBackupCommand.__init__(self, ignoreBackup)
def execute(self):
if not os.path.exists(self.backupDirAbsPath):

View File

@ -19,4 +19,5 @@ class SignApkCommand(ShellCommandBase):
def execute(self):
cmdText = self.commandPattern.format(self.pathToBuildUtil, self.slnConfig, self.projectName, self.slnPath)
print cmdText
self.executeShell(cmdText)

View File

@ -1,11 +1,13 @@
class ValuesStripper:
def __init__(self):
pass
def __init__(self, separator=':'):
assert separator is not None
self.separator = separator
def strip(self, valueStr):
assert valueStr is not None
rawValues = valueStr.split(':')
rawValues = valueStr.split(self.separator)
values = [name.strip() for name in rawValues]
return values

View File

@ -1,12 +1,13 @@
# global settings
build_tool='/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool'
version=0.0.0 # комментарий в тойже строке
configs = 'appstore, staging, android'
configs = 'appstore'
project_name = CoolApp
sln_config = Release|iPhone
backup_ignore = .git, .gitignore, .DS_Store, backup, Output, scripts
# ios platform settings
#ios.steps = 'scripts/IosSteps.txt'
ios.steps = scripts/IosSteps.txt
ios.sln_config = Release|iPhone
ios.setup_steps = 'IosSetupSteps.txt'
ios.assembly_name = 'CoolApp'
@ -14,6 +15,8 @@ ios.tf_api_token = '0e6925075d4fc10fed0e7bbf43fa6894_NjQ0OTI2MjAxMi0wOS0yNSAxMTo
ios.tf_team_token = 'c5c3cf7a6dae2bea4382dfbd181a2075_Mjc4ODkwMjAxMy0wOS0yOSAxNDowOTo1OC40Mzg5MTY'
# android platform settings
android.sln_config = Release|AnyCPU
android.sln_config_build = Release
android.steps = 'scripts/AndroidSteps.txt'
# config settings