Skip to content

Commit 2e3298e

Browse files
committed
fix: embed files even in debug mode, minor android build script improvements, update aw-webui
1 parent c3afce2 commit 2e3298e

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

aw-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ gethostname = "0.4"
2929
uuid = { version = "1.3", features = ["serde", "v4"] }
3030
clap = { version = "4.1", features = ["derive", "cargo"] }
3131
log-panics = { version = "2", features = ["with-backtrace"]}
32-
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path"] }
32+
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path", "debug-embed"] }
3333

3434
aw-datastore = { path = "../aw-datastore" }
3535
aw-models = { path = "../aw-models" }

aw-server/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use std::error::Error;
33
fn main() -> Result<(), Box<dyn Error>> {
44
// if aw-webui/dist does not exist or is empty, print a warning
55
let path = std::path::Path::new("../aw-webui/dist");
6-
if !path.exists() || path.read_dir()?.next().is_none() {
6+
let path_index = path.join("index.html");
7+
if !path_index.exists() {
78
println!("cargo:warning=`./aw-webui/dist` is not built, compiling without webui");
89
}
910

compile-android.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
set -e
44
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
55

6+
# if args, use them to select targets (x86_64, arm64, etc)
7+
if [ $# -gt 0 ]; then
8+
targets="$@"
9+
else
10+
# otherwise, default to all targets
11+
targets="arm64 x86_64 x86 arm"
12+
fi
13+
614
ORIG_PATH="$PATH"
715
ORIG_RUSTFLAGS="$RUSTFLAGS"
816

@@ -39,9 +47,12 @@ for archtargetstr in \
3947
target=$(echo $archtargetstr | cut -d " " -f 2)
4048
target_underscore=$(echo $target | sed 's/-/_/g')
4149

42-
4350
echo ARCH $arch
4451
echo TARGET $target
52+
if ! echo "$targets" | grep -q "$arch"; then
53+
echo "Skipping $arch..."
54+
continue
55+
fi
4556

4657
NDK_ARCH_DIR="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$platform-x86_64/bin"
4758
if [ ! -d "$NDK_ARCH_DIR" ]; then

0 commit comments

Comments
 (0)