diff --git a/Makefile b/Makefile index 03f3658..feb0ca2 100644 --- a/Makefile +++ b/Makefile @@ -219,10 +219,12 @@ target/%/$(PACKAGE)/LICENSE: apps/$(PACKAGE)/LICENSE # at some point we need to map one to the other. It might as well be here. target/aarch64/$(PACKAGE)/_envoy: target/aarch64-unknown-linux-gnu/release/$(PACKAGE) target/armv7hf/$(PACKAGE)/_envoy: target/thumbv7neon-unknown-linux-gnueabihf/release/$(PACKAGE) -target/%/$(PACKAGE)/_envoy: apps/$(PACKAGE)/manifest.json apps/$(PACKAGE)/LICENSE $(wildcard apps/$(PACKAGE)/otherfiles/*) +target/%/$(PACKAGE)/_envoy: apps/$(PACKAGE)/manifest.json apps/$(PACKAGE)/LICENSE # Make sure we don't include any obsolete files in the `.eap` if [ -d $(@D) ]; then rm -r $(@D); fi mkdir -p $(@D) + if [ -d apps/$(PACKAGE)/html ]; then cp -r apps/$(PACKAGE)/html $(@D); fi + if [ -d apps/$(PACKAGE)/lib ]; then cp -r apps/$(PACKAGE)/lib $(@D); fi cp -r $^ $(@D) $(DOCKER_RUN) sh -c ". /opt/axis/acapsdk/environment-setup-* && acap-build --build no-build ." touch $@ diff --git a/apps/embedded_web_page/otherfiles/html/css/main.css b/apps/embedded_web_page/html/css/main.css similarity index 100% rename from apps/embedded_web_page/otherfiles/html/css/main.css rename to apps/embedded_web_page/html/css/main.css diff --git a/apps/embedded_web_page/otherfiles/html/index.html b/apps/embedded_web_page/html/index.html similarity index 100% rename from apps/embedded_web_page/otherfiles/html/index.html rename to apps/embedded_web_page/html/index.html diff --git a/apps/embedded_web_page/src/main.rs b/apps/embedded_web_page/src/main.rs index c62d2f5..45a1228 100644 --- a/apps/embedded_web_page/src/main.rs +++ b/apps/embedded_web_page/src/main.rs @@ -3,3 +3,25 @@ //! All applications require a program, but for this example it doesn't need to do anything, //! hence the empty main function. fn main() {} + +// TODO: Figure out how to resolve paths on host +// It is not particularly interesting for this app, but once the reverse proxy example is added it +// becomes feasible to serve the embedded web page also when testing on host. +#[cfg(not(target_arch = "x86_64"))] +#[cfg(test)] +mod tests { + use std::{env, path::PathBuf}; + + fn html_dir() -> PathBuf { + env::current_exe().unwrap().parent().unwrap().join("html") + } + #[test] + fn html_files_are_installed() { + assert!(html_dir().join("index.html").is_file()) + } + + #[test] + fn html_nested_files_are_installed() { + assert!(html_dir().join("css").join("main.css").is_file()) + } +}