blob: 14dfec6a8b25ca4c79e4457cf3e0f79b9475366e [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001# Copyright (C) 2009 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the 'License');
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an 'AS IS' BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#
16# Usage:
17#
18# Source this file into your environment. Then:
19#
20# $ golden_builds sdk-sdk generic-eng generic-userdebug dream-eng
21#
22# will build a set of combos. This might take a while. Then you can
23# go make changes, and run:
24#
25# $ check_builds sdk-sdk generic-eng generic-userdebug dream-eng
26#
27# Go get dinner, and when you get back, there will be a file
28# test-builds/sizes.html that has a pretty chart of which files are
29# in which tree, and how big they are. In that chart, cells for files
30# that are missing are red, and rows where the file sizes are not all
31# the same will be blue.
32#
33
34TEST_BUILD_DIR=test-builds
35
36function do_builds
37{
38 PREFIX=$1
39 shift
40 while [ -n "$1" ]
41 do
42 rm -rf $TEST_BUILD_DIR/$PREFIX-$1
43 make -j6 PRODUCT-$1 dist DIST_DIR=$TEST_BUILD_DIR/$PREFIX-$1
44 if [ $? -ne 0 ] ; then
45 echo FAILED
46 return
47 fi
48 shift
49 done
50}
51
52function golden_builds
53{
54 rm -rf $TEST_BUILD_DIR/golden-* $TEST_BUILD_DIR/dist-*
55 do_builds golden "$@"
56}
57
58function check_builds
59{
60 rm -rf $TEST_BUILD_DIR/dist-*
61 do_builds dist "$@"
62 build/tools/compare_fileslist.py \
63 $TEST_BUILD_DIR/golden-*/installed-files.txt \
64 $TEST_BUILD_DIR/dist-*/installed-files.txt \
65 > $TEST_BUILD_DIR/sizes.html
66}
67