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'