Skip to content

Commit ee2b807

Browse files
Merge branch 'main' into ajit/fix-fetch-auth-config
2 parents 83b1000 + d4b19f1 commit ee2b807

8 files changed

Lines changed: 226 additions & 155 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
# Acode Development Container - Standalone Docker Build
2-
#
3-
# This Dockerfile is for MANUAL Docker builds (docker build/run).
4-
# Usage:
5-
# docker build -t acode-dev .devcontainer/
1+
# Acode Development Container
2+
#
3+
# Devcontainer usage: automatic via devcontainer.json
4+
# Standalone usage:
5+
# docker build --target standalone -t acode-dev .devcontainer/
66
# docker run -it -v $(pwd):/workspaces/acode acode-dev
77

8-
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye
8+
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye AS base
99

1010
ARG ANDROID_PLATFORM=36
1111
ARG ANDROID_BUILD_TOOLS=36.0.0
1212
ARG CMDLINE_TOOLS_VERSION=11076708
1313
ARG NODE_VERSION=22
1414
ARG GRADLE_VERSION=8.11
1515

16-
ENV ANDROID_HOME=/opt/android-sdk
17-
ENV ANDROID_SDK_ROOT=/opt/android-sdk
1816
ENV GRADLE_HOME=/opt/gradle
19-
ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${GRADLE_HOME}/bin"
2017

2118
# removes broken yarn repo present in base image
2219
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}-
3330
&& rm /tmp/gradle.zip \
3431
&& ln -s /opt/gradle-${GRADLE_VERSION} ${GRADLE_HOME}
3532

36-
# Install fnm and Node.js
37-
# Not required, mostly. When dev containers are used.
38-
# ENV FNM_DIR=/usr/local/fnm
39-
# ENV PATH="${FNM_DIR}:${PATH}"
40-
# RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
41-
# && eval "$(${FNM_DIR}/fnm env)" \
42-
# && fnm install ${NODE_VERSION} \
43-
# && fnm default ${NODE_VERSION} \
44-
# && npm install -g pnpm
33+
ENV PATH="${PATH}:${GRADLE_HOME}/bin"
34+
35+
WORKDIR /workspaces/acode
36+
37+
LABEL org.opencontainers.image.authors="Acode Foundation <https://github.com/Acode-Foundation/Acode>"
38+
LABEL description="Development environment for building Acode - Code Editor for Android"
39+
4540

46-
# ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"
41+
# Devcontainer stage
42+
# Android SDK and Node handled by devcontainer features.
43+
FROM base AS devcontainer
44+
45+
46+
# Standalone stage
47+
# Includes Android SDK and Node/pnpm for plain docker build/run usage.
48+
FROM base AS standalone
49+
50+
ENV ANDROID_HOME=/usr/local/lib/android
51+
ENV ANDROID_SDK_ROOT=/usr/local/lib/android
52+
ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}"
4753

4854
# Install Android SDK
4955
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
@@ -59,7 +65,12 @@ RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
5965
"platforms;android-${ANDROID_PLATFORM}" \
6066
"build-tools;${ANDROID_BUILD_TOOLS}"
6167

62-
WORKDIR /workspaces/acode
68+
# Install fnm and Node.js
69+
ENV FNM_DIR=/usr/local/fnm
70+
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
71+
&& eval "$(${FNM_DIR}/fnm env)" \
72+
&& fnm install ${NODE_VERSION} \
73+
&& fnm default ${NODE_VERSION} \
74+
&& npm install -g pnpm
6375

64-
LABEL maintainer="Acode Foundation"
65-
LABEL description="Development environment for building Acode - Code Editor for Android"
76+
ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"

.devcontainer/devcontainer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
22
"name": "Acode Development",
33
"build": {
4-
"dockerfile": "Dockerfile"
4+
"dockerfile": "Dockerfile",
5+
"target": "devcontainer"
56
},
67

78
"containerEnv": {
89
"JAVA_HOME": "/usr/local/openjdk-21"
910
},
1011
"remoteEnv": {
11-
"JAVA_HOME": "/usr/local/openjdk-21"
12+
"JAVA_HOME": "/usr/local/openjdk-21",
13+
"ANDROID_SDK_ROOT": "${containerEnv:ANDROID_HOME}",
14+
"PATH": "${containerEnv:PATH}:${containerEnv:ANDROID_HOME}/build-tools/36.0.0"
1215
},
1316

1417
"features": {
1518
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
1619
"platform": "36",
1720
"build_tools": "36.0.0"
1821
},
19-
"ghcr.io/devcontainers/features/node:1": {
22+
"ghcr.io/devcontainers/features/node:2.0": {
2023
"nodeGypDependencies": false,
2124
"installYarnUsingApt": false,
2225
"version": "lts",

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Thank you for your interest in contributing to Acode! This guide will help you g
66

77
### Option 1: DevContainer (Recommended)
88

9-
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.
9+
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/).
1010

1111
2. Clone and open the repository:
1212
```bash
@@ -28,6 +28,9 @@ Thank you for your interest in contributing to Acode! This guide will help you g
2828
2929
### Option 2: Docker CLI (For Any Editor)
3030

31+
> [!NOTE]
32+
> 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.
33+
3134
If your editor doesn't support DevContainers, you can use Docker directly:
3235

3336
```bash
@@ -36,7 +39,7 @@ git clone https://github.com/Acode-Foundation/Acode.git
3639
cd Acode
3740

3841
# Build the Docker image from our Dockerfile
39-
docker build -t acode-dev .devcontainer/
42+
docker build --target standalone -t acode-dev .devcontainer/
4043

4144
# Run the container with your code mounted
4245
docker run -it --rm \

src/components/terminal/terminalManager.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,12 @@ class TerminalManager {
442442
const installResult = await Terminal.install(
443443
(message) => {
444444
// Remove stdout/stderr prefix for
445-
const cleanMessage = message.replace(/^(stdout|stderr)\s+/, "");
445+
const cleanMessage = this.formatInstallLog(message);
446446
installTerminal.component.write(`${cleanMessage}\r\n`);
447447
},
448-
(error) => {
448+
(...errorParts) => {
449449
// Remove stdout/stderr prefix
450-
const cleanError = error.replace(/^(stdout|stderr)\s+/, "");
450+
const cleanError = this.formatInstallLog(errorParts);
451451
installTerminal.component.write(
452452
`\x1b[31mError: ${cleanError}\x1b[0m\r\n`,
453453
);
@@ -458,21 +458,34 @@ class TerminalManager {
458458
if (installResult === true) {
459459
return { success: true };
460460
} else {
461+
const error =
462+
Terminal.lastInstallError ||
463+
"Terminal installation failed - process did not exit with code 0";
461464
return {
462465
success: false,
463-
error:
464-
"Terminal installation failed - process did not exit with code 0",
466+
error,
465467
};
466468
}
467469
} catch (error) {
468470
console.error("Terminal installation failed:", error);
469471
return {
470472
success: false,
471-
error: `Terminal installation failed: ${error.message}`,
473+
error: `Terminal installation failed: ${this.formatInstallLog(error)}`,
472474
};
473475
}
474476
}
475477

478+
formatInstallLog(value) {
479+
const values = Array.isArray(value) ? value : [value];
480+
const message = values
481+
.filter((entry) => entry != null)
482+
.map((entry) => Terminal.formatError(entry))
483+
.filter(Boolean)
484+
.join(" ");
485+
486+
return message.replace(/^(stdout|stderr)\s+/, "") || "Unknown error";
487+
}
488+
476489
/**
477490
* Create a terminal for showing installation progress
478491
* @returns {Promise<object>} Installation terminal instance

src/lang/id-id.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@
726726
"close other tabs": "Tutup Lainnya",
727727
"auto close tags": "Penutup tag otomatis",
728728
"settings-info-editor-auto-close-tags": "Menyisipkan tag penutup di berkas HTML, XML, Vue, Angular, dan templat PHP secara otomatis.",
729-
"ui zoom": "UI zoom",
730-
"settings-info-app-ui-zoom": "Scale text across the Acode interface.",
729+
"ui zoom": "Pembesaran UI",
730+
"settings-info-app-ui-zoom": "Skalakan teks di seluruh antarmuka Acode."
731731
"plugin-not-supported": "Plugin not supported",
732732
"plugin-not-supported-info": "The plugin was created for older version of Acode."
733-
}
733+
}

src/lang/zh-cn.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,10 @@
723723
"close tabs to right": "关闭右侧标签页",
724724
"close tabs to left": "关闭左侧标签页",
725725
"close other tabs": "关闭其他标签页",
726-
"auto close tags": "Auto close tags",
727-
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
728-
"ui zoom": "UI zoom",
729-
"settings-info-app-ui-zoom": "Scale text across the Acode interface.",
730-
"plugin-not-supported": "Plugin not supported",
726+
"auto close tags": "自动补全闭合标签",
727+
"settings-info-editor-auto-close-tags": "HTMLXMLVueAngular PHP 模板文件中自动插入闭合标签。",
728+
"ui zoom": "UI 缩放",
729+
"settings-info-app-ui-zoom": "缩放所有 Acode 界面文字。"
730+
"plugin-not-supported": "Plugin not supported",
731731
"plugin-not-supported-info": "The plugin was created for older version of Acode."
732-
}
732+
}

src/lang/zh-hant.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,10 @@
723723
"close tabs to right": "關閉右側標籤頁",
724724
"close tabs to left": "關閉左側標籤頁",
725725
"close other tabs": "關閉其他標籤頁",
726-
"auto close tags": "Auto close tags",
727-
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
728-
"ui zoom": "UI zoom",
729-
"settings-info-app-ui-zoom": "Scale text across the Acode interface.",
730-
"plugin-not-supported": "Plugin not supported",
726+
"auto close tags": "自動補全閉合標籤",
727+
"settings-info-editor-auto-close-tags": "HTMLXMLVueAngular PHP 模板文件中自動插入閉合標籤。",
728+
"ui zoom": "UI 縮放",
729+
"settings-info-app-ui-zoom": "縮放所有 Acode 介面文字。"
730+
"plugin-not-supported": "Plugin not supported",
731731
"plugin-not-supported-info": "The plugin was created for older version of Acode."
732-
}
732+
}

0 commit comments

Comments
 (0)