Skip to content

Claude/build clu android ide pem2 n#2

Merged
Flynn013 merged 3 commits into
developfrom
claude/build-clu-android-ide-pem2N
May 16, 2026
Merged

Claude/build clu android ide pem2 n#2
Flynn013 merged 3 commits into
developfrom
claude/build-clu-android-ide-pem2N

Conversation

@Flynn013
Copy link
Copy Markdown
Owner

Describe what this PR changes and why.

BREAKING:
*

DEPRECATED:
*

closes

claude added 3 commits May 16, 2026 19:29
Adds .github/workflows/clu-android.yml with four jobs:

lint — runs :app:lintDebug; uploads HTML report as artifact
unit-tests — runs :app:testDebugUnitTest with --continue; publishes
  JUnit XML via mikepenz/action-junit-report; uploads HTML test report
assemble-debug — gated on unit-tests passing; runs :app:assembleDebug;
  uploads app-debug.apk artifact (clu-debug-<sha>) with 14-day retention;
  uploads build reports on failure for diagnosis
build-result — summary gate job (always runs); intended as the single
  required check for branch protection rules

Workflow triggers on push/PR to main or develop when clu-android/** or
the workflow file itself changes; workflow_dispatch for manual runs.
Concurrency: cancel-in-progress on feature branches, preserve on main/develop.

Android SDK setup:
  - ubuntu-latest pre-installed SDK used (ANDROID_SDK_ROOT)
  - sdkmanager installs platforms;android-36 and build-tools;36.0.0
  - licenses accepted non-interactively before each build step

Also adds the Gradle wrapper files (gradlew, gradlew.bat,
gradle/wrapper/gradle-wrapper.{jar,properties}) using Gradle 9.2.1
to match the existing demo-compose-app Android project in this repo.

https://claude.ai/code/session_01LMsWRrhnnF4uPD4tP5G8pL
- RamDisk: mounts tmpfs (size=4G) via root shell for Gradle build artifacts,
  protecting NAND flash from write amplification during iterative compile cycles;
  falls back transparently to context.cacheDir when root is unavailable
- AndroidBuildRunner: uses RamDisk when supplied — redirects buildDirectory via
  init.gradle, sets --project-cache-dir to ramdisk, adds --no-daemon and
  --max-workers=2 to avoid Phantom Process Killer termination mid-build;
  copies final APK to persistent storage and flushes ramdisk in finally block
- BuildGate: AtomicBoolean gate that blocks new builds when memory pressure hits
  TRIM_MEMORY_RUNNING_CRITICAL; resumed automatically below RUNNING_LOW
- CluApplication: overrides onTrimMemory to flip BuildGate, mounts RamDisk
  asynchronously after shell init, unmounts on termination
- Tests: RamDiskTest (mount/fallback/flush/unmount), AndroidBuildRunnerTest
  (BuildGate suspension, ramdisk APK preference, apkPath field)

https://claude.ai/code/session_01LMsWRrhnnF4uPD4tP5G8pL
… convenience API

NativeExecutionTools (ai.clu.brain.tools):
- Four @Tool-annotated methods wiring CLU's core capabilities to any LangChain4j
  AiServices-compatible LLM (Ollama/Gemma3, Anthropic, etc.)
- scaffoldComposeComponent: pure Kotlin file I/O — create/update/delete .kt files
  with parent-directory creation; no external binaries
- gradleBuild: delegates to AndroidBuildRunner + RamDisk tmpfs pipeline; returns
  BUILD SUCCESS/FAILED with APK path or first 2 000 chars of error output
- shizukuDeploy: pm install then am start via ShizukuDeployer; short-circuits on
  install failure; validates APK existence before any Shizuku call
- readLogcat: queries LogcatReader ring buffer; coerces maxLines to [1,200];
  converts blank filter strings to null (matches any)

ShizukuDeployer: add installAndLaunch() convenience method (install + launch in one call)

ShellSessionManager: accept optional RamDisk in init(); mount is now sequenced
inside the shell-init coroutine — runs after session is confirmed live on success,
or falls back immediately on failure — eliminating the previous timing race

CluApplication: pass RamDisk to ShellSessionManager.init() instead of launching
a separate mount coroutine; clarify globalExceptionHandler doc

NativeExecutionToolsTest: scaffold create/update/delete/error paths, BuildGate
gating on gradleBuild, APK-not-found and install-failure paths for shizukuDeploy,
empty-buffer sentinel and bounds-clamping for readLogcat

https://claude.ai/code/session_01LMsWRrhnnF4uPD4tP5G8pL
Copilot AI review requested due to automatic review settings May 16, 2026 20:09
@Flynn013 Flynn013 merged commit e10c23e into develop May 16, 2026
11 of 15 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants