Skip to content

Commit

Permalink
Re-save XIB files using Xcode 4.4.1 on Mac OS X 10.8.1.
Browse files Browse the repository at this point in the history
This also adds a PRESUBMIT check to enforce the policy described here:
http://dev.chromium.org/developers/design-documents/mac-xib-files

BUG=149763
TEST=Build chrome target on 10.6 with Xcode 3.2. Chromium.app launches and works.
TBR=mark@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10950010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157690 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rsesek@chromium.org committed Sep 20, 2012
1 parent da1276f commit a87daad
Show file tree
Hide file tree
Showing 53 changed files with 7,137 additions and 42,834 deletions.
1,215 changes: 249 additions & 966 deletions chrome/app/nibs/AboutIPC.xib

Large diffs are not rendered by default.

1,004 changes: 77 additions & 927 deletions chrome/app/nibs/AvatarMenuItem.xib

Large diffs are not rendered by default.

1,172 changes: 185 additions & 987 deletions chrome/app/nibs/BookmarkAllTabs.xib

Large diffs are not rendered by default.

1,315 changes: 279 additions & 1,036 deletions chrome/app/nibs/BookmarkBar.xib

Large diffs are not rendered by default.

1,097 changes: 187 additions & 910 deletions chrome/app/nibs/BookmarkBarFolderWindow.xib

Large diffs are not rendered by default.

1,072 changes: 156 additions & 916 deletions chrome/app/nibs/BookmarkBubble.xib

Large diffs are not rendered by default.

1,245 changes: 242 additions & 1,003 deletions chrome/app/nibs/BookmarkEditor.xib

Large diffs are not rendered by default.

878 changes: 79 additions & 799 deletions chrome/app/nibs/BookmarkNameFolder.xib

Large diffs are not rendered by default.

967 changes: 130 additions & 837 deletions chrome/app/nibs/BrowserWindow.xib

Large diffs are not rendered by default.

880 changes: 114 additions & 766 deletions chrome/app/nibs/ChromeToMobileBubble.xib

Large diffs are not rendered by default.

1,467 changes: 436 additions & 1,031 deletions chrome/app/nibs/CollectedCookies.xib

Large diffs are not rendered by default.

1,115 changes: 293 additions & 822 deletions chrome/app/nibs/ContentBlockedCookies.xib

Large diffs are not rendered by default.

933 changes: 116 additions & 817 deletions chrome/app/nibs/ContentBlockedGeolocation.xib

Large diffs are not rendered by default.

961 changes: 129 additions & 832 deletions chrome/app/nibs/ContentBlockedImages.xib

Large diffs are not rendered by default.

961 changes: 129 additions & 832 deletions chrome/app/nibs/ContentBlockedJavaScript.xib

Large diffs are not rendered by default.

1,016 changes: 105 additions & 911 deletions chrome/app/nibs/ContentBlockedMixedScript.xib

Large diffs are not rendered by default.

1,017 changes: 118 additions & 899 deletions chrome/app/nibs/ContentBlockedPlugins.xib

Large diffs are not rendered by default.

961 changes: 129 additions & 832 deletions chrome/app/nibs/ContentBlockedPopups.xib

Large diffs are not rendered by default.

971 changes: 131 additions & 840 deletions chrome/app/nibs/ContentProtocolHandlers.xib

Large diffs are not rendered by default.

2,009 changes: 707 additions & 1,302 deletions chrome/app/nibs/CookieDetailsView.xib

Large diffs are not rendered by default.

919 changes: 92 additions & 827 deletions chrome/app/nibs/DownloadItem.xib

Large diffs are not rendered by default.

690 changes: 71 additions & 619 deletions chrome/app/nibs/DownloadShelf.xib

Large diffs are not rendered by default.

1,004 changes: 122 additions & 882 deletions chrome/app/nibs/EditSearchEngine.xib

Large diffs are not rendered by default.

1,072 changes: 111 additions & 961 deletions chrome/app/nibs/ExtensionInstallPrompt.xib

Large diffs are not rendered by default.

1,126 changes: 106 additions & 1,020 deletions chrome/app/nibs/ExtensionInstallPromptBundle.xib

Large diffs are not rendered by default.

1,170 changes: 135 additions & 1,035 deletions chrome/app/nibs/ExtensionInstallPromptInline.xib

Large diffs are not rendered by default.

930 changes: 99 additions & 831 deletions chrome/app/nibs/ExtensionInstallPromptNoWarnings.xib

Large diffs are not rendered by default.

831 changes: 107 additions & 724 deletions chrome/app/nibs/ExtensionInstalledBubble.xib

Large diffs are not rendered by default.

785 changes: 83 additions & 702 deletions chrome/app/nibs/ExtensionInstalledBubbleBundle.xib

Large diffs are not rendered by default.

664 changes: 57 additions & 607 deletions chrome/app/nibs/FindBar.xib

Large diffs are not rendered by default.

924 changes: 70 additions & 854 deletions chrome/app/nibs/FirstRunBubble.xib

Large diffs are not rendered by default.

881 changes: 136 additions & 745 deletions chrome/app/nibs/FirstRunDialog.xib

Large diffs are not rendered by default.

979 changes: 95 additions & 884 deletions chrome/app/nibs/FullscreenExitBubble.xib

Large diffs are not rendered by default.

986 changes: 144 additions & 842 deletions chrome/app/nibs/GlobalErrorBubble.xib

Large diffs are not rendered by default.

948 changes: 108 additions & 840 deletions chrome/app/nibs/HttpAuthLoginSheet.xib

Large diffs are not rendered by default.

987 changes: 119 additions & 868 deletions chrome/app/nibs/HungRendererDialog.xib

Large diffs are not rendered by default.

1,055 changes: 163 additions & 892 deletions chrome/app/nibs/ImportProgressDialog.xib

Large diffs are not rendered by default.

709 changes: 62 additions & 647 deletions chrome/app/nibs/InfoBar.xib

Large diffs are not rendered by default.

691 changes: 19 additions & 672 deletions chrome/app/nibs/InfoBarContainer.xib

Large diffs are not rendered by default.

1,199 changes: 114 additions & 1,085 deletions chrome/app/nibs/MainMenu.xib

Large diffs are not rendered by default.

843 changes: 60 additions & 783 deletions chrome/app/nibs/Notification.xib

Large diffs are not rendered by default.

934 changes: 127 additions & 807 deletions chrome/app/nibs/OneClickSigninBubble.xib

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions chrome/app/nibs/PRESUBMIT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Presubmit script to verify that XIB changes are done with the right version.
See http://dev.chromium.org/developers/design-documents/mac-xib-files for more
information.
"""

import re

# Minimum is Mac OS X 10.8.1 (12B19).
HUMAN_DARWIN_VERSION = '10.8.x, x >= 1'
ALLOWED_DARWIN_VERSION = 12 # Darwin 12 = 10.8.
MINIMUM_DARWIN_RELEASE = 'B' # Release B = 10.8.1.

MINIMUM_IB_VERSION = 2549 # Xcode 4.4.1.
MAXIMUM_IB_VERSION = 2800 # Xcode 4.5.x.
HUMAN_IB_VERSION = '4.4.x, x >= 1'

SYSTEM_VERSION_RE = r'<string key="IBDocument\.SystemVersion">' + \
'([0-9]{,2})([A-Z])([0-9]+)</string>'

IB_VERSION_RE = \
r'<string key="IBDocument\.InterfaceBuilderVersion">([0-9]+)</string>'

def _CheckXIBSystemAndXcodeVersions(input_api, output_api, error_type):
affected_xibs = [x for x in input_api.AffectedFiles()
if x.LocalPath().endswith('.xib')]

incorrect_system_versions = []
incorrect_ib_versions = []

for xib in affected_xibs:
system_version = None
ib_version = None
for line in xib.NewContents():
m = re.search(SYSTEM_VERSION_RE, line)
if m:
system_version = (m.group(1), m.group(2), m.group(3))

m = re.search(IB_VERSION_RE, line)
if m:
ib_version = m.group(1)

if system_version is not None and ib_version is not None:
break

if system_version is None:
incorrect_system_versions.append(xib.LocalPath())
continue
if int(system_version[0]) != ALLOWED_DARWIN_VERSION:
incorrect_system_versions.append(xib.LocalPath())
continue
if system_version[1] < MINIMUM_DARWIN_RELEASE:
incorrect_system_versions.append(xib.LocalPath())
continue

if ib_version is None or int(ib_version) < MINIMUM_IB_VERSION or \
int(ib_version) >= MAXIMUM_IB_VERSION:
incorrect_ib_versions.append(xib.LocalPath())
continue

problems = []
if incorrect_system_versions:
problems.append(error_type(
'XIB files need to be saved on Mac OS X ' + HUMAN_DARWIN_VERSION,
items=incorrect_system_versions))
if incorrect_ib_versions:
problems.append(error_type(
'XIB files need to be saved using Xcode ' + HUMAN_IB_VERSION,
items=incorrect_ib_versions))
return problems

def CheckChangeOnUpload(input_api, output_api):
# Allow uploads to happen even if the presubmit fails, so that contributors
# can ask their reviewer or another person to re-save the XIBs for them.
return _CheckXIBSystemAndXcodeVersions(input_api, output_api,
error_type=output_api.PresubmitPromptWarning)

def CheckChangeOnCommit(input_api, output_api):
return _CheckXIBSystemAndXcodeVersions(input_api, output_api,
error_type=output_api.PresubmitError)
Loading

0 comments on commit a87daad

Please sign in to comment.