diff --git a/.gitignore b/.gitignore index 3ca43ae..d7b439b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb +# Executables +**.fap diff --git a/build/.empty b/build/.empty new file mode 100644 index 0000000..e69de29 diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..4205cc1 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,26 @@ +# BACKEND # +## Parent Container +FROM debian + +## Creating Directories +RUN mkdir /src /app /tmp/src +WORKDIR /tmp/src + +## Copying compile script +COPY docker/flipper-dev.sh /bin/flipper-dev.sh +RUN chmod +x /bin/flipper-dev.sh + +## Installing Requisites +RUN apt update -y +RUN apt install -y wget curl build-essential + +## Downloading RUSTUP +RUN wget https://sh.rustup.rs -O /tmp/rustup.sh +RUN chmod +x /tmp/rustup.sh +RUN /tmp/rustup.sh -y + +## Flipper-Zero Build Target +RUN /root/.cargo/bin/rustup target add thumbv7em-none-eabihf + +# RUNTIME # +CMD "/bin/flipper-dev.sh" \ No newline at end of file diff --git a/docker/flipper-dev.sh b/docker/flipper-dev.sh new file mode 100644 index 0000000..fc0395e --- /dev/null +++ b/docker/flipper-dev.sh @@ -0,0 +1,8 @@ +# Copying source code into working directory +cp -r /src/* ./ + +# Building the Project +cargo build + +# Copy the .FAP file to the app directory +cp ./target/thumbv7em-none-eabihf/debug/*.fap /app/ \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..9eb890b --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,6 @@ +clear +echo "Building Project" +docker run --rm -it \ + -v "$PWD/project:/src:ro,z" \ + -v "$PWD/build:/app:Z" \ + flipper-dev \ No newline at end of file diff --git a/scripts/docker.sh b/scripts/docker.sh new file mode 100755 index 0000000..f828ff2 --- /dev/null +++ b/scripts/docker.sh @@ -0,0 +1,5 @@ +clear +echo "Building Docker Image" +docker build . \ + -t flipper-dev \ + -f docker/Dockerfile \ No newline at end of file