Skip to content

Commit

Permalink
feat: added docker file for mobile builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ElhamAryanpur committed Mar 29, 2024
1 parent a2f5559 commit c4f1918
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 11 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# fork of Dockerfile at https://github.com/not-fl3/cargo-quad-apk

FROM archlinux

RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm gcc
RUN pacman -S --noconfirm jdk8-openjdk unzip wget cmake rustup openssl pkgconf

# github override HOME, so here we are
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN rustup toolchain install 1.71.0
RUN rustup default 1.71
RUN rustup toolchain install 1.77.0
RUN rustup default 1.77
RUN rustc --version

RUN rustup target add armv7-linux-androideabi
Expand Down Expand Up @@ -39,21 +42,16 @@ RUN cd /usr/local && \
rm android-ndk-r25-linux.zip
ENV NDK_HOME /usr/local/android-ndk-r25

# Copy contents to container. Should only use this on a clean directory
COPY . /root/cargo-apk

# This should be on top, but I am saving some time rebuilding the container. Sorry!
RUN pacman -S --noconfirm gcc
# Make directory for user code
RUN mkdir /root/src

# Install binary
RUN cargo install --path /root/cargo-apk
# Copy contents to container. Should only use this on a clean directory
COPY . /root/src/

# Remove source and build files
RUN rm -rf /root/cargo-apk
# Install mobile build
RUN cargo install --git https://github.com/tauri-apps/cargo-mobile2

# Add build-tools to PATH, for apksigner
ENV PATH="/opt/android-sdk-linux/build-tools/31.0.0/:${PATH}"

# Make directory for user code
RUN mkdir /root/src
WORKDIR /root/src
2 changes: 2 additions & 0 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* The license is same as the one on the root.
*/

// ? ADD VISIBILITY TAGS FOR DIFFERENT RENDER PASS TO USE AND RENDER ONLY THE OBJECTS THEY NEED

use crate::{
header::{uniform_type, Camera, Renderer, ShaderSettings, TextureData},
utils::default_resources::{DEFAULT_COLOR, DEFAULT_MATRIX_4, DEFAULT_SHADER, DEFAULT_TEXTURE},
Expand Down

0 comments on commit c4f1918

Please sign in to comment.