From 3b485a0109037ac2e05acb200823809a9baf822d Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Thu, 26 Mar 2026 08:16:04 -0500 Subject: [PATCH] build: enable `-Xjvm-default=all` compiler flag (#4929) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- .github/copilot-instructions.md | 2 ++ AGENTS.md | 2 ++ GEMINI.md | 2 ++ .../org/meshtastic/buildlogic/KotlinAndroid.kt | 2 ++ codecov.yml | 15 ++++++++++----- desktop/build.gradle.kts | 5 ++++- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 82f6c153a..50d1255db 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -137,6 +137,8 @@ Always run commands in the following order to ensure reliability. Do not attempt - Pull request CI is main-only (`.github/workflows/pull-request.yml` targets `main` branch). - Gradle cache writes are trusted on `main` and merge queue runs (`merge_group` / `gh-readonly-queue/*`); other refs use read-only cache mode in reusable CI. - PR `check-changes` path filtering lives in `.github/workflows/pull-request.yml` and must include module dirs plus build/workflow entrypoints (`build-logic/**`, `gradle/**`, `.github/workflows/**`, `gradlew`, `settings.gradle.kts`, etc.) so CI is not skipped for infra-only changes. +- **Terminal Pagers:** When running shell commands like `git diff` or `git log`, ALWAYS use `--no-pager` (e.g., `git --no-pager diff`) to prevent the agent from getting stuck in an interactive prompt. +- **Text Search:** Prefer using `rg` (ripgrep) over `grep` or `find` for fast text searching across the codebase. ### C. Documentation Sync Update documentation continuously as part of the same change. If you modify architecture, module targets, CI tasks, validation commands, or agent workflow rules, update the relevant docs (`AGENTS.md`, `.github/copilot-instructions.md`, `GEMINI.md`, `docs/agent-playbooks/*`, `docs/kmp-status.md`, and `docs/decisions/architecture-review-2026-03.md`). diff --git a/AGENTS.md b/AGENTS.md index 97130eea3..a4bdbf32a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -139,6 +139,8 @@ Always run commands in the following order to ensure reliability. Do not attempt - Pull request CI is main-only (`.github/workflows/pull-request.yml` targets `main` branch). - Gradle cache writes are trusted on `main` and merge queue runs (`merge_group` / `gh-readonly-queue/*`); other refs use read-only cache mode in reusable CI. - PR `check-changes` path filtering lives in `.github/workflows/pull-request.yml` and must include module dirs plus build/workflow entrypoints (`build-logic/**`, `gradle/**`, `.github/workflows/**`, `gradlew`, `settings.gradle.kts`, etc.) so CI is not skipped for infra-only changes. +- **Terminal Pagers:** When running shell commands like `git diff` or `git log`, ALWAYS use `--no-pager` (e.g., `git --no-pager diff`) to prevent the agent from getting stuck in an interactive prompt. +- **Text Search:** Prefer using `rg` (ripgrep) over `grep` or `find` for fast text searching across the codebase. ### C. Documentation Sync Update documentation continuously as part of the same change. If you modify architecture, module targets, CI tasks, validation commands, or agent workflow rules, update the relevant docs (`AGENTS.md`, `.github/copilot-instructions.md`, `GEMINI.md`, `docs/agent-playbooks/*`, `docs/kmp-status.md`, and `docs/decisions/architecture-review-2026-03.md`). diff --git a/GEMINI.md b/GEMINI.md index e4092c351..dd60dc47b 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -135,6 +135,8 @@ Always run commands in the following order to ensure reliability. Do not attempt - Pull request CI is main-only (`.github/workflows/pull-request.yml` targets `main` branch). - Gradle cache writes are trusted on `main` and merge queue runs (`merge_group` / `gh-readonly-queue/*`); other refs use read-only cache mode in reusable CI. - PR `check-changes` path filtering lives in `.github/workflows/pull-request.yml` and must include module dirs plus build/workflow entrypoints (`build-logic/**`, `gradle/**`, `.github/workflows/**`, `gradlew`, `settings.gradle.kts`, etc.) so CI is not skipped for infra-only changes. +- **Terminal Pagers:** When running shell commands like `git diff` or `git log`, ALWAYS use `--no-pager` (e.g., `git --no-pager diff`) to prevent the agent from getting stuck in an interactive prompt. +- **Text Search:** Prefer using `rg` (ripgrep) over `grep` or `find` for fast text searching across the codebase. ### C. Documentation Sync Update documentation continuously as part of the same change. If you modify architecture, module targets, CI tasks, validation commands, or agent workflow rules, update the relevant docs (`AGENTS.md`, `.github/copilot-instructions.md`, `GEMINI.md`, `docs/agent-playbooks/*`, `docs/kmp-status.md`, and `docs/decisions/architecture-review-2026-03.md`). diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt index d63ff91b6..fd9f307ad 100644 --- a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt +++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt @@ -188,6 +188,7 @@ private inline fun Project.configureKotlin() { "-Xcontext-parameters", "-Xannotation-default-target=param-property", "-Xskip-prerelease-check", + "-Xjvm-default=all", ) } } @@ -212,6 +213,7 @@ private inline fun Project.configureKotlin() { "-Xcontext-parameters", "-Xannotation-default-target=param-property", "-Xskip-prerelease-check", + "-Xjvm-default=all", ) } } diff --git a/codecov.yml b/codecov.yml index 41210aaf6..6e0989227 100644 --- a/codecov.yml +++ b/codecov.yml @@ -41,19 +41,24 @@ component_management: target: auto threshold: 1% individual_components: - - name: Core + - component_id: core + name: Core paths: - core/** - - name: Features + - component_id: features + name: Features paths: - feature/** - - name: App + - component_id: app + name: App paths: - app/** - - name: Desktop + - component_id: desktop + name: Desktop paths: - desktop/** - - name: Example + - component_id: example + name: Example paths: - mesh_service_example/** diff --git a/desktop/build.gradle.kts b/desktop/build.gradle.kts index 99a2079a8..618d67aeb 100644 --- a/desktop/build.gradle.kts +++ b/desktop/build.gradle.kts @@ -34,7 +34,10 @@ plugins { kotlin { jvmToolchain(17) - compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + freeCompilerArgs.add("-Xjvm-default=all") + } } // Exclude generated Compose resource files from detekt analysis