From 5524183b38676bbc29efe77ff06359182feb3dab Mon Sep 17 00:00:00 2001 From: rzaitov Date: Thu, 31 Oct 2013 14:19:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B?= =?UTF-8?q?=20=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B8=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=80?= =?UTF-8?q?=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CleanBuildCommands/BuildCommand.py | 8 ++++++++ .../CleanBuildCommandBase.py | 18 ++++++++++++++++++ .../CleanBuildCommands/CleanCommand.py | 7 +++++++ .../commands/CleanBuildCommands/__init__.py | 1 + 4 files changed, 34 insertions(+) create mode 100644 scripts/commands/CleanBuildCommands/BuildCommand.py create mode 100644 scripts/commands/CleanBuildCommands/CleanBuildCommandBase.py create mode 100644 scripts/commands/CleanBuildCommands/CleanCommand.py create mode 100644 scripts/commands/CleanBuildCommands/__init__.py diff --git a/scripts/commands/CleanBuildCommands/BuildCommand.py b/scripts/commands/CleanBuildCommands/BuildCommand.py new file mode 100644 index 0000000..3704f2f --- /dev/null +++ b/scripts/commands/CleanBuildCommands/BuildCommand.py @@ -0,0 +1,8 @@ +from commands.CleanBuildCommands.CleanBuildCommandBase import CleanBuildCommandBase + + +class BuildCommand(CleanBuildCommandBase): + def __init__(self, pathToBuildUtil, slnPath, slnConfig): + commandPattern = '{0} -v build "--configuration:{1}" "--target:Build" {2}' + CleanBuildCommandBase.__init__(self, commandPattern, pathToBuildUtil, slnPath, slnConfig) + diff --git a/scripts/commands/CleanBuildCommands/CleanBuildCommandBase.py b/scripts/commands/CleanBuildCommands/CleanBuildCommandBase.py new file mode 100644 index 0000000..097caa6 --- /dev/null +++ b/scripts/commands/CleanBuildCommands/CleanBuildCommandBase.py @@ -0,0 +1,18 @@ +from subprocess import call + + +class CleanBuildCommandBase: + def __init__(self, commandPattern, pathToBuildUtil, slnPath, slnConfig): + assert commandPattern is not None + assert pathToBuildUtil is not None + assert slnPath is not None + assert slnConfig is not None + + self.__commandPattern = commandPattern + self.__pathToBuildUtil = pathToBuildUtil + self.__slnPath = slnPath + self.__slnConfig = slnConfig + + def execute(self): + cleanCmdText = self.__commandPattern.format(self.__pathToBuildUtil, self.__slnConfig, self.__slnPath) + returnCode = call(cleanCmdText, shell=True) diff --git a/scripts/commands/CleanBuildCommands/CleanCommand.py b/scripts/commands/CleanBuildCommands/CleanCommand.py new file mode 100644 index 0000000..209afbb --- /dev/null +++ b/scripts/commands/CleanBuildCommands/CleanCommand.py @@ -0,0 +1,7 @@ +from commands.CleanBuildCommands.CleanBuildCommandBase import CleanBuildCommandBase + + +class CleanCommand(CleanBuildCommandBase): + def __init__(self, pathToBuildUtil, slnPath, slnConfig): + commandPattern = '{0} -v build "--configuration:{1}" "--target:Clean" {2}' + CleanBuildCommandBase.__init__(self, commandPattern, pathToBuildUtil, slnPath, slnConfig) diff --git a/scripts/commands/CleanBuildCommands/__init__.py b/scripts/commands/CleanBuildCommands/__init__.py new file mode 100644 index 0000000..cc31abc --- /dev/null +++ b/scripts/commands/CleanBuildCommands/__init__.py @@ -0,0 +1 @@ +__author__ = 'rzaitov'