From 3a33f6be151ac98e4cfab2e03b3d68da8da276df Mon Sep 17 00:00:00 2001 From: ARIA Date: Sat, 22 Aug 2026 11:07:24 +0200 Subject: [PATCH] formatting changes --- .gitea/workflows/ci.yml | 130 ++++++++++++++++---------------- .gitea/workflows/release.yml | 2 +- app/desktopApp/build.gradle.kts | 81 ++++++++++++-------- 3 files changed, 116 insertions(+), 97 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c881229..a037bd8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,79 +1,79 @@ name: CI on: - push: - branches: [master] - pull_request: + push: + branches: [master] + pull_request: jobs: - gateway: - name: Gateway plugin tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + gateway: + name: Gateway plugin tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - name: Install uv - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Install uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh - # The gateway tests run inside the hermes-agent test harness, which is - # git-ignored in this repo (read-only research reference). CI clones the - # upstream repo at a pinned commit and drops in the vendored test copy. - # Bump the pinned SHA when you update the local hermes-agent checkout. - - name: Clone hermes-agent (pinned) - run: | - git clone https://github.com/NousResearch/hermes-agent.git hermes-agent - git -C hermes-agent fetch --depth 1 origin 31f62d76af068abde3c699f91190e8ded07fd05b - git -C hermes-agent checkout 31f62d76af068abde3c699f91190e8ded07fd05b + # The gateway tests run inside the hermes-agent test harness, which is + # git-ignored in this repo (read-only research reference). CI clones the + # upstream repo at a pinned commit and drops in the vendored test copy. + # Bump the pinned SHA when you update the local hermes-agent checkout. + - name: Clone hermes-agent (pinned) + run: | + git clone https://github.com/NousResearch/hermes-agent.git hermes-agent + git -C hermes-agent fetch --depth 1 origin 31f62d76af068abde3c699f91190e8ded07fd05b + git -C hermes-agent checkout 31f62d76af068abde3c699f91190e8ded07fd05b - - name: Sync venv - run: | - echo "$HOME/.local/bin" >> "$GITHUB_PATH" - cd hermes-agent - # pytest lives in the `dev` extra — a plain `uv sync` leaves the - # venv without it and run_tests.sh refuses to run. - uv sync --extra dev + - name: Sync venv + run: | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + cd hermes-agent + # pytest lives in the `dev` extra — a plain `uv sync` leaves the + # venv without it and run_tests.sh refuses to run. + uv sync --extra dev - - name: Run android gateway tests - run: | - cp gateway-plugin/tests/test_android.py hermes-agent/tests/gateway/test_android.py - cd hermes-agent - ANDROID_PLUGIN_DIR="$GITHUB_WORKSPACE/gateway-plugin" \ - scripts/run_tests.sh tests/gateway/test_android.py + - name: Run android gateway tests + run: | + cp gateway-plugin/tests/test_android.py hermes-agent/tests/gateway/test_android.py + cd hermes-agent + ANDROID_PLUGIN_DIR="$GITHUB_WORKSPACE/gateway-plugin" \ + scripts/run_tests.sh tests/gateway/test_android.py - kotlin: - name: Kotlin tests (android host + desktop) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + kotlin: + name: Kotlin tests (android host + desktop) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: "21" + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "21" - # gradle.properties pins org.gradle.java.home to a local JDK path; - # strip it so CI uses the JDK installed by setup-java. - - name: Strip local JDK pin - run: sed -i '/^org\.gradle\.java\.home/d' app/gradle.properties + # gradle.properties pins org.gradle.java.home to a local JDK path; + # strip it so CI uses the JDK installed by setup-java. + - name: Strip local JDK pin + run: sed -i '/^org\.gradle\.java\.home/d' app/gradle.properties - - name: Install Android SDK - run: | - export ANDROID_HOME="$HOME/android-sdk" - mkdir -p "$ANDROID_HOME/cmdline-tools" - curl -fsSL -o /tmp/ct.zip \ - https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip - unzip -q /tmp/ct.zip -d "$ANDROID_HOME/cmdline-tools" - mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" - # Finite input from a file: `yes | sdkmanager` dies with SIGPIPE - # (exit 141) under Gitea's `bash -e -o pipefail` once sdkmanager - # exits before `yes` is done writing. - for i in $(seq 100); do echo y; done > /tmp/sdk_licenses_yes.txt - "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses < /tmp/sdk_licenses_yes.txt > /dev/null - echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV" - echo "sdk.dir=$ANDROID_HOME" > app/local.properties + - name: Install Android SDK + run: | + export ANDROID_HOME="$HOME/android-sdk" + mkdir -p "$ANDROID_HOME/cmdline-tools" + curl -fsSL -o /tmp/ct.zip \ + https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip + unzip -q /tmp/ct.zip -d "$ANDROID_HOME/cmdline-tools" + mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" + # Finite input from a file: `yes | sdkmanager` dies with SIGPIPE + # (exit 141) under Gitea's `bash -e -o pipefail` once sdkmanager + # exits before `yes` is done writing. + for i in $(seq 100); do echo y; done > /tmp/sdk_licenses_yes.txt + "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses < /tmp/sdk_licenses_yes.txt > /dev/null + echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV" + echo "sdk.dir=$ANDROID_HOME" > app/local.properties - # Host-side tests only (no device needed). AGP auto-downloads the - # missing SDK platforms (licenses accepted above). - - name: Run host tests - working-directory: app - run: ./gradlew :shared:testAndroidHostTest :shared:desktopTest + # Host-side tests only (no device needed). AGP auto-downloads the + # missing SDK platforms (licenses accepted above). + - name: Run host tests + working-directory: app + run: ./gradlew :shared:testAndroidHostTest :shared:desktopTest diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 1316c83..c3333d1 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -203,4 +203,4 @@ jobs: curl -sf -X POST -H "$AUTH" -F "attachment=@$f" \ "$API/releases/$RELEASE_ID/attachments" > /dev/null done - echo "Done: $SERVER/$REPO/releases/tag/$TAG" \ No newline at end of file + echo "Done: $SERVER/$REPO/releases/tag/$TAG" diff --git a/app/desktopApp/build.gradle.kts b/app/desktopApp/build.gradle.kts index 4fb1573..ff18200 100644 --- a/app/desktopApp/build.gradle.kts +++ b/app/desktopApp/build.gradle.kts @@ -12,11 +12,12 @@ val arch = System.getProperty("os.arch") ?: "amd64" // CI passes -PappVersion= (release workflow); local builds keep the // default. jpackage requires a plain semver (no leading "v"). val appVersion = (project.findProperty("appVersion") as? String) ?: "0.1.0" -val desktopTarget = when { - os.isMacOsX -> if (arch == "aarch64") "macos-arm64" else "macos-x64" - os.isWindows -> "windows-x64" - else -> if (arch == "aarch64") "linux-arm64" else "linux-x64" -} +val desktopTarget = + when { + os.isMacOsX -> if (arch == "aarch64") "macos-arm64" else "macos-x64" + os.isWindows -> "windows-x64" + else -> if (arch == "aarch64") "linux-arm64" else "linux-x64" + } dependencies { implementation(project(":shared")) @@ -48,19 +49,21 @@ afterEvaluate { val jpackageInputDir = layout.buildDirectory.dir("jpackage-input") -val fatJar = tasks.register("fatJar") { - archiveClassifier.set("all") - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - manifest { attributes("Main-Class" to "iris.desktop.MainKt") } - from(sourceSets.main.get().output) - from({ - configurations.runtimeClasspath.get() - .filter { it.name.endsWith(".jar") } - .map { zipTree(it) } - }) { - exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA") +val fatJar = + tasks.register("fatJar") { + archiveClassifier.set("all") + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + manifest { attributes("Main-Class" to "iris.desktop.MainKt") } + from(sourceSets.main.get().output) + from({ + configurations.runtimeClasspath + .get() + .filter { it.name.endsWith(".jar") } + .map { zipTree(it) } + }) { + exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA") + } } -} // Stage the fat jar into the jpackage input dir. A dedicated Sync task keeps // the Exec task free of task references (configuration-cache compatible) and @@ -76,23 +79,39 @@ tasks.register("jpackage") { val jpackageBin = file("${System.getProperty("java.home")}/bin/jpackage") val type = (project.findProperty("jpackageType") as? String) ?: "app-image" val inputDir = jpackageInputDir.get().asFile - val destDir = layout.buildDirectory.dir("jpackage").get().asFile + val destDir = + layout.buildDirectory + .dir("jpackage") + .get() + .asFile inputs.dir(inputDir) outputs.dir(destDir) commandLine( if (jpackageBin.exists()) jpackageBin.absolutePath else "jpackage", - "--name", "iris", - "--app-version", appVersion, - "--vendor", "Iris", - "--type", type, - "--input", inputDir.absolutePath, - "--main-jar", "desktopApp-all.jar", - "--main-class", "iris.desktop.MainKt", - "--icon", file("src/main/resources/icon.png").absolutePath, - "--dest", destDir.absolutePath, - "--java-options", "-Xmx1g", + "--name", + "iris", + "--app-version", + appVersion, + "--vendor", + "Iris", + "--type", + type, + "--input", + inputDir.absolutePath, + "--main-jar", + "desktopApp-all.jar", + "--main-class", + "iris.desktop.MainKt", + "--icon", + file("src/main/resources/icon.png").absolutePath, + "--dest", + destDir.absolutePath, + "--java-options", + "-Xmx1g", // M9: KCEF (JCEF) AWT reflection access (see the JavaExec block above). - "--java-options", "--add-opens=java.desktop/sun.awt=ALL-UNNAMED", - "--java-options", "--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED", + "--java-options", + "--add-opens=java.desktop/sun.awt=ALL-UNNAMED", + "--java-options", + "--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED", ) -} \ No newline at end of file +}