Home | History | Annotate | Download | only in tools
      1 #!/bin/sh
      2 #
      3 # Copyright (C) 2011 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 # dev-platform-expand-all.sh
     18 #
     19 # Call dev-platform-expand.sh for all API levels.
     20 #
     21 
     22 . `dirname $0`/prebuilt-common.sh
     23 PROGDIR=$(dirname $0)
     24 
     25 # We take by default stuff from $NDK/../development/ndk
     26 SRCDIR="$(cd $ANDROID_NDK_ROOT/../development/ndk/platforms && pwd)"
     27 register_var_option "--src-dir=<path>" SRCDIR "Source for compressed platforms"
     28 
     29 # The default destination directory is a temporary one
     30 DSTDIR=/tmp/ndk-$USER/platforms
     31 register_var_option "--dst-dir=<path>" DSTDIR "Destination directory"
     32 
     33 # Default architecture, note we can have several ones here
     34 ARCHS="arm,x86,mips"
     35 register_var_option "--arch=<name>" ARCHS "List of target architectures"
     36 
     37 PROGRAM_PARAMETERS=""
     38 
     39 PROGRAM_DESCRIPTION=\
     40 "Call dev-platform-expand.sh for all API levels."
     41 
     42 extract_parameters "$@"
     43 
     44 # Check source directory
     45 if [ ! -d "$SRCDIR" ] ; then
     46     echo "ERROR: Source directory doesn't exist: $SRCDIR"
     47     exit 1
     48 fi
     49 if [ ! -d "$SRCDIR/android-3" ]; then
     50     echo "ERROR: Source directory doesn't seem to be valid: $SRCDIR"
     51     exit 1
     52 fi
     53 log "Using source directory: $SRCDIR"
     54 log "Using destination directory: $DSTDIR"
     55 log "Using architectures: $ARCHS"
     56 
     57 for PLATFORM in $API_LEVELS; do
     58     dump "Expanding files for android-$PLATFORM"
     59     $PROGDIR/dev-platform-expand.sh --platform=$PLATFORM --src-dir=$SRCDIR --dst-dir=$DSTDIR --arch=$(spaces_to_commas $ARCHS)
     60     fail_panic "Could not expand android-$PLATFORM files!"
     61 done
     62 
     63 log "Done! See $DSTDIR"
     64 exit 0
     65