Changeset 51893 in webkit


Ignore:
Timestamp:
Dec 9, 2009 1:24:40 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2009-12-09 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

[bzt] Convert Build to use Sequence
https://bugs.webkit.org/show_bug.cgi?id=32310

So much prettier.

  • Scripts/modules/buildsteps.py:
  • Scripts/modules/commands/download.py:
  • Scripts/modules/landingsequence.py:
  • Scripts/modules/stepsequence.py: Added.
Location:
trunk/WebKitTools
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51891 r51893  
     12009-12-09  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [bzt] Convert Build to use Sequence
     6        https://bugs.webkit.org/show_bug.cgi?id=32310
     7
     8        So much prettier.
     9
     10        * Scripts/modules/buildsteps.py:
     11        * Scripts/modules/commands/download.py:
     12        * Scripts/modules/landingsequence.py:
     13        * Scripts/modules/stepsequence.py: Added.
     14
    1152009-12-09  Adam Barth  <abarth@webkit.org>
    216
  • trunk/WebKitTools/Scripts/modules/buildsteps.py

    r51889 r51893  
    5151
    5252class AbstractStep(object):
    53     def __init__(self, tool, options):
     53    def __init__(self, tool, options, patch=None):
    5454        self._tool = tool
    5555        self._options = options
     56        self._patch = patch
    5657        self._port = None
    5758
     
    7576
    7677
    77 class AbstractPatchStep(AbstractStep):
    78     def __init__(self, tool, options, patch):
    79         AbstractStep.__init__(self, tool, options)
    80         self._patch = patch
    81 
    82 
    8378class PrepareChangelogStep(AbstractStep):
    8479    def run(self):
     
    8782
    8883class CleanWorkingDirectoryStep(AbstractStep):
    89     def __init__(self, tool, options, allow_local_commits=False):
    90         AbstractStep.__init__(self, tool, options)
     84    def __init__(self, tool, options, patch=None, allow_local_commits=False):
     85        AbstractStep.__init__(self, tool, options, patch)
    9186        self._allow_local_commits = allow_local_commits
    9287
     
    9994
    10095    def run(self):
    101         os.chdir(self._tool._scm.checkout_root)
     96        os.chdir(self._tool.scm().checkout_root)
    10297        if not self._allow_local_commits:
    10398            self._tool.scm().ensure_no_local_commits(self._options.force_clean)
     
    121116
    122117
    123 class ApplyPatchStep(AbstractPatchStep):
     118class ApplyPatchStep(AbstractStep):
    124119    @classmethod
    125120    def options(cls):
     
    198193
    199194
    200 class ClosePatchStep(AbstractPatchStep):
     195class ClosePatchStep(AbstractStep):
    201196    def run(self, commit_log):
    202197        comment_text = bug_comment_from_commit_text(self._tool.scm(), commit_log)
     
    204199
    205200
    206 class CloseBugStep(AbstractPatchStep):
     201class CloseBugStep(AbstractStep):
    207202    @classmethod
    208203    def options(cls):
  • trunk/WebKitTools/Scripts/modules/commands/download.py

    r51889 r51893  
    3434
    3535from modules.bugzilla import parse_bug_id
    36 from modules.buildsteps import BuildSteps, EnsureBuildersAreGreenStep, CleanWorkingDirectoryStep, UpdateStep, CheckStyleStep, PrepareChangelogStep, CleanWorkingDirectoryStep
     36from modules.buildsteps import BuildSteps, EnsureBuildersAreGreenStep, CleanWorkingDirectoryStep, UpdateStep, BuildStep, CheckStyleStep, PrepareChangelogStep
    3737from modules.changelogs import ChangeLog
    3838from modules.comments import bug_comment_from_commit_text
     
    4242from modules.multicommandtool import Command
    4343from modules.processutils import ScriptError
    44 
    45 
    46 class BuildSequence(LandingSequence):
    47     def run(self):
    48         self.clean()
    49         self.update()
    50         self.build()
     44from modules.stepsequence import StepSequence
    5145
    5246
     
    5549    show_in_main_help = False
    5650    def __init__(self):
    57         options = BuildSteps.cleaning_options()
    58         options += BuildSteps.build_options()
    59         options += BuildSteps.land_options()
    60         Command.__init__(self, "Update working copy and build", "", options)
    61 
    62     def execute(self, options, args, tool):
    63         sequence = BuildSequence(None, options, tool)
    64         sequence.run_and_handle_errors()
     51        self._sequence = StepSequence([
     52            CleanWorkingDirectoryStep,
     53            UpdateStep,
     54            BuildStep
     55        ])
     56        Command.__init__(self, "Update working copy and build", "", self._sequence.options())
     57
     58    def execute(self, options, args, tool):
     59        self._sequence.run_and_handle_errors(tool, options)
    6560
    6661
  • trunk/WebKitTools/Scripts/modules/landingsequence.py

    r51890 r51893  
    4343        raise NotImplementedError, "subclasses must implement"
    4444
    45 
     45# FIXME: This class is slowing being killed and replaced with StepSequence.
    4646class LandingSequence:
    4747    def __init__(self, patch, options, tool):
Note: See TracChangeset for help on using the changeset viewer.