-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsetup_android_example.sh
executable file
·26 lines (20 loc) · 1.23 KB
/
setup_android_example.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -e
APP_PATH="../examples/android/xmtpv3_example"
PROJECT_NAME="xmtpv3"
mkdir -p $APP_PATH/app/src/main/java/com/example/xmtpv3_example/
# Copy the jniLibs folder to the example project
rm -rf $APP_PATH/app/src/main/jniLibs
cp -r jniLibs $APP_PATH/app/src/main/
# Copy the .kt files to the example project
rm -f $APP_PATH/app/src/main/java/$PROJECT_NAME.kt
rm -f $APP_PATH/app/src/main/java/libxmtp-version.txt
cp src/uniffi/$PROJECT_NAME/$PROJECT_NAME.kt $APP_PATH/app/src/main/java/
cp src/uniffi/$PROJECT_NAME/libxmtp-version.txt $APP_PATH/app/src/main/java/
# Copy MainActivity.kt and ExampleInstrumentedTest.kt to the example project (comment this out if copying to a different app)
rm -f $APP_PATH/app/src/main/java/com/example/xmtpv3_example/MainActivity.kt
ln examples/MainActivity.kt $APP_PATH/app/src/main/java/com/example/xmtpv3_example/MainActivity.kt
mkdir -p $APP_PATH/app/src/androidTest/java/com/example/xmtpv3_example/
rm -f $APP_PATH/app/src/androidTest/java/com/example/xmtpv3_example/ExampleInstrumentedTest.kt
ln examples/ExampleInstrumentedTest.kt $APP_PATH/app/src/androidTest/java/com/example/xmtpv3_example/ExampleInstrumentedTest.kt
echo "Now open the example project at $APP_PATH and build in Android Studio"