mirror of
https://github.com/IllusionMan1212/android-native-example-odin.git
synced 2026-10-24 10:12:33 +00:00
build.sh QoL stuff
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## TODO: handle different ABIs, currently only builds for arm64
|
|
||||||
|
|
||||||
# Create a debug signing key to sign our application.
|
# Create a debug signing key to sign our application.
|
||||||
if [ ! -f .keystore ]; then
|
if [ ! -f .keystore ]; then
|
||||||
keytool -genkey -dname "CN=Android Debug, O=Android, C=US" -keystore .keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 30000
|
keytool -genkey -dname "CN=Android Debug, O=Android, C=US" -keystore .keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 30000
|
||||||
@@ -9,13 +7,19 @@ if [ ! -f .keystore ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Build the shared lib
|
# Build the shared lib
|
||||||
odin build . -target:linux_arm64 -subtarget:android -build-mode:shared
|
if [[ $1 == "release" ]]; then
|
||||||
|
odin build . -target:linux_arm64 -subtarget:android -build-mode:shared -o:speed -define:RELEASE_BUILD=true
|
||||||
|
else
|
||||||
|
odin build . -target:linux_arm64 -subtarget:android -build-mode:shared -debug -show-system-calls
|
||||||
|
fi
|
||||||
|
|
||||||
|
name=$(basename "$PWD")
|
||||||
|
|
||||||
# Create the proper lib directories and move the shared lib to them
|
# Create the proper lib directories and move the shared lib to them
|
||||||
# Rename the shared lib to match what we specified in the AndroidManifest.xml file
|
# Rename the shared lib to match what we specified in the AndroidManifest.xml file
|
||||||
# for the android.app.lib_name metadata value
|
# for the android.app.lib_name metadata value
|
||||||
mkdir -p android/lib/lib/arm64-v8a
|
mkdir -p android/lib/lib/arm64-v8a
|
||||||
mv android-native-example-odin.so android/lib/lib/arm64-v8a/libmain.so
|
mv $name.so android/lib/lib/arm64-v8a/libmain.so || exit 1
|
||||||
|
|
||||||
# Bundle the directory into an apk
|
# Bundle the directory into an apk
|
||||||
odin bundle android android -android-keystore:.keystore -android-keystore-password:"android"
|
odin bundle android android -android-keystore:.keystore -android-keystore-password:"android"
|
||||||
|
|||||||
Reference in New Issue
Block a user