stim 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -8
- package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
- package/dist/act-DHAw2A2S.mjs +2667 -0
- package/dist/activity-BzVfHSrY.mjs +1376 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
- package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
- package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
- package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
- package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/api.d.mts +740 -8
- package/dist/api.mjs +585 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
- package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
- package/dist/budget-Bs6SxxzO.mjs +9154 -0
- package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
- package/dist/build-cache-DmyR9Zzc.mjs +602 -0
- package/dist/build-plan-CaFskB7_.mjs +188 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-0DYf8QhQ.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-B7QVOlCr.d.mts +253 -0
- package/dist/client-UXD70ZbM.mjs +1406 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
- package/dist/config-CYcBF478.mjs +949 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
- package/dist/device-DCxH7_By.mjs +1068 -0
- package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
- package/dist/device-host-worker.mjs +65 -61
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
- package/dist/doctor-BLHCYxzi.mjs +2 -0
- package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
- package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
- package/dist/exec-H20xSg2T.d.mts +65 -0
- package/dist/exec-_UbtCQcG.mjs +750 -0
- package/dist/gc-C-WwL0yi.mjs +3 -0
- package/dist/{gc-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
- package/dist/git-C3iTsJaZ.mjs +73 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
- package/dist/idle-BVeRGroT.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
- package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
- package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
- package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
- package/dist/ios-signing-DTTIChGs.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
- package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
- package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
- package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
- package/dist/logs-BS00Anxf.mjs +352 -0
- package/dist/logs-CMm05HxN.mjs +255 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
- package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +122 -247
- package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
- package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
- package/dist/native-android-JACyjTZs.mjs +844 -0
- package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-DY_RLx3C.mjs +277 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +1 -46
- package/dist/offload-worker.mjs +197 -66
- package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
- package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
- package/dist/prebuild-uD_ipCxF.mjs +449 -0
- package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
- package/dist/pull-request-zjCSAryH.d.mts +120 -0
- package/dist/pull-requests.d.mts +1 -119
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
- package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
- package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
- package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
- package/dist/reload-DzjSl5P_.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
- package/dist/result-DNiS-tTP.mjs +434 -0
- package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
- package/dist/selection-CSl9i5qU.mjs +619 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
- package/dist/server-expo-C-90EhcG.mjs +2 -0
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
- package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
- package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
- package/dist/settings-T1gtc3bf.mjs +114 -0
- package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
- package/dist/settings.schema.json +163 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-DF8VfT64.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-BIS0ydsV.mjs +183 -0
- package/dist/{start-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
- package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
- package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
- package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
- package/dist/stats-report-BFfMpWWF.mjs +16 -0
- package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
- package/dist/status-CSi6tlRq.mjs +2 -0
- package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-GDCfqpTE.mjs} +187 -22
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-C12we7lz.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
- package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
- package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +63 -27
- package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
- package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
- package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
- package/dist/toolchain-DhKwp9iI.mjs +2 -0
- package/dist/toolchain-Hp9sCpK4.mjs +873 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
- package/dist/trigger-Bf3uDcpv.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
- package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
- package/dist/web-DknQETPs.mjs +2 -0
- package/dist/web-run.mjs +11 -12
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
- package/dist/worktree-CK2MpJW5.mjs +2 -0
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
- package/dist/xcode-Zlx3qjEs.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
-
import { $ as settingValueAt } from "./settings-B717odTD.mjs";
|
|
3
|
-
import { x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
|
|
4
|
-
import { T as findBuildTool, o as androidHome } from "./android-Mz_Inn3w.mjs";
|
|
5
|
-
import { i as skippedMissReason } from "./miss-reason-mKzZ4VvN.mjs";
|
|
6
|
-
import { o as resolveCcache } from "./ccache-zdKiYQ3E.mjs";
|
|
7
|
-
import { a as buildGradle, r as androidSdkRefusal } from "./gradle-DSrXb6lG.mjs";
|
|
8
|
-
import { n as androidToolchain } from "./toolchain-DxSsNssu.mjs";
|
|
9
|
-
import { i as nativeGradleTransfer, t as gradleOffloadInputs } from "./native-gradle-inputs-BsLRrl7u.mjs";
|
|
10
|
-
import { n as androidProcessRuntime } from "./launch-F4sOqAhB.mjs";
|
|
11
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
12
|
-
import { isAbsolute, join } from "node:path";
|
|
13
|
-
import { fileURLToPath } from "node:url";
|
|
14
|
-
//#region src/integrations/native-android.ts
|
|
15
|
-
const CACHE_LIMIT = "Native Gradle inputs can include arbitrary external files and plugins; Stim artifact caching is unavailable. Offload requires a complete android.offloadInputs declaration. Gradle still owns incremental and task-cache reuse.";
|
|
16
|
-
const MODEL_LIMIT = "Native Android requires AGP with androidComponents, one application module and configuration-on-demand disabled. Gradle resolves the exact variant and APK outputs during the build.";
|
|
17
|
-
function refusal(reason) {
|
|
18
|
-
return {
|
|
19
|
-
code: "STIM_BUILD_FAILED",
|
|
20
|
-
reason,
|
|
21
|
-
remedy: "Select one signed standalone APK for the requested variant and target ABI in the Android application module, then retry. Stim does not sign APKs or install split APK sets."
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function selectNativeApk(value, variant, abi) {
|
|
25
|
-
const model = value;
|
|
26
|
-
if (!model || model.schema !== 1 || typeof model.module !== "string" || !model.module.startsWith(":") || model.variant !== variant || typeof model.applicationId !== "string" || !/^[A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+$/.test(model.applicationId) || typeof model.sdkDirectory !== "string" || !isAbsolute(model.sdkDirectory) || !Array.isArray(model.elements) || !model.elements.every((element) => element && typeof element.path === "string" && isAbsolute(element.path) && element.path.endsWith(".apk") && Array.isArray(element.filters) && element.filters.every((filter) => filter && typeof filter.type === "string" && typeof filter.value === "string"))) return refusal("Gradle did not export a valid model for the requested native Android variant.");
|
|
27
|
-
const universal = model.elements.filter((element) => element.filters.length === 0);
|
|
28
|
-
const candidates = universal.length ? universal : model.elements.filter((element) => abi !== null && element.filters.length === 1 && element.filters[0].type === "ABI" && element.filters[0].value === abi);
|
|
29
|
-
if (candidates.length !== 1) return refusal(`Native variant "${variant}" has ${candidates.length} installable APK candidates for ${abi ?? "an unspecified ABI"}. Density splits and ambiguous output sets are unsupported.`);
|
|
30
|
-
return {
|
|
31
|
-
apkPath: candidates[0].path,
|
|
32
|
-
androidPackage: model.applicationId
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
async function locateNativeApk(modelFile, variant, abi) {
|
|
36
|
-
let value;
|
|
37
|
-
try {
|
|
38
|
-
value = JSON.parse(readFileSync(modelFile, "utf8"));
|
|
39
|
-
} catch {
|
|
40
|
-
return refusal("Gradle succeeded without exporting the native Android APK model.");
|
|
41
|
-
}
|
|
42
|
-
const located = selectNativeApk(value, variant, abi);
|
|
43
|
-
if ("code" in located) return located;
|
|
44
|
-
try {
|
|
45
|
-
if (!statSync(located.apkPath).isFile()) return refusal("The APK selected by Gradle is not a file.");
|
|
46
|
-
} catch {
|
|
47
|
-
return refusal("The APK selected by Gradle does not exist.");
|
|
48
|
-
}
|
|
49
|
-
const signer = findBuildTool(["apksigner"], { home: value.sdkDirectory });
|
|
50
|
-
if (!signer) return refusal("No Android SDK apksigner is available to verify the native APK signature.");
|
|
51
|
-
try {
|
|
52
|
-
await getExecutor().runFileAsync(signer.path, ["verify", located.apkPath], { timeoutMs: 3e4 });
|
|
53
|
-
} catch (error) {
|
|
54
|
-
return refusal(`The native APK signature could not be verified: ${error.message}`);
|
|
55
|
-
}
|
|
56
|
-
return located;
|
|
57
|
-
}
|
|
58
|
-
function nativeAndroidProject(root) {
|
|
59
|
-
return {
|
|
60
|
-
isExpo: false,
|
|
61
|
-
packageRemedy: "Check the applicationId reported by AGP for the selected application variant.",
|
|
62
|
-
appIds: () => ({
|
|
63
|
-
bundleId: null,
|
|
64
|
-
androidPackage: null
|
|
65
|
-
}),
|
|
66
|
-
variantProblem: () => null,
|
|
67
|
-
targets: [
|
|
68
|
-
"emulator",
|
|
69
|
-
"physical",
|
|
70
|
-
"hosted"
|
|
71
|
-
],
|
|
72
|
-
eas: false,
|
|
73
|
-
runtimeKind: () => "process",
|
|
74
|
-
plan: async () => ({ refusal: {
|
|
75
|
-
code: "STIM_BAD_ARG",
|
|
76
|
-
message: `${MODEL_LIMIT} --plan does not execute Gradle. ${CACHE_LIMIT}`,
|
|
77
|
-
remedy: "Run `stim android` with an exact --variant to resolve and build the native app."
|
|
78
|
-
} }),
|
|
79
|
-
runtime: ({ phase }) => androidProcessRuntime(async () => {
|
|
80
|
-
phase("metro", "skipped (native process)");
|
|
81
|
-
return {
|
|
82
|
-
ok: true,
|
|
83
|
-
prepared: { metroPort: null }
|
|
84
|
-
};
|
|
85
|
-
}),
|
|
86
|
-
artifact: ({ writer, buildPlan, target, out, estimates, settings }) => {
|
|
87
|
-
const variant = buildPlan.variant ?? "debug";
|
|
88
|
-
const inputs = settingValueAt(settings, "android.offloadInputs");
|
|
89
|
-
let transfer = null;
|
|
90
|
-
const modelFile = join(workspaceDir(root), "gradle-build", `native-apk-${encodeURIComponent(variant)}.json`);
|
|
91
|
-
return {
|
|
92
|
-
identity: async () => ({ cacheIneligible: CACHE_LIMIT }),
|
|
93
|
-
cache: () => {
|
|
94
|
-
throw new Error(CACHE_LIMIT);
|
|
95
|
-
},
|
|
96
|
-
prepare: async () => {},
|
|
97
|
-
reconcile: async () => ({
|
|
98
|
-
identity: null,
|
|
99
|
-
rekeyedBy: [],
|
|
100
|
-
cacheRefusal: null
|
|
101
|
-
}),
|
|
102
|
-
validate: async () => null,
|
|
103
|
-
materialize: async () => null,
|
|
104
|
-
explain: () => ({
|
|
105
|
-
reason: skippedMissReason(CACHE_LIMIT),
|
|
106
|
-
diff: null
|
|
107
|
-
}),
|
|
108
|
-
untrackedLine: () => null,
|
|
109
|
-
legacyCache: null,
|
|
110
|
-
offload: {
|
|
111
|
-
supportsUncachedArtifacts: true,
|
|
112
|
-
get unsupported() {
|
|
113
|
-
if (buildPlan.cas) return "Apple Clang CAS builds build here";
|
|
114
|
-
try {
|
|
115
|
-
gradleOffloadInputs(inputs);
|
|
116
|
-
return null;
|
|
117
|
-
} catch (error) {
|
|
118
|
-
return error.message;
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
target: () => {
|
|
122
|
-
transfer = nativeGradleTransfer(root, inputs);
|
|
123
|
-
return {
|
|
124
|
-
platform: "android",
|
|
125
|
-
native: "gradle",
|
|
126
|
-
local: androidToolchain(),
|
|
127
|
-
requires: {
|
|
128
|
-
ndk: null,
|
|
129
|
-
buildTools: null,
|
|
130
|
-
compileSdk: null
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
get request() {
|
|
135
|
-
if (!transfer) throw new Error("Native Gradle offload needs a declared source inventory.");
|
|
136
|
-
return {
|
|
137
|
-
platform: "android",
|
|
138
|
-
isExpo: false,
|
|
139
|
-
native: {
|
|
140
|
-
provider: "gradle",
|
|
141
|
-
transfer
|
|
142
|
-
},
|
|
143
|
-
android: {
|
|
144
|
-
variant,
|
|
145
|
-
abi: target.abi,
|
|
146
|
-
gradleBuildCache: buildPlan.gradleBuildCache,
|
|
147
|
-
pch: buildPlan.pch,
|
|
148
|
-
compilerCache: buildPlan.compilerCache === "none" ? "none" : "ccache"
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
},
|
|
152
|
-
unchanged: async () => transfer !== null && nativeGradleTransfer(root, inputs).digest === transfer.digest
|
|
153
|
-
},
|
|
154
|
-
compile: async () => {
|
|
155
|
-
const script = ["../shim/native-android.gradle", "../../shim/native-android.gradle"].map((path) => fileURLToPath(new URL(path, import.meta.url))).find(existsSync);
|
|
156
|
-
if (!script) throw new Error("Stim installation is missing shim/native-android.gradle.");
|
|
157
|
-
return buildGradle({
|
|
158
|
-
root,
|
|
159
|
-
logWriter: writer,
|
|
160
|
-
variant,
|
|
161
|
-
project: {
|
|
162
|
-
directory: root,
|
|
163
|
-
gradlew: join(root, process.platform === "win32" ? "gradlew.bat" : "gradlew"),
|
|
164
|
-
module: ":",
|
|
165
|
-
outputsDir: root
|
|
166
|
-
},
|
|
167
|
-
task: ":stimExportAndroidApk",
|
|
168
|
-
projectArgs: [
|
|
169
|
-
"--init-script",
|
|
170
|
-
script,
|
|
171
|
-
`-Pstim.native.variant=${variant}`,
|
|
172
|
-
`-Pstim.native.model=${modelFile}`
|
|
173
|
-
],
|
|
174
|
-
locate: () => locateNativeApk(modelFile, variant, target.abi)
|
|
175
|
-
}, {
|
|
176
|
-
estimateMs: estimates().coldBuildMs,
|
|
177
|
-
ccache: buildPlan.compilerCache === "ccache" ? resolveCcache({
|
|
178
|
-
root,
|
|
179
|
-
onNote: out
|
|
180
|
-
}) : null,
|
|
181
|
-
cas: buildPlan.cas,
|
|
182
|
-
buildCache: buildPlan.gradleBuildCache,
|
|
183
|
-
pch: buildPlan.pch,
|
|
184
|
-
compilerCacheDisabled: buildPlan.compilerCache === "none"
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function nativeAndroidDoctor(root) {
|
|
192
|
-
return { inspect: () => {
|
|
193
|
-
const sdkPath = androidHome();
|
|
194
|
-
const sdk = androidSdkRefusal({
|
|
195
|
-
sdkPath,
|
|
196
|
-
sdkExists: existsSync(sdkPath),
|
|
197
|
-
hasLocalProperties: existsSync(join(root, "local.properties")),
|
|
198
|
-
localPropertiesPath: "local.properties"
|
|
199
|
-
});
|
|
200
|
-
const wrapper = join(root, process.platform === "win32" ? "gradlew.bat" : "gradlew");
|
|
201
|
-
return [
|
|
202
|
-
{
|
|
203
|
-
level: "note",
|
|
204
|
-
title: "Native Android Gradle project",
|
|
205
|
-
detail: `${MODEL_LIMIT} ${CACHE_LIMIT} Metro and EAS are unsupported; local, physical and hosted targets use native process readiness.`,
|
|
206
|
-
fix: null
|
|
207
|
-
},
|
|
208
|
-
...sdk ? [{
|
|
209
|
-
level: "cost",
|
|
210
|
-
code: "android-sdk-missing",
|
|
211
|
-
title: "No Android SDK was found",
|
|
212
|
-
detail: sdk.reason,
|
|
213
|
-
fix: sdk.remedy
|
|
214
|
-
}] : [],
|
|
215
|
-
...!existsSync(wrapper) ? [{
|
|
216
|
-
level: "cost",
|
|
217
|
-
code: "android-wrapper-missing",
|
|
218
|
-
title: "The Gradle wrapper for this host is missing",
|
|
219
|
-
detail: wrapper,
|
|
220
|
-
fix: "Restore the project Gradle wrapper."
|
|
221
|
-
}] : []
|
|
222
|
-
];
|
|
223
|
-
} };
|
|
224
|
-
}
|
|
225
|
-
//#endregion
|
|
226
|
-
export { nativeAndroidDoctor, nativeAndroidProject };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "@stim-cli/core/state";
|
|
2
|
-
//#region src/ndjson.d.ts
|
|
3
|
-
interface NdjsonWriter {
|
|
4
|
-
readonly file: string;
|
|
5
|
-
write(record: unknown): boolean;
|
|
6
|
-
close(): {
|
|
7
|
-
file: string;
|
|
8
|
-
written: number;
|
|
9
|
-
dropped: number;
|
|
10
|
-
lastError: Error | null;
|
|
11
|
-
};
|
|
12
|
-
readonly written: number;
|
|
13
|
-
readonly dropped: number;
|
|
14
|
-
readonly lastError: Error | null;
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { NdjsonWriter as t };
|
package/dist/plan-C4TjdPsR.mjs
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { V as deviceSlotPlatforms, p as getProject } from "./config-BYDxlMY3.mjs";
|
|
2
|
-
import { B as remoteAndroidSetting, F as parseIosRemote, Q as settingShapeErrors, U as resolveAndroidLayout, W as resolveCacheProviderConfig, Y as settingFile, Z as settingOriginScope, a as SETTING_SHAPE_REMEDY, d as androidLayoutSetting, et as settingsLayers, f as androidLayoutSettingError, nt as unknownSettingKeys, p as cacheProviderSettingError, s as androidAvdConfigSettingError, u as androidDataPartitionSizeGbSettingError } from "./settings-B717odTD.mjs";
|
|
3
|
-
import { _ as detectIsExpo } from "./project-_phNIJfs.mjs";
|
|
4
|
-
import { B as ownedAvdSystemImage, F as ownedAvdDeviceProfile, K as profileNeedsFoldFeature, Q as systemImageSupportsFold, W as pickDefaultSystemImage, dt as parkedMaxSetting, j as listInstalledSystemImages, k as listAvdDeviceProfiles, t as DEFAULT_AVD_DEVICE_PROFILE } from "./android-Mz_Inn3w.mjs";
|
|
5
|
-
import { d as optimizationBuildProfile, l as artifactCachePolicy, p as resolveOptimizations, u as compilerCacheFallbackMessage } from "./errors-DzkMYh8Q.mjs";
|
|
6
|
-
import { r as isPhysicalDeviceRequest } from "./native-runtime-k8dTIrbK.mjs";
|
|
7
|
-
import { t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-CBUAcRyQ.mjs";
|
|
8
|
-
import { C as remoteAvdFlagRefusal, D as systemImageRefusal, E as resolveVariant, T as resolveSystemImage, m as deviceProfileRefusal, v as foldableImageRefusal, w as resolveDeviceProfile, y as isReleaseVariant } from "./support-DMTqj3Hm.mjs";
|
|
9
|
-
import { c as readProductFlavors, s as productFlavorRefusal } from "./react-native-build-CtCccJtb.mjs";
|
|
10
|
-
import { n as resolveAndroidCas, r as resolveAndroidCompilerCache } from "./android-cas-Bl-cLJBk.mjs";
|
|
11
|
-
import { l as parseDeviceWait } from "./device-lease-run-Cw2M4z51.mjs";
|
|
12
|
-
//#region src/integrations/android-project.ts
|
|
13
|
-
var AndroidRecipeRefusal = class extends Error {
|
|
14
|
-
failure;
|
|
15
|
-
missReason;
|
|
16
|
-
constructor(failure, missReason) {
|
|
17
|
-
super(failure.message ?? failure.code);
|
|
18
|
-
this.failure = failure;
|
|
19
|
-
this.missReason = missReason;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/commands/android/plan.ts
|
|
24
|
-
function slotOwnedAvd(projectPath, slot) {
|
|
25
|
-
const android = deviceSlotPlatforms(getProject(projectPath), slot)?.android;
|
|
26
|
-
if (!android?.owned || !android.avdName || android.setupIncomplete) return null;
|
|
27
|
-
const systemImage = ownedAvdSystemImage(android.avdName);
|
|
28
|
-
return systemImage ? {
|
|
29
|
-
avdName: android.avdName,
|
|
30
|
-
systemImage,
|
|
31
|
-
deviceProfile: ownedAvdDeviceProfile(android.avdName)
|
|
32
|
-
} : null;
|
|
33
|
-
}
|
|
34
|
-
function fail(code, message, remedy, { lines = [] } = {}) {
|
|
35
|
-
return {
|
|
36
|
-
ok: false,
|
|
37
|
-
code,
|
|
38
|
-
message,
|
|
39
|
-
remedy,
|
|
40
|
-
lines
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function androidLayoutError(settings, root, bound, isExpo) {
|
|
44
|
-
const error = androidLayoutSettingError(settings, root, bound);
|
|
45
|
-
if (error || !androidLayoutSetting(settings, root, bound).custom || !isExpo()) return error;
|
|
46
|
-
return "android.gradleRoot and android.module apply to bare React Native apps only: expo prebuild generates and builds android/. Remove them for this Expo app.";
|
|
47
|
-
}
|
|
48
|
-
function androidCompilerCache({ root, optimizations, settingsContext, layout }) {
|
|
49
|
-
const { cas, optimizations: resolved } = resolveAndroidCompilerCache({
|
|
50
|
-
optimizations,
|
|
51
|
-
use: (manifest) => resolveAndroidCas(root, {
|
|
52
|
-
...process.env,
|
|
53
|
-
STIM_ANDROID_CAS_TOOLCHAIN: manifest
|
|
54
|
-
}, layout)
|
|
55
|
-
});
|
|
56
|
-
const fallback = resolved.android.compilerCacheFallback;
|
|
57
|
-
if (!fallback) return {
|
|
58
|
-
cas,
|
|
59
|
-
optimizations: resolved,
|
|
60
|
-
warning: null
|
|
61
|
-
};
|
|
62
|
-
return {
|
|
63
|
-
cas,
|
|
64
|
-
optimizations: resolved,
|
|
65
|
-
warning: `Warning: ${compilerCacheFallbackMessage({
|
|
66
|
-
fallback,
|
|
67
|
-
compilerCache: resolved.android.compilerCache === "none" ? "none" : "ccache",
|
|
68
|
-
file: settingFile(settingsContext, fallback.key)
|
|
69
|
-
})}`
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function resolveAndroidBuildPlan({ settings, settingsContext, easProfile, variant: variantFlag, buildCache: requestedBuildCache }, { warn, runtimeKind, resolveCompilerCache = androidCompilerCache, resolveCacheProvider = resolveCacheProviderConfig, variantProblem, detectExpo = () => detectIsExpo(settingsContext.projectPath) }) {
|
|
73
|
-
const root = settingsContext.projectPath;
|
|
74
|
-
const [shapeError, ...moreShapeErrors] = settingShapeErrors(settings);
|
|
75
|
-
if (shapeError) return fail("STIM_BAD_ARG", shapeError, SETTING_SHAPE_REMEDY, { lines: moreShapeErrors });
|
|
76
|
-
const bound = settingsContext.repoRoot ?? root;
|
|
77
|
-
const layoutError = androidLayoutError(settings, root, bound, detectExpo);
|
|
78
|
-
if (layoutError) return fail("STIM_BAD_ARG", layoutError, SETTING_SHAPE_REMEDY);
|
|
79
|
-
const layout = resolveAndroidLayout(settings, root, bound);
|
|
80
|
-
for (const key of unknownSettingKeys(settings)) warn("setting", `Warning: setting "${key}" is not read by Stim and will be ignored.`);
|
|
81
|
-
let optimizations;
|
|
82
|
-
try {
|
|
83
|
-
optimizations = resolveOptimizations(settings);
|
|
84
|
-
} catch (error) {
|
|
85
|
-
return fail("STIM_BAD_ARG", `Could not configure Android build: ${error.message}`, SETTING_SHAPE_REMEDY);
|
|
86
|
-
}
|
|
87
|
-
const compilerCache = resolveCompilerCache({
|
|
88
|
-
root,
|
|
89
|
-
optimizations,
|
|
90
|
-
settingsContext,
|
|
91
|
-
layout
|
|
92
|
-
});
|
|
93
|
-
const cas = compilerCache.cas;
|
|
94
|
-
optimizations = compilerCache.optimizations;
|
|
95
|
-
if (compilerCache.warning) warn("cache", compilerCache.warning);
|
|
96
|
-
const buildProfile = optimizationBuildProfile("android", optimizations);
|
|
97
|
-
const cacheProviderConfig = resolveCacheProvider(settingsContext);
|
|
98
|
-
const cacheProviderError = cacheProviderSettingError(settings);
|
|
99
|
-
if (cacheProviderError) warn("cache", `${cacheProviderError} Using the local cache.`);
|
|
100
|
-
const variant = easProfile !== void 0 ? "debug" : resolveVariant(variantFlag, settings);
|
|
101
|
-
const flavorRefusal = variantProblem(variant);
|
|
102
|
-
if (flavorRefusal) return fail(flavorRefusal.code, flavorRefusal.reason, flavorRefusal.remedy);
|
|
103
|
-
const release = isReleaseVariant(variant);
|
|
104
|
-
return {
|
|
105
|
-
ok: true,
|
|
106
|
-
plan: {
|
|
107
|
-
build: {
|
|
108
|
-
variant,
|
|
109
|
-
release,
|
|
110
|
-
profile: buildProfile,
|
|
111
|
-
cas,
|
|
112
|
-
cache: artifactCachePolicy(optimizations, requestedBuildCache, runtimeKind({ release }) === "embedded-js"),
|
|
113
|
-
compilerCache: optimizations.android.compilerCache,
|
|
114
|
-
gradleBuildCache: optimizations.android.gradleBuildCache,
|
|
115
|
-
pch: optimizations.android.pch,
|
|
116
|
-
targetAbiOnly: optimizations.android.targetAbiOnly
|
|
117
|
-
},
|
|
118
|
-
metroWarmup: optimizations.metroWarmup,
|
|
119
|
-
cacheProviderConfig
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function resolveAndroidRunPlan({ settings, settingsContext, slot, easProfile, variant: variantFlag, systemImage: systemImageFlag, deviceProfile: deviceProfileFlag, device: deviceFlag, wait: waitFlag, waitConflict, remote: commandRemoteBackend, buildCache: requestedBuildCache }, { warn, runtimeKind, resolveCompilerCache = androidCompilerCache, resolveCacheProvider = resolveCacheProviderConfig, validateAvdConfig = androidAvdConfigSettingError, readFlavors = readProductFlavors, variantProblem = (variant) => productFlavorRefusal({
|
|
124
|
-
flavors: readFlavors(resolveAndroidLayout(settings, settingsContext.projectPath, settingsContext.repoRoot ?? settingsContext.projectPath)),
|
|
125
|
-
variant
|
|
126
|
-
}), detectExpo = () => detectIsExpo(settingsContext.projectPath), listSystemImages = listInstalledSystemImages, listDeviceProfiles = listAvdDeviceProfiles, parkedLimit = parkedMaxSetting, supportsFold = systemImageSupportsFold, ownedAvd = slotOwnedAvd }) {
|
|
127
|
-
const root = settingsContext.projectPath;
|
|
128
|
-
const [shapeError, ...moreShapeErrors] = [parkedLimit("android").error, ...settingShapeErrors(settings)].filter((error) => Boolean(error));
|
|
129
|
-
if (shapeError) return fail("STIM_BAD_ARG", shapeError, SETTING_SHAPE_REMEDY, { lines: moreShapeErrors });
|
|
130
|
-
const plannedBuild = resolveAndroidBuildPlan({
|
|
131
|
-
settings,
|
|
132
|
-
settingsContext,
|
|
133
|
-
easProfile,
|
|
134
|
-
variant: variantFlag,
|
|
135
|
-
buildCache: requestedBuildCache
|
|
136
|
-
}, {
|
|
137
|
-
warn,
|
|
138
|
-
runtimeKind,
|
|
139
|
-
resolveCompilerCache,
|
|
140
|
-
resolveCacheProvider,
|
|
141
|
-
variantProblem,
|
|
142
|
-
detectExpo
|
|
143
|
-
});
|
|
144
|
-
if (!plannedBuild.ok) return plannedBuild;
|
|
145
|
-
const dataPartitionSizeError = androidDataPartitionSizeGbSettingError(settings);
|
|
146
|
-
if (dataPartitionSizeError) return fail("STIM_BAD_ARG", dataPartitionSizeError, "Set android.dataPartitionSizeGb to a whole number of GiB from 6 through 16384.");
|
|
147
|
-
const avdConfigError = validateAvdConfig(settings, root);
|
|
148
|
-
if (avdConfigError) return fail("STIM_BAD_ARG", avdConfigError, "Use only documented android.avdConfig keys, or an android.avdConfigFile fragment contained by the app directory.");
|
|
149
|
-
const systemImage = resolveSystemImage(systemImageFlag, settings);
|
|
150
|
-
const deviceProfile = resolveDeviceProfile(deviceProfileFlag, settings);
|
|
151
|
-
const isExpo = detectExpo();
|
|
152
|
-
const physical = isPhysicalDeviceRequest(deviceFlag);
|
|
153
|
-
if (physical && deviceFlag === "") return fail("STIM_BAD_ARG", "--device was given an empty serial.", "Pass `--device` on its own to take the first connected device this workspace can lease, or `--device <serial>` to name one.");
|
|
154
|
-
if (physical && commandRemoteBackend) return fail("STIM_BAD_ARG", "--device installs on a device connected to this machine, and --remote installs on a remote one.", "Pass only one of --device and --remote.");
|
|
155
|
-
const noWait = waitFlag === false;
|
|
156
|
-
if (waitConflict) return fail("STIM_BAD_ARG", "--wait and --no-wait ask for opposite things.", "Pass only one of `--wait <seconds>` and `--no-wait`.");
|
|
157
|
-
const waitParsed = parseDeviceWait(noWait ? void 0 : waitFlag);
|
|
158
|
-
if ("error" in waitParsed) return fail("STIM_BAD_ARG", waitParsed.error, "Pass a whole number of seconds, e.g. --wait 90. `--wait 0` refuses a busy lease or device slot at once.");
|
|
159
|
-
const waitSeconds = waitParsed.seconds;
|
|
160
|
-
const remoteTarget = commandRemoteBackend !== null ? parseIosRemote(commandRemoteBackend) : remoteAndroidSetting(settings);
|
|
161
|
-
if (physical && remoteTarget?.kind === "machine") return fail("STIM_BAD_ARG", "--device installs on a phone connected to this machine, and --remote installs on a remote one.", "Pass only one of --device and --remote; unset android.remote for a local phone.");
|
|
162
|
-
const machine = remoteTarget?.kind === "machine" ? remoteTarget.machine : null;
|
|
163
|
-
const remoteBackend = !physical && remoteTarget?.kind === "backend" ? remoteTarget.backend : null;
|
|
164
|
-
if (!machine) {
|
|
165
|
-
const refusal = androidDeviceSelectorRefusal({
|
|
166
|
-
settingsContext,
|
|
167
|
-
slot,
|
|
168
|
-
systemImageFlag,
|
|
169
|
-
deviceProfileFlag,
|
|
170
|
-
systemImage,
|
|
171
|
-
deviceProfile,
|
|
172
|
-
physical,
|
|
173
|
-
remoteBackend
|
|
174
|
-
}, {
|
|
175
|
-
listSystemImages,
|
|
176
|
-
listDeviceProfiles,
|
|
177
|
-
supportsFold,
|
|
178
|
-
ownedAvd
|
|
179
|
-
});
|
|
180
|
-
if (refusal) return refusal;
|
|
181
|
-
}
|
|
182
|
-
const target = physical ? {
|
|
183
|
-
kind: "physical",
|
|
184
|
-
serial: typeof deviceFlag === "string" ? deviceFlag : null,
|
|
185
|
-
lease: {
|
|
186
|
-
waitSeconds,
|
|
187
|
-
noWait
|
|
188
|
-
}
|
|
189
|
-
} : machine ? {
|
|
190
|
-
kind: "hosted",
|
|
191
|
-
machine,
|
|
192
|
-
systemImage,
|
|
193
|
-
deviceProfile
|
|
194
|
-
} : remoteBackend ? {
|
|
195
|
-
kind: "remote",
|
|
196
|
-
backend: remoteBackend,
|
|
197
|
-
systemImage,
|
|
198
|
-
deviceProfile
|
|
199
|
-
} : {
|
|
200
|
-
kind: "emulator",
|
|
201
|
-
systemImage,
|
|
202
|
-
deviceProfile
|
|
203
|
-
};
|
|
204
|
-
return {
|
|
205
|
-
ok: true,
|
|
206
|
-
plan: {
|
|
207
|
-
...plannedBuild.plan,
|
|
208
|
-
target,
|
|
209
|
-
deviceSlotWaitMs: noWait ? 0 : waitFlag === void 0 && !physical ? DEFAULT_DEVICE_SLOT_WAIT_MS : waitSeconds * 1e3,
|
|
210
|
-
isExpo
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function androidDeviceSelectorRefusal({ settingsContext, slot, systemImageFlag, deviceProfileFlag, systemImage, deviceProfile, physical, remoteBackend }, { listSystemImages = listInstalledSystemImages, listDeviceProfiles = listAvdDeviceProfiles, supportsFold = systemImageSupportsFold, ownedAvd = slotOwnedAvd } = {}) {
|
|
215
|
-
const root = settingsContext.projectPath;
|
|
216
|
-
const settingsLayersForOrigin = settingsLayers(settingsContext);
|
|
217
|
-
const imageRefusal = systemImageRefusal({
|
|
218
|
-
slot,
|
|
219
|
-
flag: systemImageFlag,
|
|
220
|
-
resolved: systemImage,
|
|
221
|
-
origin: settingOriginScope(settingsLayersForOrigin, "android.systemImage"),
|
|
222
|
-
physical,
|
|
223
|
-
remoteBackend,
|
|
224
|
-
listImages: listSystemImages
|
|
225
|
-
});
|
|
226
|
-
if (imageRefusal) return fail(imageRefusal.code, imageRefusal.message, imageRefusal.remedy);
|
|
227
|
-
const profileRefusal = deviceProfileRefusal({
|
|
228
|
-
flag: deviceProfileFlag,
|
|
229
|
-
resolved: deviceProfile,
|
|
230
|
-
origin: settingOriginScope(settingsLayersForOrigin, "android.deviceProfile"),
|
|
231
|
-
physical,
|
|
232
|
-
remoteBackend,
|
|
233
|
-
listProfiles: listDeviceProfiles
|
|
234
|
-
});
|
|
235
|
-
if (profileRefusal) return fail(profileRefusal.code, profileRefusal.message, profileRefusal.remedy);
|
|
236
|
-
const avdFlagRefusal = remoteAvdFlagRefusal({
|
|
237
|
-
systemImageFlag,
|
|
238
|
-
deviceProfileFlag,
|
|
239
|
-
remoteBackend
|
|
240
|
-
});
|
|
241
|
-
if (avdFlagRefusal) return fail(avdFlagRefusal.code, avdFlagRefusal.message, avdFlagRefusal.remedy);
|
|
242
|
-
if (!physical && !remoteBackend) {
|
|
243
|
-
const flagImage = typeof systemImageFlag === "string" && systemImageFlag.trim() ? systemImageFlag.trim() : null;
|
|
244
|
-
const existing = ownedAvd(root, slot);
|
|
245
|
-
const profile = deviceProfile ?? existing?.deviceProfile ?? DEFAULT_AVD_DEVICE_PROFILE;
|
|
246
|
-
const image = () => flagImage ?? existing?.systemImage ?? systemImage ?? pickDefaultSystemImage(listSystemImages())?.pkg ?? null;
|
|
247
|
-
const checked = profileNeedsFoldFeature(profile) ? image() : null;
|
|
248
|
-
const foldRefusal = checked !== null && foldableImageRefusal({
|
|
249
|
-
profile,
|
|
250
|
-
image: checked,
|
|
251
|
-
avdName: existing && existing.systemImage === checked && existing.deviceProfile === profile ? existing.avdName : null,
|
|
252
|
-
images: listSystemImages,
|
|
253
|
-
supportsFold
|
|
254
|
-
});
|
|
255
|
-
if (foldRefusal) return fail(foldRefusal.code, foldRefusal.message, foldRefusal.remedy);
|
|
256
|
-
}
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
//#endregion
|
|
260
|
-
export { AndroidRecipeRefusal as i, resolveAndroidBuildPlan as n, resolveAndroidRunPlan as r, androidDeviceSelectorRefusal as t };
|