blob: 6d175949f548ce0da58e53eb7eeb2963040f99bf [file] [log] [blame]
Makoto Onuki91237e92010-02-02 15:06:52 -08001#!/bin/bash
2#
3# Copyright (C) 2010 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17#
Makoto Onuki217466e2010-02-04 13:09:28 -080018# You can remove exchange by running this script.
Makoto Onuki91237e92010-02-02 15:06:52 -080019#
20
21set -e # fail fast
22
23
24# Step 0. Make sure we're in the right directory, and the user really wants it.
25
26if [[ ! -d src/com/android/email/ ]] ; then
27 echo "Run the script in the root of the email source tree." 1>&2
28 exit 1
29fi
30
31echo ""
32echo -n "Do you wish to remove exchange support from the email app? (y/N):"
33
34read answer
35if [[ "$answer" != y ]] ; then
36 echo "Aborted." 1>&2
37 exit 1
38fi
39
40
41# Step 1. Remove all Exchange related packages.
42
43rm -fr src/com/android/exchange/ \
44 tests/src/com/android/exchange/
45
46
47# Step 2. Remove lines surrounded by START-EXCHANGE and END-EXCHANGE
48
49find . \( -name '*.java' -o -name '*.xml' -o -name 'Android.mk' \) -print0 |
50 xargs -0 sed -i -e '/EXCHANGE-REMOVE-SECTION-START/,/EXCHANGE-REMOVE-SECTION-END/d'
51
52
53# Step 3. Remove all imports from com.android.exchange (and its subpackages).
54
55find . -name '*.java' -print0 |
56 xargs -0 sed -i -e '/^import com\.android\.exchange/d'
57
58
59echo ""
60echo "Exchange support has been successfully removed."
61
62exit 0