diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1d296d915..3bd1ce670 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,11 @@ -# Acode Development Container - Standalone Docker Build -# -# This Dockerfile is for MANUAL Docker builds (docker build/run). -# Usage: -# docker build -t acode-dev .devcontainer/ +# Acode Development Container +# +# Devcontainer usage: automatic via devcontainer.json +# Standalone usage: +# docker build --target standalone -t acode-dev .devcontainer/ # docker run -it -v $(pwd):/workspaces/acode acode-dev -FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye +FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye AS base ARG ANDROID_PLATFORM=36 ARG ANDROID_BUILD_TOOLS=36.0.0 @@ -13,10 +13,7 @@ ARG CMDLINE_TOOLS_VERSION=11076708 ARG NODE_VERSION=22 ARG GRADLE_VERSION=8.11 -ENV ANDROID_HOME=/opt/android-sdk -ENV ANDROID_SDK_ROOT=/opt/android-sdk ENV GRADLE_HOME=/opt/gradle -ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${GRADLE_HOME}/bin" # removes broken yarn repo present in base image RUN rm -f /etc/apt/sources.list.d/yarn.list @@ -33,17 +30,26 @@ RUN wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}- && rm /tmp/gradle.zip \ && ln -s /opt/gradle-${GRADLE_VERSION} ${GRADLE_HOME} -# Install fnm and Node.js -# Not required, mostly. When dev containers are used. -# ENV FNM_DIR=/usr/local/fnm -# ENV PATH="${FNM_DIR}:${PATH}" -# RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \ -# && eval "$(${FNM_DIR}/fnm env)" \ -# && fnm install ${NODE_VERSION} \ -# && fnm default ${NODE_VERSION} \ -# && npm install -g pnpm +ENV PATH="${PATH}:${GRADLE_HOME}/bin" + +WORKDIR /workspaces/acode + +LABEL org.opencontainers.image.authors="Acode Foundation " +LABEL description="Development environment for building Acode - Code Editor for Android" + -# ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}" +# Devcontainer stage +# Android SDK and Node handled by devcontainer features. +FROM base AS devcontainer + + +# Standalone stage +# Includes Android SDK and Node/pnpm for plain docker build/run usage. +FROM base AS standalone + +ENV ANDROID_HOME=/usr/local/lib/android +ENV ANDROID_SDK_ROOT=/usr/local/lib/android +ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}" # Install Android SDK RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \ @@ -59,7 +65,12 @@ RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \ "platforms;android-${ANDROID_PLATFORM}" \ "build-tools;${ANDROID_BUILD_TOOLS}" -WORKDIR /workspaces/acode +# Install fnm and Node.js +ENV FNM_DIR=/usr/local/fnm +RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \ + && eval "$(${FNM_DIR}/fnm env)" \ + && fnm install ${NODE_VERSION} \ + && fnm default ${NODE_VERSION} \ + && npm install -g pnpm -LABEL maintainer="Acode Foundation" -LABEL description="Development environment for building Acode - Code Editor for Android" +ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a40d3ae21..6a7d809c4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,14 +1,17 @@ { "name": "Acode Development", "build": { - "dockerfile": "Dockerfile" + "dockerfile": "Dockerfile", + "target": "devcontainer" }, "containerEnv": { "JAVA_HOME": "/usr/local/openjdk-21" }, "remoteEnv": { - "JAVA_HOME": "/usr/local/openjdk-21" + "JAVA_HOME": "/usr/local/openjdk-21", + "ANDROID_SDK_ROOT": "${containerEnv:ANDROID_HOME}", + "PATH": "${containerEnv:PATH}:${containerEnv:ANDROID_HOME}/build-tools/36.0.0" }, "features": { @@ -16,7 +19,7 @@ "platform": "36", "build_tools": "36.0.0" }, - "ghcr.io/devcontainers/features/node:1": { + "ghcr.io/devcontainers/features/node:2.0": { "nodeGypDependencies": false, "installYarnUsingApt": false, "version": "lts", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4b61d19f..2457415d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Thank you for your interest in contributing to Acode! This guide will help you g ### Option 1: DevContainer (Recommended) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code or other editors that support DevContainers. +1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VS Code or other editors that support [DevContainers](https://containers.dev/). 2. Clone and open the repository: ```bash @@ -28,6 +28,9 @@ Thank you for your interest in contributing to Acode! This guide will help you g ### Option 2: Docker CLI (For Any Editor) +> [!NOTE] +> If you try to use Podman, Kindly note that it would not work properly until https://github.com/containers/buildah/pull/5845 is merged/implemented in Podman. + If your editor doesn't support DevContainers, you can use Docker directly: ```bash @@ -36,7 +39,7 @@ git clone https://github.com/Acode-Foundation/Acode.git cd Acode # Build the Docker image from our Dockerfile -docker build -t acode-dev .devcontainer/ +docker build --target standalone -t acode-dev .devcontainer/ # Run the container with your code mounted docker run -it --rm \ diff --git a/src/lang/id-id.json b/src/lang/id-id.json index ff86cb1c7..d20ab446e 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -726,6 +726,6 @@ "close other tabs": "Tutup Lainnya", "auto close tags": "Penutup tag otomatis", "settings-info-editor-auto-close-tags": "Menyisipkan tag penutup di berkas HTML, XML, Vue, Angular, dan templat PHP secara otomatis.", - "ui zoom": "UI zoom", - "settings-info-app-ui-zoom": "Scale text across the Acode interface." + "ui zoom": "Pembesaran UI", + "settings-info-app-ui-zoom": "Skalakan teks di seluruh antarmuka Acode." } diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index cb4cfa9e0..c4beb297d 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -723,8 +723,8 @@ "close tabs to right": "关闭右侧标签页", "close tabs to left": "关闭左侧标签页", "close other tabs": "关闭其他标签页", - "auto close tags": "Auto close tags", - "settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.", - "ui zoom": "UI zoom", - "settings-info-app-ui-zoom": "Scale text across the Acode interface." + "auto close tags": "自动补全闭合标签", + "settings-info-editor-auto-close-tags": "在 HTML、XML、Vue、Angular 和 PHP 模板文件中自动插入闭合标签。", + "ui zoom": "UI 缩放", + "settings-info-app-ui-zoom": "缩放所有 Acode 界面文字。" } diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index e546ab526..b94ace6d9 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -723,8 +723,8 @@ "close tabs to right": "關閉右側標籤頁", "close tabs to left": "關閉左側標籤頁", "close other tabs": "關閉其他標籤頁", - "auto close tags": "Auto close tags", - "settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.", - "ui zoom": "UI zoom", - "settings-info-app-ui-zoom": "Scale text across the Acode interface." + "auto close tags": "自動補全閉合標籤", + "settings-info-editor-auto-close-tags": "在 HTML、XML、Vue、Angular 和 PHP 模板文件中自動插入閉合標籤。", + "ui zoom": "UI 縮放", + "settings-info-app-ui-zoom": "縮放所有 Acode 介面文字。" }