diff options
author | Chih-Hung Hsieh <chh@google.com> | 2020-09-24 01:25:34 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-09-24 01:25:34 +0000 |
commit | 01e9d937b4060faaab77451d2950d1112d194d8e (patch) | |
tree | 8ef1a1691a599f2646e7578edf3d0a8645e234c3 | |
parent | 319ecfb7b1f1887af54223be264131e925bc1469 (diff) | |
parent | efcbcebf7fcdb40af2995c5f1b761f80d6ae4c35 (diff) | |
download | proc-macro-nested-01e9d937b4060faaab77451d2950d1112d194d8e.tar.gz |
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
-rwxr-xr-x | post_update.sh | 16 | ||||
-rw-r--r-- | src/lib.rs | 4 |
2 files changed, 17 insertions, 3 deletions
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 @@ -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] |