Repository navigation
Commit 65e9d80
authored
4.0.6 Feat: The Android update: working builds, smarter dependencies, and a build system that finally stays out of your way.
# Xed-Editor PRO — Release Notes
## Version 4.0.6 (versionCode 105)
This release consolidates the complete evolution of the background build system, Android project support, dependency management, and editor UX into a single cohesive update.
---
## Background Build System
### Builds now run in the background
Previously, tapping Run launched the full terminal screen. Builds now run headlessly inside the sandbox; the editor stays in front with the floating build view as the primary interface.
- `RunService` — a foreground service that executes the project via headless sandbox, streams stdout and stderr live into `RunOutputState`, and posts a progress notification with a Stop action. The build continues running if you leave the app.
- `ProjectRunner` — when the sandbox is installed, runs via `RunService` (no terminal UI). Only falls back to opening the terminal when the sandbox has not been set up yet, since that flow requires the terminal to download and extract the rootfs.
- Single-build rule preserved: `RunOutputState.begin()` is the atomic gate. The Run button turns into a Stop button while a build is active, and the floating view reflects only the Run button's build — never other terminal sessions.
### RunOutputState refactored
`RunOutputState` is no longer coupled to a terminal session. It exposes `begin(label)` (atomic gate), `onOutput(fullText)`, `onFinished(exitCode)`, `stop()` (via a pluggable stopper the service injects), `exitCode`, and an `expanded` UI flag. Output is ANSI-stripped so status lines and color sequences render cleanly instead of showing raw escape codes.
---
## Floating Build View
The build output panel has been substantially redesigned.
- Frosted, translucent glass container with rounded corners and margins normally; docks flush above the IME while the keyboard is open.
- All ANSI escape codes stripped from output.
- Spring/bounce open animation (dampingRatio 0.85 / StiffnessMedium) — snappier and more consistent opening and closing.
- Drag handle at the top with swipe gestures: swipe up to expand, swipe down to collapse. Tapping the bar or chevron still toggles.
- Compact monospace output (12sp, 16sp line height, 0 letter spacing) with tight padding so log lines read as a cohesive block rather than widely spaced entries.
- Horizontal scrolling in the expanded view: each log line stays on one line with no soft wrapping.
- Collapsed bar latest line slides up as new output arrives (stream-style), replacing the previous plain cross-fade.
- **Auto-scroll toggle** in the output footer: auto-scrolls to the newest line by default; a toggle button turns it on or off and stays highlighted when active.
- Status glyph reflects success or failure (green/red) once the build finishes. Stop while running; Dismiss once finished; Copy copies the full output.
- The editor background blur introduced in an earlier pass has been removed — it imposed a scroll performance cost with no meaningful runtime benefit.
- Animation retuned to a smooth, symmetrically bouncy feel (dampingRatio 0.82 / StiffnessMediumLow): consistent speed opening and closing, no more laggy minimise.
---
## Run Button Behavior
- **Project-aware execution:** when no file is open (or on a non-editor tab), the toolbar shows Run/Stop driven by the project selected in the drawer. The Run button reflects the directory/project you are working in, even with nothing open.
- **With a file open:** the editor's own Run button handles execution as before — no duplicate buttons.
- Run/Stop, the single-build gate, and background execution are preserved across all flows.
---
## Android Project Support
Android projects are now fully buildable end to end. The flow mirrors Android Studio's behaviour:
1. Create or open an Android project.
2. Open the Dependencies dialog and install the Android SDK, NDK (pick a version or Latest), CMake, and a JDK.
3. Tap **Sync** (beside Run) and wait for `BUILD SUCCESSFUL`.
4. Tap **Run** — builds `assembleDebug` and triggers the system install prompt.
### Critical template fix
The Android template previously emitted `includeGroupByRegex("com\.android.*")` in `settings.gradle.kts`. The `\.` sequence is an illegal escape in Kotlin DSL, causing a Gradle failure on every first build. Fixed to `com\\.android.*` / `com\\.google.*` (valid escaped dots), matching Android Studio output. The rest of the template was audited; no other illegal Kotlin escapes were found. (`gradle-wrapper.properties` uses `https\://`, which is correct for a `.properties` file.)
### Minimal template
The Android (Compose) template now generates a single `MainActivity.kt` file, self-contained and using `MaterialTheme` directly. The `ui/theme/{Color,Theme,Type}.kt` package and the example unit/instrumented test files have been removed. A new empty project has exactly one `.kt` file.
### Sync-before-Run gate
Android projects must complete a successful Gradle Sync once per session before Run will proceed. Pressing Run first shows a clear, detailed warning to Sync first (and to install the SDK/NDK from the Dependencies dialog if Sync fails). A successful Sync or build marks the project as synced for the session and unblocks Run.
### Gradle Sync button
A dedicated **Sync** command is shown beside Run for Android projects. Runs `./gradlew --refresh-dependencies tasks` in the background (the equivalent of Android Studio's sync step). Also shown in the global toolbar when no file is open, for the currently selected Android project.
### APK installation
After a successful Android build, `RunService` locates the newest debug APK under the project and launches the system installer via the app's `FileProvider` (copying the APK into the external files directory, which `file_paths` covers). `REQUEST_INSTALL_PACKAGES` is declared in the manifest. You confirm the install — the editor handles everything up to that prompt.
---
## Bug Fixes
### Fix: Run/Sync failed with "utils: No such file or directory"
**Root cause:** the background run path (`RunService` via `ubuntuProcess`) bypasses `MkSession`, which is what normally installs the terminal helper scripts. The `project_runner` script sourced `$LOCAL/bin/utils` (which provides `info`/`warn`/`error`/`command_exists`) but that file was never written — every helper call failed with "command not found", breaking all builds.
**Fix:** `ProjectRunner.run()` and `sync()` now call `setupTerminalFiles()` (idempotent) before launching, ensuring `utils` and the other helper scripts are present before execution begins.
### Fix: build output not shown when no file is open
The floating build view was nested inside the "files open" branch, so running from the no-file toolbar button produced no visible output. The content is now wrapped in a `Box` and the build view is an always-on overlay, shown whenever a build is active regardless of whether any file is open.
---
## Dependencies Dialog
The Dependencies dialog has been significantly expanded for Android development.
- **Android SDK:** installs `cmdline-tools`, `platform-tools`, `platforms android-35` and `android-34`, and `build-tools 35` and `34`. Also resolves and installs the latest available platform and build-tools live from `sdkmanager` at install time, so the installation does not go stale.
- **Android NDK:** new entry with a version dropdown. Includes a **Latest** option (default) that resolves the newest NDK at install time, plus pinned versions (27 / 26 / 25 / 23) if a specific version is required.
- **CMake:** new entry for native builds, resolving the latest available version as well as a pinned baseline (`cmake;3.22.1`).
- **Real-time output:** installs now stream output line-by-line into the dialog via `ubuntuProcess` instead of buffering the full result. Displays a per-item Installed / Failed status and an overall progress bar.
---
## Editor UX
### Create Project dialog
For templates with a package field (Android, Minecraft), the dialog now shows a live **Application ID** preview of the resolved package name. A warning is shown when both the package and author fields are empty, so the user understands the ID is being auto-generated from the project name (e.g. `com.example.app`).
### Settings in the drawer
A Settings item now sits in the drawer's navigation rail alongside Directory and Git, opening `SettingsActivity` directly. No longer buried in the editor's overflow menu.
### Extra keys toggle
The bottom `< ^ >` extra-keys bar now defaults to **off**. A new **Extra keys** toggle command is available in the editor toolbar overflow (3-dot) menu, highlighted when active. Existing users receive the toggle via a one-time toolbar migration; new installs start with it off.
### Open-directory warning
Before the system folder picker, a caution dialog explains that Android 11+ manually-opened directories can encounter terminal permission errors and that such issues are not supported. The OK button is locked for 30 seconds with a live countdown. Includes a Cancel button and a **Never show this again** toggle (`Settings.open_dir_warning_dismissed`).
---
## Auto Setup
The sandbox consent and setup flow has been upgraded to full-screen.
- **Consent screen:** full-screen dialog with a large title, message, live storage/data/time estimate, and Agree / Not now actions. Replaces the previous small dialog.
- **Progress screen:** now opaque and full-screen; the terminal runs silently behind it while live progress is displayed in front.
- **Full toolchain:** the setup script now installs and verifies each of: `apt update/upgrade`, `curl` / `git` / `wget` / `tar` / `unzip` / `zip` / `nano`, `build-essential` + `pkg-config`, `python3` + `pip` + `venv`, `Node.js` + `npm`, and `OpenJDK 17`. Errors still route to a prefilled GitHub issue.
---
## Dependency Downloader — Notes
The in-app dependency downloader installs tools **globally** inside the single shared Ubuntu sandbox (`apt-get install`), so `python3`, `node`, JDK, `cargo`, `go`, and the Android SDK are available to every project once installed. The dialog filters the shown catalog by the currently open project's detected type. Genuinely per-project pieces (`requirements.txt`, `node_modules`) are handled by the run script inside each project's folder.
---
## Version
| Field | Previous | Current |
|---|---|---|
| `versionName` | 4.0.5 | **4.0.6** |
| `versionCode` | 104 | **105** |68 files changed
Lines changed: 10558 additions & 2876 deletions
File tree
- .github/workflows
- app
- src/main
- core
- main/src/main
- assets
- templates
- terminal
- java/com/rk
- activities
- main
- terminal
- commands
- editor
- global
- components
- crashhandler
- drawer
- editor
- projects
- runner
- settings
- about
- debugOptions
- terminal
- tabs
- editor
- markdown
- terminal
- resources/src/main/res/values
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
| |||
83 | 80 | | |
84 | 81 | | |
85 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| 101 | + | |
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
| 103 | + | |
104 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
0 commit comments