Add post_update.sh am: daef00fd01 am: 565e216014 am: efcbcebf7f

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/proc-macro-nested/+/1434798

Change-Id: Ibc1b4b26ab8b2ba29d1bb0c91ba97c10171d81ec
diff --git a/post_update.sh b/post_update.sh
new file mode 100755
index 0000000..befd02c
--- /dev/null
+++ b/post_update.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# $1 Path to the new version.
+# $2 Path to the old version.
+
+set -x
+set -e
+
+# out/count.rs should be copied after cargo build.
+# Change src/lib.rs to include files from ../out/
+SRCFILE=src/lib.rs
+OLDSTR='include!(concat!(env!("OUT_DIR"), "/count.rs"));'
+NEWSTR='include!("../out/count.rs");  // ANDROID'
+sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
+# Make sure that sed replaced $OLDSTR with $NEWSTR
+grep "$NEWSTR" $SRCFILE > /dev/null
diff --git a/src/lib.rs b/src/lib.rs
index 91089e0..a8b7694 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -43,9 +43,7 @@
 // ANDROID: Use std to allow building as a dylib.
 extern crate std;
 
-// ANDROID: count.rs generated and put in the out subdirectory.
-// include!(concat!(env!("OUT_DIR"), "/count.rs"));
-include!("../out/count.rs");
+include!("../out/count.rs");  // ANDROID
 
 #[doc(hidden)]
 #[macro_export]