aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2011-10-01 13:53:48 +0200
committerDavid 'Digit' Turner <digit@google.com>2011-10-07 17:09:50 +0200
commit4cda6eb43d6bbec1658a03e22cefbf091141389d (patch)
treed141c869c0d17a5b69f3b95b21cfbe4e56e96bc9
parentfa0e66095a21fcf1dba92da56fba29ec0883cfcb (diff)
downloadndk-4cda6eb43d6bbec1658a03e22cefbf091141389d.tar.gz
dev-platform-expand-all.sh: new script
This patch provides a new script that can call dev-platform-expand.sh for all API levels and all architectures automatically. This is useful to build a fully expanded tree in /tmp/ndk-$USER/platforms from the content of development/ndk Note that this only copies files, i.e. headers and symbol lists, it doesn't generate any shell libraries. Change-Id: Ib842c80b8985a7bc1b8f5764eed14ba7daec4216
-rwxr-xr-xbuild/tools/dev-platform-expand-all.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/build/tools/dev-platform-expand-all.sh b/build/tools/dev-platform-expand-all.sh
new file mode 100755
index 000000000..992db2f11
--- /dev/null
+++ b/build/tools/dev-platform-expand-all.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# dev-platform-expand-all.sh
+#
+# Call dev-platform-expand.sh for all API levels.
+#
+
+. `dirname $0`/prebuilt-common.sh
+PROGDIR=$(dirname $0)
+
+# We take by default stuff from $NDK/../development/ndk
+SRCDIR="$(cd $ANDROID_NDK_ROOT/../development/ndk/platforms && pwd)"
+register_var_option "--src-dir=<path>" SRCDIR "Source for compressed platforms"
+
+# The default destination directory is a temporary one
+DSTDIR=/tmp/ndk-$USER/platforms
+register_var_option "--dst-dir=<path>" DSTDIR "Destination directory"
+
+# Default architecture, note we can have several ones here
+ARCHS="arm,x86"
+register_var_option "--arch=<name>" ARCHS "List of target architectures"
+
+PROGRAM_PARAMETERS=""
+
+PROGRAM_DESCRIPTION=\
+"Call dev-platform-expand.sh for all API levels."
+
+extract_parameters "$@"
+
+# Check source directory
+if [ ! -d "$SRCDIR" ] ; then
+ echo "ERROR: Source directory doesn't exist: $SRCDIR"
+ exit 1
+fi
+if [ ! -d "$SRCDIR/android-3" ]; then
+ echo "ERROR: Source directory doesn't seem to be valid: $SRCDIR"
+ exit 1
+fi
+log "Using source directory: $SRCDIR"
+log "Using destination directory: $DSTDIR"
+log "Using architectures: $ARCHS"
+
+for PLATFORM in $API_LEVELS; do
+ dump "Expanding files for android-$PLATFORM"
+ $PROGDIR/dev-platform-expand.sh --platform=$PLATFORM --src-dir=$SRCDIR --dst-dir=$DSTDIR --arch=$(spaces_to_commas $ARCHS)
+ fail_panic "Could not expand android-$PLATFORM files!"
+done
+
+log "Done! See $DSTDIR"
+exit 0