summaryrefslogtreecommitdiffstats
path: root/chrome/app/clean_mac_resources
blob: 36aefca35d83c42d1206c9171533247d4658063e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

# Copyright (c) 2009 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.

set -e

# Resources used to live in the .app bundle's Resources directory, but now,
# almost all of them have moved into the .framework.  To avoid having the old
# resources get in the way of non-clobber builds, this script removes them.

# TODO(mark): Remove this some time after October 20, 2009, allowing two weeks
# for the transition.

RESOURCES_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources"

# app.icns and document.icns are referenced by the app's Info.plist and must
# remain in the .app bundle.  chrome_debug.log is created by debug builds,
# there's no reason to remove it if present.
find "${RESOURCES_DIR}" -type f -depth 1 \
    \! -name app.icns \! -name document.icns \! -name chrome_debug.log \
    -exec rm -f {} \;

# Get rid of the locale.pak files in each .lproj directory.  The .lprojs
# themselves must stay, because they still hold InfoPlist.strings files with
# localized strings for things like the Finder's Get Info window.
find "${RESOURCES_DIR}" -type f -depth 2 -name locale.pak -exec rm -f {} \;

# Get rid of the Breakpad helpers (Breakpad-enabled builds only).
rm -rf "${RESOURCES_DIR}/crash_report_sender.app" \
       "${RESOURCES_DIR}/crash_inspector"