Skip to content

Commit

Permalink
fix: embed files even in debug mode, minor android build script impro…
Browse files Browse the repository at this point in the history
…vements, update aw-webui
  • Loading branch information
ErikBjare committed Sep 26, 2023
1 parent c3afce2 commit 2e3298e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aw-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gethostname = "0.4"
uuid = { version = "1.3", features = ["serde", "v4"] }
clap = { version = "4.1", features = ["derive", "cargo"] }
log-panics = { version = "2", features = ["with-backtrace"]}
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path"] }
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path", "debug-embed"] }

aw-datastore = { path = "../aw-datastore" }
aw-models = { path = "../aw-models" }
Expand Down
3 changes: 2 additions & 1 deletion aw-server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
// if aw-webui/dist does not exist or is empty, print a warning
let path = std::path::Path::new("../aw-webui/dist");
if !path.exists() || path.read_dir()?.next().is_none() {
let path_index = path.join("index.html");
if !path_index.exists() {
println!("cargo:warning=`./aw-webui/dist` is not built, compiling without webui");
}

Expand Down
13 changes: 12 additions & 1 deletion compile-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
set -e
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"

# if args, use them to select targets (x86_64, arm64, etc)
if [ $# -gt 0 ]; then
targets="$@"
else
# otherwise, default to all targets
targets="arm64 x86_64 x86 arm"
fi

ORIG_PATH="$PATH"
ORIG_RUSTFLAGS="$RUSTFLAGS"

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


echo ARCH $arch
echo TARGET $target
if ! echo "$targets" | grep -q "$arch"; then
echo "Skipping $arch..."
continue
fi

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

0 comments on commit 2e3298e

Please sign in to comment.