├── .devcontainer
    ├── Dockerfile
    └── devcontainer.json
├── .gitattributes
├── .github
    └── workflows
    │   └── build.yaml
├── .gitignore
├── .npmrc
├── README.md
├── index.html
├── package.json
├── pnpm-lock.yaml
├── src-tauri
    ├── .cargo
    │   ├── config.toml
    │   └── libgcc.a
    ├── .gitignore
    ├── Cargo.lock
    ├── Cargo.toml
    ├── build.rs
    ├── gen
    │   └── android
    │   │   └── tauri_app
    │   │       ├── .editorconfig
    │   │       ├── .gitignore
    │   │       ├── app
    │   │           ├── .gitignore
    │   │           ├── build.gradle.kts
    │   │           ├── proguard-rules.pro
    │   │           └── src
    │   │           │   └── main
    │   │           │       ├── AndroidManifest.xml
    │   │           │       ├── java
    │   │           │           └── nu
    │   │           │           │   └── simon
    │   │           │           │       └── tauri_app
    │   │           │           │           └── MainActivity.kt
    │   │           │       └── res
    │   │           │           ├── drawable-v24
    │   │           │               └── ic_launcher_foreground.xml
    │   │           │           ├── drawable
    │   │           │               └── ic_launcher_background.xml
    │   │           │           ├── layout
    │   │           │               └── activity_main.xml
    │   │           │           ├── mipmap-hdpi
    │   │           │               ├── ic_launcher.png
    │   │           │               ├── ic_launcher_foreground.png
    │   │           │               └── ic_launcher_round.png
    │   │           │           ├── mipmap-mdpi
    │   │           │               ├── ic_launcher.png
    │   │           │               ├── ic_launcher_foreground.png
    │   │           │               └── ic_launcher_round.png
    │   │           │           ├── mipmap-xhdpi
    │   │           │               ├── ic_launcher.png
    │   │           │               ├── ic_launcher_foreground.png
    │   │           │               └── ic_launcher_round.png
    │   │           │           ├── mipmap-xxhdpi
    │   │           │               ├── ic_launcher.png
    │   │           │               ├── ic_launcher_foreground.png
    │   │           │               └── ic_launcher_round.png
    │   │           │           ├── mipmap-xxxhdpi
    │   │           │               ├── ic_launcher.png
    │   │           │               ├── ic_launcher_foreground.png
    │   │           │               └── ic_launcher_round.png
    │   │           │           ├── values-night
    │   │           │               └── themes.xml
    │   │           │           └── values
    │   │           │               ├── colors.xml
    │   │           │               ├── strings.xml
    │   │           │               └── themes.xml
    │   │       ├── build.gradle.kts
    │   │       ├── buildSrc
    │   │           └── build.gradle.kts
    │   │       ├── gradle.properties
    │   │       ├── gradle
    │   │           └── wrapper
    │   │           │   ├── gradle-wrapper.jar
    │   │           │   └── gradle-wrapper.properties
    │   │       ├── gradlew
    │   │       ├── gradlew.bat
    │   │       └── settings.gradle
    ├── icons
    │   ├── 128x128.png
    │   ├── 128x128@2x.png
    │   ├── 32x32.png
    │   ├── Square107x107Logo.png
    │   ├── Square142x142Logo.png
    │   ├── Square150x150Logo.png
    │   ├── Square284x284Logo.png
    │   ├── Square30x30Logo.png
    │   ├── Square310x310Logo.png
    │   ├── Square44x44Logo.png
    │   ├── Square71x71Logo.png
    │   ├── Square89x89Logo.png
    │   ├── StoreLogo.png
    │   ├── icon.icns
    │   ├── icon.ico
    │   └── icon.png
    ├── src
    │   ├── lib.rs
    │   └── main.rs
    └── tauri.conf.json
├── src
    ├── assets
    │   ├── tauri.svg
    │   ├── typescript.svg
    │   └── vite.svg
    ├── main.ts
    └── styles.css
├── tsconfig.json
└── vite.config.ts
/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
  1 | # Arguments for setting up the SDK. Can be overridden in devcontainer.json but shouldn't be required
  2 | ARG ANDROID_SDK_TOOLS_VERSION="9477386"
  3 | ARG ANDROID_PLATFORM_VERSION="32"
  4 | ARG ANDROID_BUILD_TOOLS_VERSION="30.0.3"
  5 | ARG NDK_VERSION="25.0.8775105"
  6 | 
  7 | # Arguments related to setting up a non-root user for the container
  8 | ARG USERNAME=vscode
  9 | ARG USER_UID=1000
 10 | ARG USER_GID=$USER_UID
 11 | 
 12 | # Arguments for installing dependencies where DEPENDENCIES are Tauri dependencies and EXTRA_DEPENDENCIES is empty so that users can add more without interfering with Tauri
 13 | ARG DEPENDENCIES="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.1-dev wget libappimage-dev"
 14 | ARG EXTRA_DEPENDENCIES=""
 15 | 
 16 | # Argument for which image version to use
 17 | ARG IMAGE="mcr.microsoft.com/vscode/devcontainers/base"
 18 | ARG VARIANT="0-ubuntu-22.04"
 19 | 
 20 | ######################################
 21 | ## Base image
 22 | ## Installing dependencies
 23 | ######################################
 24 | FROM ${IMAGE}:${VARIANT} AS base_image
 25 | 
 26 | # Redefine arguments
 27 | ARG DEPENDENCIES
 28 | ARG EXTRA_DEPENDENCIES
 29 | 
 30 | # Non-interactive frontend
 31 | ENV DEBIAN_FRONTEND=noninteractive
 32 | 
 33 | # Install dependencies
 34 | RUN apt update \
 35 |     && apt upgrade -yq \
 36 |     # Install general dependencies
 37 |     && apt install -yq --no-install-recommends sudo default-jdk \
 38 |     wget curl git xz-utils zip unzip file socat clang libssl-dev \
 39 |     pkg-config git git-lfs bash-completion llvm \
 40 |     # Install Tauri dependencies as well as extra dependencies
 41 |     && apt install -yq ${DEPENDENCIES} ${EXTRA_DEPENDENCIES}
 42 | 
 43 | ######################################
 44 | ## Android SDK
 45 | ## Downloading and installing
 46 | ######################################
 47 | FROM base_image as android_sdk
 48 | WORKDIR /android_sdk
 49 | 
 50 | # Arguments are consumed by the first FROM they encounter, so we need to just explicitly tell Docker we need to use these again and again
 51 | ARG ANDROID_SDK_TOOLS_VERSION
 52 | ARG ANDROID_PLATFORM_VERSION
 53 | ARG ANDROID_BUILD_TOOLS_VERSION
 54 | ARG NDK_VERSION
 55 | 
 56 | # Environment variables inside the android_sdk step to ensure the SDK is built properly
 57 | ENV ANDROID_HOME="/android_sdk"
 58 | ENV ANDROID_SDK_ROOT="$ANDROID_HOME"
 59 | ENV NDK_HOME="${ANDROID_HOME}/ndk/${NDK_VERSION}"
 60 | ENV PATH=${PATH}:/android_sdk/cmdline-tools/latest/bin
 61 | ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
 62 | 
 63 | # Set up the SDK
 64 | RUN curl -C - --output android-sdk-tools.zip "https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS_VERSION}_latest.zip" \
 65 |     && mkdir -p /android_sdk/cmdline-tools/latest/ \
 66 |     && unzip -q android-sdk-tools.zip -d /android_sdk/cmdline-tools/latest/ \
 67 |     && mv /android_sdk/cmdline-tools/latest/cmdline-tools/* /android_sdk/cmdline-tools/latest \
 68 |     && rm -r /android_sdk/cmdline-tools/latest/cmdline-tools \
 69 |     && rm android-sdk-tools.zip \
 70 |     && yes | sdkmanager --licenses \
 71 |     && touch $HOME/.android/repositories.cfg \
 72 |     && sdkmanager "cmdline-tools;latest" \
 73 |     && sdkmanager "platform-tools" \
 74 |     && sdkmanager "emulator" \
 75 |     && sdkmanager "platforms;android-${ANDROID_PLATFORM_VERSION}" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" \
 76 |     && sdkmanager "ndk;${NDK_VERSION}" \
 77 |     && sdkmanager "system-images;android-${ANDROID_PLATFORM_VERSION};google_apis;x86_64"
 78 | 
 79 | # As an added bonus we set up a gradle.properties file that enhances Gradle performance
 80 | RUN echo "org.gradle.daemon=true" >> "/gradle.properties" \
 81 |     && echo "org.gradle.parallel=true" >> "/gradle.properties"
 82 | 
 83 | ######################################
 84 | ## Mold
 85 | ## Speeds up compilation
 86 | ######################################
 87 | FROM base_image as mold
 88 | WORKDIR /mold
 89 | 
 90 | # Install dependencies
 91 | RUN apt install -yq g++ libstdc++-10-dev zlib1g-dev cmake
 92 | 
 93 | # Clone mold 1.4.2, build it then install it
 94 | RUN git clone https://github.com/rui314/mold.git && \
 95 |     cd mold && \
 96 |     git checkout --quiet v1.4.2 && \
 97 |     make -j$(nproc) CXX=clang++ && \
 98 |     make install
 99 | 
100 | # Set up a config.toml file that makes Cargo use clang and mold
101 | RUN echo "[target.x86_64-unknown-linux-gnu]" >> /config.toml \
102 |     && echo "linker = \"clang\"" >> /config.toml \
103 |     && echo "rustflags = [\"-C\", \"link-arg=-fuse-ld=/usr/local/bin/mold\"]" >> /config.toml
104 | 
105 | ######################################
106 | ## Tauri CLI
107 | ## Temporary workaround
108 | ######################################
109 | FROM base_image as tauri-cli
110 | WORKDIR /build
111 | 
112 | # Install rustup
113 | RUN curl https://sh.rustup.rs -sSf | \
114 |     sh -s -- --default-toolchain stable -y
115 | 
116 | # Add Cargo bin to the PATH
117 | ENV PATH="/home/${USERNAME}/.cargo/bin:$PATH"
118 | 
119 | # Build and install the Tauri CLI
120 | RUN . ~/.cargo/env \
121 |     && git clone https://github.com/tauri-apps/tauri \
122 |     && cd tauri/tooling/cli \
123 |     && git checkout next \
124 |     && cargo build \
125 |     && cp target/debug/cargo-tauri /cargo-tauri
126 | 
127 | ######################################
128 | ## The finalized container
129 | ## Puts it all together
130 | ######################################
131 | FROM base_image
132 | 
133 | # We require these arguments in this image so we have to fetch them anew
134 | ARG ANDROID_SDK_TOOLS_VERSION
135 | ARG ANDROID_PLATFORM_VERSION
136 | ARG ANDROID_BUILD_TOOLS_VERSION
137 | ARG NDK_VERSION
138 | 
139 | ARG USERNAME
140 | ARG USER_UID
141 | ARG USER_GID
142 | 
143 | # Set up the required Android environment variables
144 | ENV ANDROID_HOME="/home/${USERNAME}/android_sdk"
145 | ENV ANDROID_SDK_ROOT="$ANDROID_HOME"
146 | ENV NDK_HOME="${ANDROID_HOME}/ndk/${NDK_VERSION}"
147 | ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator
148 | ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
149 | 
150 | # Ensure the user is a sudo user in case the developer needs to e.g. run apt install later
151 | RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
152 |     && chmod 0440 /etc/sudoers.d/$USERNAME
153 | 
154 | # Clean up to reduce container size
155 | RUN apt clean \
156 |     && rm -rf /var/lib/apt/lists/*
157 | 
158 | # Run the rest of the commands as the non-root user
159 | USER $USERNAME
160 | 
161 | # Install rustup
162 | RUN curl https://sh.rustup.rs -sSf | \
163 |     sh -s -- --default-toolchain stable -y
164 | 
165 | # Ensure the Cargo env gets loaded
166 | RUN echo "source /home/${USERNAME}/.cargo/env" >>/home/${USERNAME}/.bashrc
167 | 
168 | # Add Cargo bin to the PATH, primarily to ensure the next command can find rustup
169 | ENV PATH="/home/${USERNAME}/.cargo/bin:$PATH"
170 | 
171 | # Update Rust and install required Android targets
172 | RUN rustup update && rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
173 | 
174 | # Copy files from android_sdk
175 | COPY --from=android_sdk --chown=${USERNAME}:${USERNAME} /gradle.properties /home/${USERNAME}/.gradle/gradle.properties
176 | COPY --from=android_sdk --chown=${USERNAME}:${USERNAME} /android_sdk /home/${USERNAME}/android_sdk
177 | 
178 | # Create an emulator
179 | RUN echo no | avdmanager create avd -n dev -k "system-images;android-${ANDROID_PLATFORM_VERSION};google_apis;x86_64"
180 | 
181 | # Copy files from mold
182 | COPY --from=mold --chown=${USERNAME}:${USERNAME} /usr/local/bin/mold /usr/local/bin/mold
183 | COPY --from=mold --chown=${USERNAME}:${USERNAME} /config.toml /home/${USERNAME}/.cargo/config.toml
184 | 
185 | # Install the Tauri CLI
186 | COPY --from=tauri-cli --chown=${USERNAME}:${USERNAME} /cargo-tauri /usr/local/bin/cargo-tauri
187 | 
188 | 
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "name": "Tauri Android",
 3 |     "runArgs": [
 4 |         "--network=host", // Without this the Tauri CLI will fail because it can't find a valid IP, and adb won't find your devices
 5 |         "--device=/dev/kvm"
 6 |     ],
 7 |     "build": {
 8 |         "dockerfile": "Dockerfile",
 9 |         "args": {
10 |             // You don't need to set any of these since the defaults in the Dockerfile should
11 |             // be the best/recommended ones to use, but it's here if you need it
12 |             // "VARIANT": "ubuntu-22.04", // Which version the container should use
13 |             // "NDK_VERSION": "25.2.9519653", // The NDK version to use
14 |             // "ANDROID_PLATFORM_VERSION": "31", // The SDK version
15 |             // "ANDROID_BUILD_TOOLS_VERSION": "33.0.0", // Build tools version
16 |             // "ANDROID_SDK_TOOLS_VERSION": "9477386", // The command line tools version
17 |             // "DEPENDENCIES": "" // Don't override this, it's the Tauri dependencies to get through apt
18 |             // "EXTRA_DEPENDENCIES": "" // Any additional apt dependencies you require in addition to the Tauri dependencies
19 |         }
20 |     },
21 |     "settings": {},
22 |     "extensions": [
23 |         "rust-lang.rust-analyzer", // Recommended, rust-analyzer, to validate Rust code
24 |         "tauri-apps.tauri-vscode", // Recommended, tauri.conf.json schema
25 |         "ms-azuretools.vscode-docker" // Optional, primarily helps me develop the Dockerfile
26 |     ],
27 |     // "forwardPorts": [        5039    ],
28 |     "postCreateCommand": "pnpm i", // Optional, automatically runs `pnpm i` once the container starts running
29 |     "remoteUser": "vscode", // The name of the non-root user in the container
30 |     "features": {
31 |         // Sets up Node.js, npm, yarn and pnpm
32 |         // We could do this in the Dockerfile, but this is easier
33 |         "ghcr.io/devcontainers/features/node:1": {
34 |             "version": "lts"
35 |         }
36 |     }
37 | }
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.png filter=lfs diff=lfs merge=lfs -text
2 | *.jpg filter=lfs diff=lfs merge=lfs -text
3 | *.ico filter=lfs diff=lfs merge=lfs -text
4 | *.icns filter=lfs diff=lfs merge=lfs -text
5 | *.jpeg filter=lfs diff=lfs merge=lfs -text
6 | 
--------------------------------------------------------------------------------
/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
 1 | name: Build container
 2 | on:
 3 |   workflow_dispatch:
 4 |   push:
 5 |     branches:
 6 |       - "main"
 7 |     paths:
 8 |       - ".devcontainer/Dockerfile"
 9 |       - ".github/workflows/build.yaml"
10 | 
11 | concurrency:
12 |   group: ${{ github.workflow }}-${{ github.ref }}
13 |   cancel-in-progress: true
14 | 
15 | env:
16 |   REGISTRY: ghcr.io
17 |   LOCATION: simonhyll
18 |   IMAGE_NAME: devcontainer-tauri-android
19 | jobs:
20 |   build_deploy:
21 |     permissions:
22 |       contents: read
23 |       packages: write
24 |     runs-on: ubuntu-latest
25 |     timeout-minutes: 60
26 |     steps:
27 |       - name: Log in to the Container Registry
28 |         uses: docker/login-action@v2
29 |         with:
30 |           registry: ${{ env.REGISTRY }}
31 |           username: ${{ github.actor }}
32 |           password: ${{ secrets.GITHUB_TOKEN }}
33 | 
34 |       - uses: actions/checkout@v3.1.0
35 | 
36 |       - name: Extract metadata (tags, labels) for Docker
37 |         id: meta
38 |         uses: docker/metadata-action@v4
39 |         with:
40 |           images: ${{ env.REGISTRY }}/${{ env.LOCATION }}/${{ env.IMAGE_NAME }}
41 |           flavor: |
42 |             latest=true
43 |       - run: sudo rm -rf /usr/local/lib/android
44 |       - run: sudo rm -rf /usr/share/dotnet
45 |       - run: sudo rm -rf "$AGENT_TOOLSDIRECTORY"
46 |       - uses: docker/setup-buildx-action@v2
47 |       - name: Build and push Docker image
48 |         uses: docker/build-push-action@v3
49 |         with:
50 |           context: .devcontainer/
51 |           push: true
52 |           tags: ${{ steps.meta.outputs.tags }}
53 |           labels: ${{ steps.meta.outputs.labels }}
54 |           cache-from: type=gha
55 |           cache-to: type=gha,mode=min
56 | 
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
 1 | # Logs
 2 | logs
 3 | *.log
 4 | npm-debug.log*
 5 | yarn-debug.log*
 6 | yarn-error.log*
 7 | pnpm-debug.log*
 8 | lerna-debug.log*
 9 | 
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 | 
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 | 
26 | .pnpm-store
27 | *.so
28 | tauri-apps/
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | shamefully-hoist=true
2 | strict-peer-dependencies=false
3 | 
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
  1 | 
  4 | 
  5 | # Dev Container for Tauri+Android
  6 | 
  7 | This is by far the least painful way I've developed for Android thus far just in general. I'll never use Android on my host system ever again.
  8 | 
  9 | ## Current issues, READ THIS!!
 10 | 
 11 | ### 1. You need to add the following to `gen/android/APP/build.gradle.kts`
 12 | 
 13 | This is due to Kotlin not being able to detect the correct JVM target to use. [More info here](https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support)
 14 | 
 15 | I'll probably make a PR for this so it won't have to be added manually. But for now, after you've ran `tauri android init` you'll need to manually add these lines to avoid Kotlin using Java 8 as a target while Java decides to use Java 11.
 16 | 
 17 | ```java
 18 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
 19 | 
 20 | // https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
 21 | tasks.withType(JavaCompile::class.java) {
 22 |     sourceCompatibility = "11"
 23 |     targetCompatibility = "11"
 24 | }
 25 | 
 26 | tasks.withType(KotlinCompile::class.java) {
 27 |     kotlinOptions {
 28 |         jvmTarget = "11"
 29 |     }
 30 | }
 31 | ```
 32 | 
 33 | ### 2. The frontend can't be accessed in the devcontainer due to networking
 34 | 
 35 | This sounds more dire than it really is. If the Tauri CLI just has an option for specifying the IP and port manually it's as simple as creating a port forward on the host machine. The frontend already gets exposed to the host through e.g. http://localhost:1420, with port forwarding we could get it to be e.g. http://192.168.1.123:6969 and that should allow the android device to function normally. For now the only solution is to run the emulator from within the dev container, which doesn't perform very well, but at least it works.
 36 | 
 37 | ## Getting started
 38 | 
 39 | ### Setting up Devcontainer
 40 | 
 41 | 1. [Set up Devcontainer development](https://code.visualstudio.com/docs/devcontainers/tutorial)
 42 | 2. Copy the `.devcontainer` folder from this repo to your own project and glance over the files once so I'm not doing something malicious to your project
 43 | 3. (Optional): If you trust me you can remove the Dockerfile and instead put `ghcr.io/simonhyll/devcontainer-tauri-android` in the `{"image":""}` part of `devcontainer.json` and remove the `{"build:{}}"` section entirely. This makes you download my prebuilt version instead. If you don't go with this option you'll be building it yourself and that can take quite a bit of time. Note that this option means you can't customize the preinstalled SDK for your developers, they'll need to use the sdkmanager to update it every time they launch their setup if you don't use the same SDK version nr as I've built into it. If you just want something that I've verified works, go with my image. If you want something that you can customize, build it yourself. Just note that if every developer builds it every time you're not just wasting precious energy from the world, you're effectively giving every single developer you have a 5-15 minute break every time there's an update to the container. If you're a team, consider making a prebuilt version, just steal the workflow from this repo and you should be good to go with that
 44 | 
 45 | And that's it really! If you just use `Ctrl + Shift + P` and `>Dev Containers: Open folder in Container...` you'll be up and running.
 46 | 
 47 | Now you can either run the emulator inside the dev container, or run the emulator on your host and port forward adb.
 48 | 
 49 | If you run the emulator inside the dev container everything is just plug and play, just launch it then run `cargo tauri android dev` and you'll see your app running on Android. There's performance issues, but you don't have to set up your host at all.
 50 | 
 51 | If you require better performance you'll have to check the ADB section below for further instructions on that. It's also currently the only solution I have for running on a physical device until I figure out how to forward the physical device (most likely a mix of mounting something in /dev and ensuring WSL has it).
 52 | 
 53 | ### Option 1: ADB port forwarding
 54 | 
 55 | > NOTE!!! The frontend won't show up even if the app gets installed since the device can't connect to the containers IP. This is a known issue and will get fixed once the Tauri CLI gets patched to support setting the IP manually. Once that patch is out we can use port forwarding on the host side to expose the frontend running in the container to the device. Until
 56 | >
 57 | > Until this issue gets resolved I recommend using Option 2: Running the emulator inside the dev container
 58 | 
 59 | This approach relies on port forwarding from the host system into the dev container. The benefit of this approach is that you get maximum performance, since the emulator/physical device is used, the container just handles building the APK that gets installed.
 60 | 
 61 | ```bash
 62 | # Host machine
 63 | # First run adb devices just to verify that your device shows up, if it doesn't you'll need to keep at it until it does
 64 | adb devices
 65 | # If your device showed up, kill the adb server
 66 | adb kill-server
 67 | # Now start the server in a way that supports port forwarding
 68 | adb -a -P 5037 nodaemon server start
 69 | ```
 70 | 
 71 | ```bash
 72 | # Inside the devcontainer
 73 | # Get your host ip
 74 | HOST_IP=192.168.HOST.IP # REPLACE WITH YOUR HOSTS IP, I might figure out later how to do this dynamically
 75 | # Start socat port forwarding
 76 | socat TCP-LISTEN:5037,reuseaddr,fork TCP:${HOST_IP}:5037
 77 | # Run adb devices to ensure everything works as intended
 78 | adb devices
 79 | ```
 80 | 
 81 | If you can now see your device inside the devcontainer you're good to go!
 82 | 
 83 | ### Option 2: Running the emulator inside the devcontainer
 84 | 
 85 | You're gonna need to make sure you have `/dev/kvm` on your host system, on Windows you'll need to be using WSL to have that. This is related to making sure the container is capable of running the virtualization at a kernel level required for emulation.
 86 | 
 87 | Note that launching the emulator may appear black for a while. This is normal and is entirely related to the fact that it doesn't perform very well when ran inside the container. The fix for this is to instead opt for installing ADB and the emulator on your host system (you don't need the entire SDK and Android Studio for just those, just the cmdline-tools to install them), and use the port forwarding solution instead.
 88 | 
 89 | All you have to do is open a terminal inside the container and run the following command:
 90 | 
 91 | ```bash
 92 | emulator -avd dev -no-audio -no-snapshot-load -gpu swiftshader_indirect -qemu -m 2048 -netdev user,id=mynet0,hostfwd=tcp::5555-:5555
 93 | ```
 94 | 
 95 | ### Building and running
 96 | 
 97 | Start by trying to build the project. Retry the command 2-3 times before giving up!
 98 | 
 99 | ```bash
100 | # Initiate the project. Note that I has to use the JS version to init along with the fix for issue nr 1 in order for it to build
101 | pnpm tauri android init
102 | # Use the Cargo version for running/building since I've added one to the container based on the next branch which contains some commits that fix some issues
103 | cargo tauri android build
104 | # Run on a connected device
105 | cargo tauri android dev
106 | ```
107 | 
108 | ### Running `tauri dev`
109 | 
110 | #### Windows
111 | 
112 | Running something graphical from the dev container requires an X11 server to be running. On Windows we can accomplish this with the `vcxsrv` package.
113 | 
114 | 1. Run `choco install vcxsrv`
115 | 2. Run Xlaunch from the start menu, making sure you ✔️ the "Disable access control" option
116 | 3. Inside the dev container, run `export DISPLAY=192.168.HOST.IP:0.0`
117 | 4. Run `tauri dev` inside the dev container
118 | 
119 | That should be it!
120 | 
121 | #### Mac
122 | 
123 | I don't own a Mac so not sure what the steps here are, nor am I able to even attempt it. Sponsor me with the value of a Mac and I'll definitely buy one and look into it! :D
124 | 
125 | #### Linux
126 | 
127 | Haven't tested yet but it shouldn't be any more difficult than setting the DISPLAY value properly if you're on a system with an existing X11 server running (in my experience, most of them).
128 | 
129 | ## Performance
130 | 
131 | ### Use WSL2 on Windows!!!
132 | 
133 | If you're on Windows you should clone your project into the WSL filesystem. Just to be clear here, that does NOT mean just opening VSCode in WSL, you have to actually move the project into the WSL filesystem into e.g. `~/Projects/your-app`.
134 | 
135 | The reason for this is disk I/O related. If you keep the files on your Windows filesystem you're going to have absolutely horrible performance.
136 | 
137 | ### Allocate sufficient RAM (I use 16GB)
138 | 
139 | I had limited WSL to only use 4GB for a while, and that made VSCode constantly crash when I ran something heavy. The solution was simply to increase the RAM that WSL is allowed to use. This isn't related btw to building the container, it's related to compiling Tauri which can take a bit too much RAM.
140 | 
141 | You can probably also just limit the nr of threads running at the same time in case you don't have 16GB RAM to spare, but it'll severely reduce your performance.
142 | 
143 | ### I've added mold to speed up compilation a bit
144 | 
145 | Check the Dockerfile for more info on `mold`. It's basically just another linker that massively speeds up compilation times for your projects. If you don't want it simply remove it from the Dockerfile. It doesn't affect the Android build (at least not currently, I miiiight look into compiling it for Android, but most likely won't).
146 | 
147 | The reason I bring it up is to just make you aware of the fact that it's there. If you run `tauri build` you may actually compile it faster than on your host system!
148 | 
149 | Note that the quality of the build binary is somewhat lessened by `mold`. I only have second hand information on this, but apparently it can have a slightly larger size and lower performance. In my experience it's not any more unstable ay all, just a little bit less optimized. Perfect for development, but if you're going to build for production (which you shouldn't do in a **dev** container), don't use it.
150 | 
151 | ## Todo:
152 | 
153 | 1. Ensure the Tauri CLI gets the necessary patch for selecting an IP manually so that devices on the host system can show the frontend
154 | 2. Ensure the Kotlin version issue gets resolved in Tauri so that doesn't have to be applied manually
155 | 3. Optimize the Dockerfile a bit
156 | 4. Host a prebuilt Docker container on ghcr.io
157 | 5. Figure out why `git` isn't working for me correctly inside the dev container even if it should just magically work according to Microsoft
158 | 
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |   
 4 |     Tauri App 
 8 |     
 9 |     
18 |   
19 | 
20 |   
21 |     
22 |       
Welcome to Tauri! 
23 | 
24 |       
43 | 
44 |       
Click on the Tauri logo to learn more about the framework
45 | 
46 |       
47 |         
48 |           Greet 
50 |         
51 |       
52 | 
53 |       
54 |     
 3 |     
 9 |         
12 |             
13 |                  
17 |          
18 |      
19 | 
20 |  
21 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/java/nu/simon/tauri_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package nu.simon.tauri_app
2 | 
3 | class MainActivity : TauriActivity()
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
 1 | 
 7 |     
 8 |         
 9 |             
15 |                 18 |
21 |
 
22 |          
23 |      
24 |      
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
  1 | 
  2 | 
  7 |      
171 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 8 | 
 9 |      
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:320e552422179b81dae014ee6cc00561bd6e7455767b28f5518b8862a8c7987c
3 | size 3524
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7a9ae0632bfe5b28a1e6e9a7b38982fef62be07c95de46c26bd4f901ac6b9753
3 | size 14102
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:320e552422179b81dae014ee6cc00561bd6e7455767b28f5518b8862a8c7987c
3 | size 3524
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:75322a261ba38a23a25647af0d1298f204f3b3fafd317b8122a1b9a1f38284ff
3 | size 3377
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2425d59d27578f75ca97d31d9ae8385898badce3d6a1774bfc2f0fd191dc12c7
3 | size 9081
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:75322a261ba38a23a25647af0d1298f204f3b3fafd317b8122a1b9a1f38284ff
3 | size 3377
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:44e5c3dc1dfb392f65e3dbcc9b986d30f10dd95b57e306657e56281b572fa684
3 | size 7971
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b1d19b8b78d0ed6903dd35b7640afba29b4cf02f3780e0d1cd46d9ebcbc93695
3 | size 18900
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:44e5c3dc1dfb392f65e3dbcc9b986d30f10dd95b57e306657e56281b572fa684
3 | size 7971
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0b250fc4451dfd1e5a41128234d93225726a2984448b0b966af25677b167d8de
3 | size 12392
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ab9397c9827aef4b3a1f1f917fc722d54abcf26488880c8bf9c724d1e59ab905
3 | size 29506
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0b250fc4451dfd1e5a41128234d93225726a2984448b0b966af25677b167d8de
3 | size 12392
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:dae1ff05b101efea50e4b622fe6a3af8ba8f761162fa7c4fd864adc7cb39eeac
3 | size 16751
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:27cf0cdbc78bec8b9a14eaedb084c541a3c191fe5db89766e831fbfd21ce955d
3 | size 40510
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:dae1ff05b101efea50e4b622fe6a3af8ba8f761162fa7c4fd864adc7cb39eeac
3 | size 16751
4 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
 1 | 
 2 |     
 3 |     
16 |  
17 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |     #FFBB86FC 
 4 |     #FF6200EE 
 5 |     #FF3700B3 
 6 |     #FF03DAC5 
 7 |     #FF018786 
 8 |     #FF000000 
 9 |     #FFFFFFFF 
10 |  
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 | 
2 |     tauri-app 
3 |  
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
 1 | 
 2 |     
 3 |     
16 |  
17 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/build.gradle.kts:
--------------------------------------------------------------------------------
 1 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
 2 | 
 3 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
 4 | buildscript {
 5 |     repositories {
 6 |         google()
 7 |         mavenCentral()
 8 |     }
 9 |     dependencies {
10 |         classpath("com.android.tools.build:gradle:7.3.1")
11 |         classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
12 |         // NOTE: Do not place your application dependencies here; they belong
13 |         // in the individual module build.gradle files
14 |     }
15 | }
16 | 
17 | allprojects {
18 |     repositories {
19 |         google()
20 |         mavenCentral()
21 |     }
22 | }
23 | 
24 | tasks.register("clean").configure {
25 |     delete("build")
26 | }
27 | 
28 | // https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
29 | tasks.withType(JavaCompile::class.java) {
30 |     sourceCompatibility = "11"
31 |     targetCompatibility = "11"
32 | }
33 | 
34 | tasks.withType(KotlinCompile::class.java) {
35 |     kotlinOptions {
36 |         jvmTarget = "11"
37 |     }
38 | }
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
 1 | plugins {
 2 |     `kotlin-dsl`
 3 | }
 4 | 
 5 | gradlePlugin {
 6 |     plugins {
 7 |         create("pluginsForCoolKids") {
 8 |             id = "rustPlugin"
 9 |             implementationClass = "nu.simon.RustPlugin"
10 |         }
11 |     }
12 | }
13 | 
14 | repositories {
15 |     google()
16 |     mavenCentral()
17 | }
18 | 
19 | dependencies {
20 |     compileOnly(gradleApi())
21 |     implementation("com.android.tools.build:gradle:7.3.1")
22 | }
23 | 
24 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/gradle.properties:
--------------------------------------------------------------------------------
 1 | # Project-wide Gradle settings.
 2 | # IDE (e.g. Android Studio) users:
 3 | # Gradle settings configured through the IDE *will override*
 4 | # any settings specified in this file.
 5 | # For more details on how to configure your build environment visit
 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
 7 | # Specifies the JVM arguments used for the daemon process.
 8 | # The setting is particularly useful for tweaking memory settings.
 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/simonhyll/devcontainer-tauri-android/00d6a50477b184a24037f6ae64b344120bab6a4c/src-tauri/gen/android/tauri_app/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue May 10 19:22:52 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/gradlew:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env sh
  2 | 
  3 | #
  4 | # Copyright 2015 the original author or authors.
  5 | #
  6 | # Licensed under the Apache License, Version 2.0 (the "License");
  7 | # you may not use this file except in compliance with the License.
  8 | # You may obtain a copy of the License at
  9 | #
 10 | #      https://www.apache.org/licenses/LICENSE-2.0
 11 | #
 12 | # Unless required by applicable law or agreed to in writing, software
 13 | # distributed under the License is distributed on an "AS IS" BASIS,
 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15 | # See the License for the specific language governing permissions and
 16 | # limitations under the License.
 17 | #
 18 | 
 19 | ##############################################################################
 20 | ##
 21 | ##  Gradle start up script for UN*X
 22 | ##
 23 | ##############################################################################
 24 | 
 25 | # Attempt to set APP_HOME
 26 | # Resolve links: $0 may be a link
 27 | PRG="$0"
 28 | # Need this for relative symlinks.
 29 | while [ -h "$PRG" ] ; do
 30 |     ls=`ls -ld "$PRG"`
 31 |     link=`expr "$ls" : '.*-> \(.*\)$'`
 32 |     if expr "$link" : '/.*' > /dev/null; then
 33 |         PRG="$link"
 34 |     else
 35 |         PRG=`dirname "$PRG"`"/$link"
 36 |     fi
 37 | done
 38 | SAVED="`pwd`"
 39 | cd "`dirname \"$PRG\"`/" >/dev/null
 40 | APP_HOME="`pwd -P`"
 41 | cd "$SAVED" >/dev/null
 42 | 
 43 | APP_NAME="Gradle"
 44 | APP_BASE_NAME=`basename "$0"`
 45 | 
 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 48 | 
 49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
 50 | MAX_FD="maximum"
 51 | 
 52 | warn () {
 53 |     echo "$*"
 54 | }
 55 | 
 56 | die () {
 57 |     echo
 58 |     echo "$*"
 59 |     echo
 60 |     exit 1
 61 | }
 62 | 
 63 | # OS specific support (must be 'true' or 'false').
 64 | cygwin=false
 65 | msys=false
 66 | darwin=false
 67 | nonstop=false
 68 | case "`uname`" in
 69 |   CYGWIN* )
 70 |     cygwin=true
 71 |     ;;
 72 |   Darwin* )
 73 |     darwin=true
 74 |     ;;
 75 |   MINGW* )
 76 |     msys=true
 77 |     ;;
 78 |   NONSTOP* )
 79 |     nonstop=true
 80 |     ;;
 81 | esac
 82 | 
 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
 84 | 
 85 | 
 86 | # Determine the Java command to use to start the JVM.
 87 | if [ -n "$JAVA_HOME" ] ; then
 88 |     if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
 89 |         # IBM's JDK on AIX uses strange locations for the executables
 90 |         JAVACMD="$JAVA_HOME/jre/sh/java"
 91 |     else
 92 |         JAVACMD="$JAVA_HOME/bin/java"
 93 |     fi
 94 |     if [ ! -x "$JAVACMD" ] ; then
 95 |         die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
 96 | 
 97 | Please set the JAVA_HOME variable in your environment to match the
 98 | location of your Java installation."
 99 |     fi
100 | else
101 |     JAVACMD="java"
102 |     which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 | 
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 | 
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 |     MAX_FD_LIMIT=`ulimit -H -n`
111 |     if [ $? -eq 0 ] ; then
112 |         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 |             MAX_FD="$MAX_FD_LIMIT"
114 |         fi
115 |         ulimit -n $MAX_FD
116 |         if [ $? -ne 0 ] ; then
117 |             warn "Could not set maximum file descriptor limit: $MAX_FD"
118 |         fi
119 |     else
120 |         warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 |     fi
122 | fi
123 | 
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 |     GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 | 
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 |     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 |     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 | 
134 |     JAVACMD=`cygpath --unix "$JAVACMD"`
135 | 
136 |     # We build the pattern for arguments to be converted via cygpath
137 |     ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 |     SEP=""
139 |     for dir in $ROOTDIRSRAW ; do
140 |         ROOTDIRS="$ROOTDIRS$SEP$dir"
141 |         SEP="|"
142 |     done
143 |     OURCYGPATTERN="(^($ROOTDIRS))"
144 |     # Add a user-defined pattern to the cygpath arguments
145 |     if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 |         OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 |     fi
148 |     # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 |     i=0
150 |     for arg in "$@" ; do
151 |         CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 |         CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
153 | 
154 |         if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
155 |             eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 |         else
157 |             eval `echo args$i`="\"$arg\""
158 |         fi
159 |         i=`expr $i + 1`
160 |     done
161 |     case $i in
162 |         0) set -- ;;
163 |         1) set -- "$args0" ;;
164 |         2) set -- "$args0" "$args1" ;;
165 |         3) set -- "$args0" "$args1" "$args2" ;;
166 |         4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 |         5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 |         6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 |         7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 |         8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 |         9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 |     esac
173 | fi
174 | 
175 | # Escape application args
176 | save () {
177 |     for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 |     echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 | 
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 | 
185 | exec "$JAVACMD" "$@"
186 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/gradlew.bat:
--------------------------------------------------------------------------------
 1 | @rem
 2 | @rem Copyright 2015 the original author or authors.
 3 | @rem
 4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
 5 | @rem you may not use this file except in compliance with the License.
 6 | @rem You may obtain a copy of the License at
 7 | @rem
 8 | @rem      https://www.apache.org/licenses/LICENSE-2.0
 9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | 
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem  Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 | 
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 | 
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 | 
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 | 
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 | 
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 | 
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 | 
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 | 
51 | goto fail
52 | 
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 | 
57 | if exist "%JAVA_EXE%" goto execute
58 | 
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 | 
65 | goto fail
66 | 
67 | :execute
68 | @rem Setup the command line
69 | 
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 | 
72 | 
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 | 
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 | 
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 | 
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 | 
89 | :omega
90 | 
--------------------------------------------------------------------------------
/src-tauri/gen/android/tauri_app/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | 
--------------------------------------------------------------------------------
/src-tauri/icons/128x128.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:19b4fec485db7df51a691fcce72a3dd6f983e754fc4262da7154e4a4c688f69e
3 | size 3512
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/128x128@2x.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:6c7660390d65217fe8de0892862254f47aee77e0af7096c75b8bfe168c5403f7
3 | size 7012
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/32x32.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1c6782dc65c8111c12cbc1882a0fea5e71ab8e51b18da2ce9580f5c88860ed02
3 | size 974
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square107x107Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:54f7a0f58c96a4b023c1edc4b53fc443e27dace50e345f6936fa29bc20f785ca
3 | size 2863
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square142x142Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:fec1e2080ca73cd4c4a123b23b1cd364059a8a8efeba3076e21dfefed390693b
3 | size 3858
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square150x150Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:65fb570cb0e61ffce02ad67784cb200a0bf058400300980a46fa0d0c8f43a77a
3 | size 3966
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square284x284Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ea0b7c5d4b1d1ab9c91d2f7c9b069c8dfbf4557b0649a5777d47332cde610262
3 | size 7737
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square30x30Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:cc72279c41b4ed343e8db7e7541ceef7b6b23edaa83d4e7338421dfcb8d63c33
3 | size 903
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square310x310Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9733a89c539115de3c49bd06720bfc99639d9a918f5df48a810e267cf3554119
3 | size 8591
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square44x44Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:10be9840e58fb018eb9029601d42008e16c0c9cfa66b8f9467fee94f600160d4
3 | size 1299
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square71x71Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:2937fc83324cd9a1fddcfefd5927c791af31996a6840bfb3e2f1d578ad4129de
3 | size 2011
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/Square89x89Logo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:12aed0e7ee06cb631427dc9da72c0c7ecf03857fbc4884d0c31f78314feb6c7f
3 | size 2468
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/StoreLogo.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:91a54024dd47230991546088f2e75d3e3199b3ccc9fe40f3f6b7d3bf1cbf7776
3 | size 1523
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/icon.icns:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:3dc10493b7de48a61de58f768f8a5708d3a44a068c148cedf0502b9b9b71ba5d
3 | size 98451
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/icon.ico:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:392206b573a809997f3ff16fe68f456a52e931c372107eade9572b329bbe3321
3 | size 86642
4 | 
--------------------------------------------------------------------------------
/src-tauri/icons/icon.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:273cd669e07c455ad1c7c095890a37984652157cee73128a867300067dfb80e7
3 | size 14183
4 | 
--------------------------------------------------------------------------------
/src-tauri/src/lib.rs:
--------------------------------------------------------------------------------
 1 | // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
 2 | #[tauri::command]
 3 | fn greet(name: &str) -> String {
 4 |     format!("Hello, {}! You've been greeted from Rust!", name)
 5 | }
 6 | 
 7 | #[cfg_attr(mobile, tauri::mobile_entry_point)]
 8 | pub fn run() {
 9 |     tauri::Builder::default()
10 |         .invoke_handler(tauri::generate_handler![greet])
11 |         .run(tauri::generate_context!())
12 |         .expect("error while running tauri application");
13 | }
14 | 
--------------------------------------------------------------------------------
/src-tauri/src/main.rs:
--------------------------------------------------------------------------------
1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!!
2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3 | 
4 | fn main() {
5 |     #[cfg(desktop)]
6 |     tauri_app_lib::run();
7 | }
8 | 
--------------------------------------------------------------------------------
/src-tauri/tauri.conf.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "build": {
 3 |     "beforeDevCommand": "pnpm dev",
 4 |     "beforeBuildCommand": "pnpm build",
 5 |     "devPath": "http://localhost:1420",
 6 |     "distDir": "../dist",
 7 |     "withGlobalTauri": true
 8 |   },
 9 |   "package": {
10 |     "productName": "tauri-app"
11 |   },
12 |   "tauri": {
13 |     "allowlist": {
14 |       "all": false,
15 |       "shell": {
16 |         "all": false,
17 |         "open": true
18 |       }
19 |     },
20 |     "bundle": {
21 |       "active": true,
22 |       "icon": [
23 |         "icons/32x32.png",
24 |         "icons/128x128.png",
25 |         "icons/128x128@2x.png",
26 |         "icons/icon.icns",
27 |         "icons/icon.ico"
28 |       ],
29 |       "identifier": "nu.simon.hyll-tauri-app",
30 |       "targets": "all"
31 |     },
32 |     "security": {
33 |       "csp": null
34 |     },
35 |     "updater": {
36 |       "active": false
37 |     },
38 |     "windows": [
39 |       {
40 |         "fullscreen": false,
41 |         "resizable": true,
42 |         "title": "tauri-app",
43 |         "width": 800,
44 |         "height": 600
45 |       }
46 |     ]
47 |   }
48 | }
--------------------------------------------------------------------------------
/src/assets/tauri.svg:
--------------------------------------------------------------------------------
1 | 
2 |  
7 | 
--------------------------------------------------------------------------------
/src/assets/typescript.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 4 | 
 7 | 
 8 | 
10 |  
25 |  
26 | 
--------------------------------------------------------------------------------
/src/assets/vite.svg:
--------------------------------------------------------------------------------
1 |