blob: a80e6e9d5027ada8aebe67e51e0f5a79a1ca1081 [file] [log] [blame]
The Android Open Source Project52d4c302009-03-03 19:29:09 -08001#!/bin/bash
2#
Siva Velusamyde3fa5d2013-10-09 07:42:07 -07003# This script cleans up a set of files given as arguments for release in the SDK
The Android Open Source Project52d4c302009-03-03 19:29:09 -08004# Note that these files are modified in-place.
5#
6
7DIR=$1
8
9#
10# Remove BEGIN_INCLUDE and END_INCLUDE lines used by the javadoc.
11#
12# This does it by replacing these lines with blank lines so line numbers aren't
13# changed in the process, making it easier to match 3rd party complaints/questions
14# with the source tree.
15#
16# sed on Mac OS takes -i SUFFIX and sed on Linux takes -iSUFFIX
17#
18if [ $HOST_OS = darwin ] ; then
19find $DIR -name "*.java" -o -name "*.xml" | xargs -n 1 \
20 sed \
21 -e "s/.*BEGIN_INCLUDE(.*//" \
22 -e "s/.*END_INCLUDE(.*//" \
23 -i ""
24else
25find $DIR -name "*.java" -o -name "*.xml" | xargs -n 1 \
26 sed \
27 -e "s/.*BEGIN_INCLUDE(.*//" \
28 -e "s/.*END_INCLUDE(.*//" \
29 -i
30fi
31
32#
Siva Velusamyde3fa5d2013-10-09 07:42:07 -070033# Fix up the line endings of all text files. This also removes executable permissions.
The Android Open Source Project52d4c302009-03-03 19:29:09 -080034#
35if [ $HOST_OS = windows ] ; then
36 ENDING_TYPE=dos
37else
38 ENDING_TYPE=unix
39fi
40find $DIR -name "*.aidl" -o -name "*.css" -o -name "*.html" -o -name "*.java" \
Siva Velusamyde3fa5d2013-10-09 07:42:07 -070041 -o -name "*.js" -o -name "*.prop" -o -name "*.template" \
42 -o -name "*.txt" -o -name "*.windows" -o -name "*.xml" \
The Android Open Source Project52d4c302009-03-03 19:29:09 -080043 | xargs $HOST_OUT_EXECUTABLES/line_endings $ENDING_TYPE
44
45