https://bugs.webkit.org/show_bug.cgi?id=174036
<rdar://problem/
33732709>
Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-08-07
Reviewed by Simon Fraser.
* Scripts/webkitpy/common/config/ports.py:
* Scripts/webkitpy/tool/commands/download.py:
* Scripts/webkitpy/tool/commands/download_unittest.py:
* Scripts/webkitpy/tool/commands/upload.py:
* Scripts/webkitpy/tool/commands/upload_unittest.py:
* Scripts/webkitpy/tool/steps/__init__.py:
* Scripts/webkitpy/tool/steps/options.py:
* Scripts/webkitpy/tool/steps/sortxcodeprojectfiles.py: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220372
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-07 Stephan Szabo <stephan.szabo@sony.com>
+
+ [XCode] webkit-patch should run sort-Xcode-project-file
+ https://bugs.webkit.org/show_bug.cgi?id=174036
+ <rdar://problem/33732709>
+
+ Reviewed by Simon Fraser.
+
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/sortxcodeprojectfiles.py: Added.
+
2017-08-07 Devin Rousso <drousso@apple.com>
Web Inspector: Preview Canvas path when viewing a recording
command = self.script_shell_command("run-api-tests")
return self._append_build_style_flag(command, build_style)
+ def run_sort_xcode_project_file_command(self):
+ return self.script_shell_command("sort-Xcode-project-file")
+
class IOSPort(DeprecatedPort):
port_flag_name = "ios-device"
name = "land-cowhand"
help_text = "Prepares a ChangeLog and lands the current working directory diff."
steps = [
+ steps.SortXcodeProjectFiles,
steps.PrepareChangeLog,
steps.EditChangeLog,
steps.CheckStyle,
options.architecture = 'MOCK ARCH'
options.iterate_on_new_tests = 0
options.group = None
+ options.sort_xcode_project = False
return options
def test_build(self):
steps = [
steps.PromptForBugOrTitle,
steps.CreateBug,
+ steps.SortXcodeProjectFiles,
steps.PrepareChangeLog,
]
steps.CheckStyle,
steps.PromptForBugOrTitle,
steps.CreateBug,
+ steps.SortXcodeProjectFiles,
steps.PrepareChangeLog,
steps.EditChangeLog,
steps.ConfirmDiff,
self.assert_execute_outputs(LandSafely(), [50000], expected_logs=expected_logs)
def test_prepare_diff_with_arg(self):
- self.assert_execute_outputs(Prepare(), [50000])
+ options = MockOptions()
+ options.sort_xcode_project = False
+ self.assert_execute_outputs(Prepare(), [50000], options=options)
def test_prepare(self):
+ options = MockOptions()
+ options.sort_xcode_project = False
expected_logs = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\ncomponent: MOCK component\ncc: MOCK cc\n"
- self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs)
+ self.assert_execute_outputs(Prepare(), [], expected_logs=expected_logs, options=options)
def test_upload(self):
options = MockOptions()
options.non_interactive = False
options.request_commit = False
options.review = True
+ options.sort_xcode_project = False
options.suggest_reviewers = False
expected_logs = """MOCK: user.open_url: file://...
Was that diff correct?
from webkitpy.tool.steps.reopenbugafterrollout import ReopenBugAfterRollout
from webkitpy.tool.steps.revertrevision import RevertRevision
from webkitpy.tool.steps.runtests import RunTests
+from webkitpy.tool.steps.sortxcodeprojectfiles import SortXcodeProjectFiles
from webkitpy.tool.steps.suggestreviewers import SuggestReviewers
from webkitpy.tool.steps.update import Update
from webkitpy.tool.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Request that the patch be added to the commit queue after review.")
review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.")
+ sort_xcode_project = make_option("--no-sort-xcode-project", action="store_false", dest="sort_xcode_project", default=True, help="Don't sort modified xcode projects.")
suggest_reviewers = make_option("--suggest-reviewers", action="store_true", default=False, help="Offer to CC appropriate reviewers.")
test = make_option("--test", action="store_true", dest="test", default=False, help="Run run-webkit-tests before committing.")
iterate_on_new_tests = make_option("--iterate-on-new-tests", action="store", type="int", dest="iterate_on_new_tests", default=0, help="Run run-webkit-tests on new tests only before committing, iterating a given number of time.")
--- /dev/null
+# Copyright (C) 2017 Sony Interactive Entertainment
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Sony Interactive Entertainment nor the names
+# of its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import re
+import sys
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+_log = logging.getLogger(__name__)
+
+
+class SortXcodeProjectFiles(AbstractStep):
+ @classmethod
+ def options(cls):
+ return AbstractStep.options() + [
+ Options.sort_xcode_project,
+ ]
+
+ def run(self, state):
+ if self._options.sort_xcode_project:
+ changed_pbxproj = [file for file in self._changed_files(state) if file.endswith(".pbxproj")]
+ if (len(changed_pbxproj) > 0):
+ args = self._tool.deprecated_port().run_sort_xcode_project_file_command()
+ args = args + changed_pbxproj
+ try:
+ output = self._tool.executive.run_and_throw_if_fail(args, self._options.quiet, cwd=self._tool.scm().checkout_root)
+ self.did_modify_checkout(state)
+ except ScriptError, e:
+ _log.error("Unable to sort modified xcode projects.")
+ sys.exit(1)