mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(android): skip gradle resource tasks on linux arm
This commit is contained in:
40
test/scripts/run-android-gradle.test.ts
Normal file
40
test/scripts/run-android-gradle.test.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
linuxArmAndroidGradleSkipMessage,
|
||||
shouldSkipLinuxArmAndroidGradle,
|
||||
splitAndroidGradleArgs,
|
||||
} from "../../scripts/run-android-gradle.mjs";
|
||||
|
||||
describe("run-android-gradle", () => {
|
||||
it("splits Gradle args from an optional post command", () => {
|
||||
expect(
|
||||
splitAndroidGradleArgs([":app:installPlayDebug", "--", "adb", "shell", "am", "start"]),
|
||||
).toEqual({
|
||||
gradleArgs: [":app:installPlayDebug"],
|
||||
postArgs: ["adb", "shell", "am", "start"],
|
||||
});
|
||||
});
|
||||
|
||||
it("skips Linux ARM hosts by default because AAPT2 is x86_64-only", () => {
|
||||
expect(shouldSkipLinuxArmAndroidGradle({ arch: "arm64", platform: "linux" })).toBe(true);
|
||||
expect(shouldSkipLinuxArmAndroidGradle({ arch: "arm", platform: "linux" })).toBe(true);
|
||||
expect(shouldSkipLinuxArmAndroidGradle({ arch: "x64", platform: "linux" })).toBe(false);
|
||||
expect(shouldSkipLinuxArmAndroidGradle({ arch: "arm64", platform: "darwin" })).toBe(false);
|
||||
});
|
||||
|
||||
it("allows an explicit Linux ARM override", () => {
|
||||
expect(
|
||||
shouldSkipLinuxArmAndroidGradle({
|
||||
arch: "arm64",
|
||||
env: { OPENCLAW_ANDROID_GRADLE_ALLOW_LINUX_ARM: "1" },
|
||||
platform: "linux",
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("explains the skip with the override escape hatch", () => {
|
||||
expect(linuxArmAndroidGradleSkipMessage("linux", "arm64")).toContain(
|
||||
"OPENCLAW_ANDROID_GRADLE_ALLOW_LINUX_ARM=1",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user