summaryrefslogtreecommitdiff
path: root/update-from-external.sh
diff options
context:
space:
mode:
authorGrace Jia <xiaotonj@google.com>2023-08-16 12:58:26 -0700
committerGrace Jia <xiaotonj@google.com>2023-08-16 12:58:26 -0700
commit6176e57ecbc7182369bd0d79a3c97d96b9572037 (patch)
tree9ba95716a514ad95f96679d2b165c2ae67fa7b8d /update-from-external.sh
parent74e740bdb7f919ef64c9a6514165272091401a21 (diff)
downloadlibphonenumber-6176e57ecbc7182369bd0d79a3c97d96b9572037.tar.gz
Update libphonenumber to v8.13.18
Bug: b/292057567 Test: build, atest PhoneNumberUtilsTest Change-Id: I5075b76c302215199c173e24be96adb448ff2011
Diffstat (limited to 'update-from-external.sh')
-rwxr-xr-xupdate-from-external.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/update-from-external.sh b/update-from-external.sh
new file mode 100755
index 00000000..7cb64ed0
--- /dev/null
+++ b/update-from-external.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# Copyright 2016 The Android Open Source Project.
+#
+# Retrieves the specified version of libphonenumber into the
+# external/libphonenumber directory
+#
+# Does not create a GIT commit.
+if [ $# -ne 1 ]; then
+ echo "usage: $0 <version>"
+ echo " where <version> is the version number, e.g. 7.7.3"
+ exit 1
+fi
+if [ -z "$ANDROID_BUILD_TOP" ]; then
+ echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" 1>&2
+ exit 1
+fi
+
+VERSION=$1
+TAG=v$VERSION
+SOURCE="https://github.com/googlei18n/libphonenumber/"
+DIR=$ANDROID_BUILD_TOP/external/libphonenumber
+tmp=$(mktemp -d)
+trap "echo Removing temporary directory; rm -fr $tmp" EXIT
+echo "Fetching source into $tmp"
+(cd $tmp; git clone -q -b $TAG --depth 1 $SOURCE source)
+for i in $(ls $tmp/source/java)
+do
+ echo "Updating $i"
+ rm -fr $DIR/$i
+ cp -r $tmp/source/java/$i $DIR/$i
+ (cd $DIR; git add $i)
+done
+for i in README.version README.android
+do
+ echo "Updating $i"
+ cp $DIR/$i $tmp
+ sed "s|Version: .*$|Version: $VERSION|" < $tmp/$i > $DIR/$i
+ (cd $DIR; git add $i)
+done
+${DIR}/srcgen/generate_android_src.sh
+git add repackaged